1 Commits

Author SHA1 Message Date
46fc34c191 update changelog 2023-07-19 13:32:20 +02:00
6 changed files with 82 additions and 188 deletions

View File

@ -23,20 +23,14 @@ pipeline:
buildTag: buildTag:
image: woodpeckerci/plugin-docker-buildx image: woodpeckerci/plugin-docker-buildx
settings: settings:
repo: gitea.ocram85.com/codeserver/arkanum, ocram85/arkanum registry: gitea.ocram85.com
repo: gitea.ocram85.com/codeserver/arkanum
dockerfile: Dockerfile dockerfile: Dockerfile
auto_tag: true auto_tag: true
logins: username:
- registry: https://gitea.ocram85.com from_secret: gitea_user
username: password:
from_secret: gitea_user from_secret: gitea_passwd
password:
from_secret: gitea_passwd
- registry: https://index.docker.io/v1/
username:
from_secret: docker_user
password:
from_secret: docker_passwd
build_args: build_args:
- VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}} - VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}}
- TAG=${CI_COMMIT_TAG} - TAG=${CI_COMMIT_TAG}

View File

@ -70,11 +70,10 @@
* 🤖 DEPENDENCIES * 🤖 DEPENDENCIES
* Update quay.io/linuxserver.io/code-server Docker tag to v4.14.1 (#47) * Update quay.io/linuxserver.io/code-server Docker tag to v4.14.1 (#47)
## [v0.4.0](https://gitea.ocram85.com/CodeServer/arkanum/releases/tag/v0.4.0) - 2023-07-19 ## [v0.4.0](https://gitea.ocram85.com/CodeServer/arkanum/releases/tag/v0.4.0) - 2023-07-19
* 🐛 BUGFIXES * 🐛 BUGFIXES
* Fix shellcheck issues (#55)
* Disable starship python module (#52) * Disable starship python module (#52)
* ✨ FEATURES * ✨ FEATURES
* Add docker-cli (#54) * Add docker-cli (#54)

View File

@ -1,4 +1,4 @@
FROM quay.io/linuxserver.io/code-server:4.16.1 FROM quay.io/linuxserver.io/code-server:4.14.1
#LABEL build_version="" #LABEL build_version=""
LABEL maintainer="OCram85" LABEL maintainer="OCram85"
@ -40,7 +40,7 @@ RUN \
chmod +x /etc/bash_completion.d/arkanum-completion && \ chmod +x /etc/bash_completion.d/arkanum-completion && \
echo 'source /etc/bash_completion.d/arkanum-completion' >> /etc/bash.bashrc && \ echo 'source /etc/bash_completion.d/arkanum-completion' >> /etc/bash.bashrc && \
touch "$HOME/enable_motd" && \ touch "$HOME/enable_motd" && \
echo "if [[ ! -e \"$HOME/data/User/settings.json\" ]]; then arkanum config install-extensions && arkanum config reset-codesettings && \ 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 -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 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

View File

@ -55,7 +55,7 @@ Therefore you need
version: "3.8" version: "3.8"
services: services:
arkanum: arkanum:
image: gitea.ocram85.com/codeserver/arkanum:0.4.0 image: gitea.ocram85.com/codeserver/arkanum:0.2.0
environment: environment:
- PUID=1000 - PUID=1000
- PGID=1000 - PGID=1000
@ -77,11 +77,10 @@ services:
volumes: volumes:
# store workspace and use config in volume. # store workspace and use config in volume.
- codedata:/config - codedata:/config
# mount docker socket to manage host docker
- /var/run/docker.sock:/var/run/docker.sock
# no need to expose the port. traefik acts as reverse proxy and handles the https access. # no need to expose the port. traefik acts as reverse proxy and handles the https access.
#ports: #ports:
# - 8443:8443 # - 8443:8443
restart: unless-stopped
networks: networks:
- arkanum-sphere - arkanum-sphere
- traefik-public - traefik-public
@ -107,7 +106,7 @@ See their [docs](https://github.com/linuxserver/docker-code-server#parameters) a
version: "3.8" version: "3.8"
services: services:
arkanum: arkanum:
image: gitea.ocram85.com/codeserver/arkanum:0.4.0 image: gitea.ocram85.com/codeserver/arkanum:0.2.0
container_name: code-server container_name: code-server
environment: environment:
- PUID=1000 - PUID=1000
@ -170,39 +169,26 @@ Added `arkanum` to help installing common runtimes in container.
This helps reducing the image size. This helps reducing the image size.
``` ```
🧙 arkanum ✨🌌☄️💥 is used to install optional tools for developing in a 🧙 arkanum ✨🌌☄️💥 is used to install optional runtimes for developing in a
code-server container environment. code-server container environment.
Syntax: arkanum <flags> COMMAND OPTION ARGUMENT Syntax: arkanum RUNTIME ...
COMMAND RUNTIME [docker-cli|dotnet|gitea|golang|nodejs|volta|powershell]
config The config command is used to modify arkanum itself. docker-cli Installs the latest docker-ce cli.
git The git command is a wrapper for git helpers. dotnet Installs latest LTS dotnet core sdk + runtime.
install The install command is used to add different tools gitea Installs gitea tools like the changelog generator.
help Shows this help text. golang Installs golang 1.19.3.
nodejs Installs latest NodeJs LTS version using Volta.
volta Installs Volta as NodeJs version manager.
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.
OPTION Example 1: arkanum dotnet
config: Example 2: arkanum golang nodejs
disable-motd Disables hint in new bash terminal. Example 3: arkanum --disable-motd
install extensions Installs predefined recommended extensions.
reset-codesettings Sets VS Code user setting with basic (Fira Code).
git:
setup Takes two arguments to setup the git client:
1) Username
2) Email address
install:
docker-cli Installs the latest docker-cli.
dotnet Installs latest LTS dotnet core sdk + runtime.
gitea Installs gitea tools like the changelog generator.
golang Installs golang 1.19.3.
nodejs Installs latest NodeJs LTS version using Volta.
volta Installs Volta as NodeJS version manager.
powershell Installs latest PowerShell LTS version.
Example 1: arkanum git setup "my-name" "my-email"
Example 2: arkanum install golang
Example 3: arkanum config disable-motd
``` ```
### 📝 Fira Code (NerdFont patched) ### 📝 Fira Code (NerdFont patched)

151
arkanum
View File

@ -4,39 +4,26 @@ set -e
function showHelp() { function showHelp() {
cat << HELP cat << HELP
🧙 arkanum ✨🌌☄️💥 is used to install optional tools for developing in a 🧙 arkanum ✨🌌☄️💥 is used to install optional runtimes for developing in a
code-server container environment. code-server container environment.
Syntax: arkanum <flags> COMMAND OPTION ARGUMENT Syntax: arkanum RUNTIME ...
COMMAND RUNTIME [docker-cli|dotnet|gitea|golang|nodejs|volta|powershell]
config The config command is used to modify arkanum itself. docker-cli Installs the latest docker-cli.
git The git command is a wrapper for git helpers. dotnet Installs latest LTS dotnet core sdk + runtime.
install The install command is used to add different tools gitea Installs gitea tools like the changelog generator.
help Shows this help text. golang Installs golang 1.19.3.
nodejs Installs latest NodeJs LTS version using Volta.
volta Installs Volta as NodeJS version manager.
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.
OPTION Example 1: arkanum dotnet
config: Example 2: arkanum golang nodejs
disable-motd Disables hint in new bash terminal. Example 3: arkanum --disable-motd
install extensions Installs predefined recommended extensions.
reset-codesettings Sets VS Code user setting with basic (Fira Code).
git:
setup Takes two arguments to setup the git client:
1) Username
2) Email address
install:
docker-cli Installs the latest docker-cli.
dotnet Installs latest LTS dotnet core sdk + runtime.
gitea Installs gitea tools like the changelog generator.
golang Installs golang 1.19.3.
nodejs Installs latest NodeJs LTS version using Volta.
volta Installs Volta as NodeJS version manager.
powershell Installs latest PowerShell LTS version.
Example 1: arkanum git setup "my-name" "my-email"
Example 2: arkanum install golang
Example 3: arkanum config disable-motd
HELP HELP
} }
@ -44,8 +31,6 @@ function disableMotd() {
if [[ -e "$HOME/enable_motd" ]]; then if [[ -e "$HOME/enable_motd" ]]; then
say "Disabling 'arkanum' motd..." "disableMotd" say "Disabling 'arkanum' motd..." "disableMotd"
rm -f "$HOME/enable_motd" rm -f "$HOME/enable_motd"
else
sayW "Arkanum Motd already disabled" "disableMotd"
fi fi
} }
@ -82,7 +67,6 @@ function instDockerCLI() {
sudo -E install -m 0755 -d /etc/apt/keyrings sudo -E install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo -E gpg --dearmor -o /etc/apt/keyrings/docker.gpg curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo -E gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo -E chmod a+r /etc/apt/keyrings/docker.gpg sudo -E chmod a+r /etc/apt/keyrings/docker.gpg
# shellcheck disable=SC2046,SC2027
echo \ echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
@ -106,7 +90,6 @@ function instDotNet() {
say "Installing latest .NET Core LTS release..." "dotnet" say "Installing latest .NET Core LTS release..." "dotnet"
/tmp/dotnet-install.sh --channel LTS /tmp/dotnet-install.sh --channel LTS
# shellcheck disable=SC2016
echo 'export PATH=$PATH:/config/.dotnet' | sudo tee -a /etc/bash.bashrc > /dev/null echo 'export PATH=$PATH:/config/.dotnet' | sudo tee -a /etc/bash.bashrc > /dev/null
say "Cleaning up..." "dotnet" say "Cleaning up..." "dotnet"
@ -130,7 +113,6 @@ function instGoLang() {
say "Installing golang ($GOVERSION)...." "GoLang" say "Installing golang ($GOVERSION)...." "GoLang"
sudo rm -rf /usr/local/go sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf /tmp/golang.tar.gz sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
# shellcheck disable=SC2016
echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee -a /etc/bash.bashrc > /dev/null echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee -a /etc/bash.bashrc > /dev/null
say "Cleaning up..." "GoLang" say "Cleaning up..." "GoLang"
rm -f /tmp/golang.tar.gz rm -f /tmp/golang.tar.gz
@ -164,14 +146,11 @@ function instNodeJS2() {
function instVolta() { function instVolta() {
say "Installing Volta as NodeJS version manager..." "Volta" say "Installing Volta as NodeJS version manager..." "Volta"
curl -#fSl https://get.volta.sh | bash curl -#fSl https://get.volta.sh | bash
# shellcheck disable=SC1090
source ~/.profile
say "done." "Volta" say "done." "Volta"
} }
function instPwsh() { function instPwsh() {
say "Installing PowerShell requirements..." "PowerShell" say "Installing PowerShell requirements..." "PowerShell"
sudo -E apt-get update > /dev/null
sudo -E apt-get install --no-install-recommends -y \ sudo -E apt-get install --no-install-recommends -y \
apt-transport-https \ apt-transport-https \
software-properties-common software-properties-common
@ -213,7 +192,7 @@ function instCodeExtension() {
say "Downloading required extensions...." "Extension" say "Downloading required extensions...." "Extension"
# Gitlens # Gitlens
say "Downloading 'gitlens'..." "Extension" say "Downloading 'gitlens'..." "Extension"
curl -#fSL https://open-vsx.org/api/eamodio/gitlens/14.0.1/file/eamodio.gitlens-14.0.1.vsix -o /tmp/eamodio.gitlens-13.1.1.vsix curl -#fSL 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'..." "Extension" say "Installing 'gitlens'..." "Extension"
install-extension /tmp/eamodio.gitlens-13.1.1.vsix install-extension /tmp/eamodio.gitlens-13.1.1.vsix
say "Cleaning up 'gitlens' install files" "Extension" say "Cleaning up 'gitlens' install files" "Extension"
@ -221,7 +200,7 @@ function instCodeExtension() {
# OneDarkPro # OneDarkPro
say "Downloading 'One Dark Pro' theme..." "Extension" say "Downloading 'One Dark Pro' theme..." "Extension"
curl -#fSL https://open-vsx.org/api/zhuangtongfa/material-theme/3.15.18/file/zhuangtongfa.material-theme-3.15.18.vsix -o /tmp/zhuangtongfa.material-theme-3.15.6.vsix curl -#fSL 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..." "Extension" say "Installing 'One Dark Pro' theme..." "Extension"
install-extension /tmp/zhuangtongfa.material-theme-3.15.6.vsix install-extension /tmp/zhuangtongfa.material-theme-3.15.6.vsix
say "Cleaning up 'One Dark Pro' install files" "Extension" say "Cleaning up 'One Dark Pro' install files" "Extension"
@ -229,7 +208,7 @@ function instCodeExtension() {
# vscode-icons # vscode-icons
say "Downloading 'vscode-icons' theme..." "Extension" say "Downloading 'vscode-icons' theme..." "Extension"
curl -#fSL https://open-vsx.org/api/vscode-icons-team/vscode-icons/12.4.0/file/vscode-icons-team.vscode-icons-12.4.0.vsix -o /tmp/vscode-icons-team.vscode-icons-12.0.1.vsix curl -#fSL 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..." "Extension" say "Installing 'vscode-icons' theme..." "Extension"
install-extension /tmp/vscode-icons-team.vscode-icons-12.0.1.vsix install-extension /tmp/vscode-icons-team.vscode-icons-12.0.1.vsix
say "Cleaning up 'vscode-icons' install files" "Extension" say "Cleaning up 'vscode-icons' install files" "Extension"
@ -259,79 +238,51 @@ EOF
say "done." "VSCode" say "done." "VSCode"
} }
function setGitConfig() {
if [[ "$#" != "2" ]]; then
sayE "Invalid arguments given. Please provide '<user>' and 'email'!" "Git"
exit 1
fi
say "Setting global git config..." "Git"
git config --global user.name "$1"
git config --global user.email "$2"
say "Returning global config:" "Git"
git config --list --global
}
function main() { function main() {
if [[ "$#" == "0" ]]; then if [[ "$#" == "0" ]]; then
showHelp showHelp
exit 0 exit 0
fi fi
# Command filter for i in $@; do
if [[ "$1" =~ ^help|-h|--h$ ]]; then if [[ "$1" == "-h" ]]; then
showHelp showHelp
exit 0 exit 0
fi elif [[ "$i" == "docker-cli" ]]; then
instDockerCLI
# CONFIG command elif [[ "$i" == "dotnet" ]]; then
if [[ "$1" == "config" ]]; then instDotNet
# disable-motd option elif [[ "$i" == "golang" ]]; then
if [[ "$2" == "disable-motd" ]]; then instGoLang
elif [[ "$i" == "nodejs" ]]; then
if [[ "$2" == "--legacy" ]]; then
sayW "Installing NodeJS with legacy function" "Arkanum"
instNodeJs
else
instVolta
instNodeJS2
fi
elif [[ "$i" == "volta" ]]; then
instVolta
elif [[ "$i" == "powershell" ]]; then
instPwsh
elif [[ "$i" == "gitea" ]]; then
instGiteaTools
elif [[ "$i" == "--disable-motd" ]]; then
disableMotd disableMotd
exit 0 exit 0
# install-extensions option elif [[ "$i" == "--install-extensions" ]]; then
elif [[ "$2" == "install-extensions" ]]; then
instCodeExtension instCodeExtension
exit 0 exit 0
# reset-codesetting option elif [[ "$i" == "--reset-codesetting" ]]; then
elif [[ "$2" == "reset-codesettings" ]]; then
setCodeSettings setCodeSettings
exit 0 exit 0
else else
sayE "Unknown option ($2) given for command 'config'!" sayE "Unknown parameter value given!($i)."
fi
# GIT command
elif [[ "$1" == "git" ]]; then
# setup option
if [[ "$2" == "setup" ]]; then
setGitConfig "$3" "$4"
else
sayE "Unknown option ($2) given for command 'git'!"
fi
# INSTALL command
elif [[ "$1" == "install" ]]; then
# docker-cli option
if [[ "$2" == "docker-cli" ]]; then
instDockerCLI
elif [[ "$2" == "dotnet" ]]; then
instDotNet
elif [[ "$2" == "golang" ]]; then
instGoLang "$3"
elif [[ "$2" == "nodejs" ]]; then
instVolta
instNodeJs
elif [[ "$2" == "volta" ]]; then
instVolta
elif [[ "$2" == "powershell" ]]; then
instPwsh
elif [[ "$2" == "gitea" ]]; then
instGiteaTools
fi
else
sayE "Unknown parameter value given!($1)."
showHelp showHelp
exit 1 exit 1
fi fi
done
} }
main "$@" main $@

View File

@ -1,39 +1,3 @@
#!/bin/env bash #!/bin/bash
#complete -W "--disable-motd --install-extensions --reset-codesetting docker-cli dotnet gitea golang nodejs volta powershell -h" arkanum complete -W "--disable-motd --install-extensions --reset-codesetting docker-cli dotnet gitea golang nodejs volta powershell -h" arkanum
function _command_completions() {
local cur prev
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
case ${COMP_CWORD} in
1)
# shellcheck disable=2207,SC2086
COMPREPLY=($(compgen -W "config git install help" -- ${cur}))
;;
2)
case ${prev} in
config)
# shellcheck disable=2207,SC2086
COMPREPLY=($(compgen -W "disable-motd install-extensions reset-codesettings" -- ${cur}))
;;
git)
# shellcheck disable=2207,SC2086
COMPREPLY=($(compgen -W "setup" -- ${cur}))
;;
install)
# shellcheck disable=2207,SC2086
COMPREPLY=($(compgen -W "docker-cli dotnet golang nodejs volta powershell gitea" -- ${cur}))
;;
help)
;;
esac
;;
*)
COMPREPLY=()
;;
esac
}
complete -F _command_completions arkanum