From 7692b04908f0f4e880673eb6c4f30acc9b665a91 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Tue, 22 Nov 2022 13:25:09 +0100 Subject: [PATCH] Splits extension install into seperate function (#23) #### :book: Summary - implements `--install-extensions` function #### :bookmark_tabs: Test Plan > :bulb: Select your test plan for the code changes. - [x] CI pipeline tests - [ ] Custom test - [ ] No test plan ##### Details / Justification #### :books: Additional Notes Co-authored-by: OCram85 Reviewed-on: https://gitea.ocram85.com/CodeServer/arkanum/pulls/23 --- .woodpecker/.next.yml | 10 ++++++++++ Dockerfile | 2 +- README.md | 1 + arkanum | 32 ++++++++++++++++++++------------ arkanum-completion | 2 +- 5 files changed, 33 insertions(+), 14 deletions(-) diff --git a/.woodpecker/.next.yml b/.woodpecker/.next.yml index f307712..bf2c4c8 100644 --- a/.woodpecker/.next.yml +++ b/.woodpecker/.next.yml @@ -17,3 +17,13 @@ pipeline: from_secret: gitea_passwd when: event: pull_request + + triggerPortainer: + image: ocram85/portainer-serviceupdate + settings: + #VERBOSE: true + URI: "https://portainer.ocram85.com" + TOKEN: + from_secret: NEXT_TOKEN + when: + event: pull_request \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index dfaf738..0d73259 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN \ chmod +x /etc/bash_completion.d/arkanum-completion && \ echo 'source /etc/bash_completion.d/arkanum-completion' >> /etc/bash.bashrc && \ touch "$HOME/enable_motd" && \ - echo "if [[ ! -e \"$HOME/data/User/settings.json\" ]]; then arkanum --reset-codesetting && \ + echo "if [[ ! -e \"$HOME/data/User/settings.json\" ]]; then arkanum --install-extensions && arkanum --reset-codesetting && \ echo -e \"🧙 \\e[32markanum\\e[0m: Please reload Arkanum to finalize the setup...\" && read foo; fi" >> /etc/bash.bashrc && \ echo "if [[ -e \"$HOME/enable_motd\" ]]; then echo -e \"Use 🧙 \\e[32m'arkanum'\\e[0m to install missing runtimes like dotnet or NodeJs.\"; fi" >> /etc/bash.bashrc diff --git a/README.md b/README.md index e3213fc..42a1947 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ This helps reducing the image size. nodejs Installs latest NodeJs LTS version. powershell Installs latest PowerShell LTS version. --disable-motd Disables hint in new bash terminal. + --install-extensions Installs predefined recommended extensions. --reset-codesetting Sets VS Code user setting with basic (Fira Code). -h Prints this help message. diff --git a/arkanum b/arkanum index ada4437..8c488ac 100755 --- a/arkanum +++ b/arkanum @@ -15,6 +15,7 @@ function showHelp() { nodejs Installs latest NodeJs LTS version. powershell Installs latest PowerShell LTS version. --disable-motd Disables hint in new bash terminal. + --install-extensions Installs predefined recommended extensions. --reset-codesetting Sets VS Code user setting with basic (Fira Code). -h Prints this help message. @@ -135,33 +136,37 @@ function instGiteaTools() { say "done." "Gitea" } -function setCodeSettings() { - CODEFILE="$HOME/data/User/settings.json" - say "Downloading required extensions...." "VSCode" +function instCodeExtension() { + say "Downloading required extensions...." "Extension" # Gitlens - say "Downloading 'gitlens'..." "VSCode" + say "Downloading 'gitlens'..." "Extension" curl -fsSL https://open-vsx.org/api/eamodio/gitlens/13.1.1/file/eamodio.gitlens-13.1.1.vsix -o /tmp/eamodio.gitlens-13.1.1.vsix - say "Installing 'gitlens'..." "VSCode" + say "Installing 'gitlens'..." "Extension" install-extension /tmp/eamodio.gitlens-13.1.1.vsix - say "Cleaning up 'gitlens' install files" "VSCode" + say "Cleaning up 'gitlens' install files" "Extension" rm -f /tmp/eamodio.gitlens-13.1.1.vsix # OneDarkPro - say "Downloading 'One Dark Pro' theme..." "VSCode" + say "Downloading 'One Dark Pro' theme..." "V" curl -fsSL https://open-vsx.org/api/zhuangtongfa/material-theme/3.15.6/file/zhuangtongfa.material-theme-3.15.6.vsix -o /tmp/zhuangtongfa.material-theme-3.15.6.vsix - say "Installing 'One Dark Pro' theme..." "VSCode" + say "Installing 'One Dark Pro' theme..." "Extension" install-extension /tmp/zhuangtongfa.material-theme-3.15.6.vsix - say "Cleaning up 'One Dark Pro' install files" "VSCode" + say "Cleaning up 'One Dark Pro' install files" "Extension" rm -f /tmp/zhuangtongfa.material-theme-3.15.6.vsix # vscode-icons - say "Downloading 'vscode-icons' theme..." "VSCode" + say "Downloading 'vscode-icons' theme..." "Extension" curl -fsSL https://open-vsx.org/api/vscode-icons-team/vscode-icons/12.0.1/file/vscode-icons-team.vscode-icons-12.0.1.vsix -o /tmp/vscode-icons-team.vscode-icons-12.0.1.vsix - say "Installing 'vscode-icons' theme..." "VSCode" + say "Installing 'vscode-icons' theme..." "Extension" install-extension /tmp/vscode-icons-team.vscode-icons-12.0.1.vsix - say "Cleaning up 'vscode-icons' install files" "VSCode" + say "Cleaning up 'vscode-icons' install files" "Extension" rm -f /tmp/vscode-icons-team.vscode-icons-12.0.1.vsix + say "done." "Extension" +} +function setCodeSettings() { + CODEFILE="$HOME/data/User/settings.json" + # VSCode user settings file say "Setting VScode base settings.($CODEFILE)" "VSCode" cat <