From 13654f58f9a6ddd890b2df61685d04879e9c0f27 Mon Sep 17 00:00:00 2001 From: Robin Mordasiewicz Date: Mon, 18 Mar 2024 21:53:55 -0400 Subject: [PATCH] updated devcontainer --- .devcontainer/.vimrc | 11 --- .devcontainer/devcontainer.json | 33 +++++-- .devcontainer/devcontainer.json.dev | 109 +++++++++++++++++++++ .devcontainer/mkdocs.template | 135 ++++++++++++++++++++++++++ .devcontainer/opencommit-ollama.patch | 26 +++++ .devcontainer/opencommit.sh | 21 ++++ .devcontainer/postCreateCommand.sh | 118 ++++++++++++++++------ .devcontainer/postStartCommand.sh | 9 ++ 8 files changed, 410 insertions(+), 52 deletions(-) delete mode 100644 .devcontainer/.vimrc create mode 100644 .devcontainer/devcontainer.json.dev create mode 100644 .devcontainer/mkdocs.template create mode 100644 .devcontainer/opencommit-ollama.patch create mode 100755 .devcontainer/opencommit.sh create mode 100755 .devcontainer/postStartCommand.sh diff --git a/.devcontainer/.vimrc b/.devcontainer/.vimrc deleted file mode 100644 index 7b3d19ec..00000000 --- a/.devcontainer/.vimrc +++ /dev/null @@ -1,11 +0,0 @@ -syntax on - -colo darkblue - -" Configuration vim Airline -set laststatus=2 - -let g:airline#extensions#tabline#enabled=1 -let g:airline_powerline_fonts=1 - -set autoindent expandtab tabstop=2 shiftwidth=2 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b7e292ba..decc198e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,9 +12,15 @@ "ms-azuretools.vscode-docker", "MS-CST-E.vscode-devskim", "ms-python.python", + "ms-ossdata.vscode-postgresql", + "ms-toolsai.jupyter", + "ms-toolsai.jupyter-renderers", "ms-toolsai.vscode-jupyter-powertoys", "ms-vscode.azure-account", - "ms-azuretools.vscode-azureterraform" + "ms-azuretools.vscode-azureterraform", + "mtxr.sqltools", + "mtxr.sqltools-driver-pg", + "visualstudioexptteam.vscodeintellicode" ], "settings": { "terminal.integrated.profiles.linux": { @@ -61,43 +67,52 @@ "software-properties-common", "iputils-ping", "cmake", + "libpoppler-cpp-dev", "libsecret-1-dev", "yelp-tools", "libyelp-dev", "libgif-dev", "autoconf", + "tesseract-ocr", + "ubuntu-drivers-common", "nodejs" ] }, "ghcr.io/devcontainers-contrib/features/black:2": {}, "ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {}, "ghcr.io/devcontainers-contrib/features/devcontainers-cli:1": {}, + "ghcr.io/devcontainers-contrib/features/ffmpeg-apt-get:1": {}, "ghcr.io/devcontainers-contrib/features/fzf:1": {}, "ghcr.io/devcontainers-contrib/features/markdownlint-cli2:1": {}, - "ghcr.io/devcontainers-contrib/features/mkdocs:2": {}, + "ghcr.io/devcontainers-contrib/features/poppler-utils-apt-get:1": {}, + "ghcr.io/devcontainers-contrib/features/pylint:2": {}, + "ghcr.io/devcontainers-contrib/features/qrcode:2": {}, "ghcr.io/devcontainers-contrib/features/tmux-apt-get:1": {}, "ghcr.io/devcontainers-contrib/features/vscode-cli:1": {}, "ghcr.io/devcontainers-contrib/features/vscode-server:1": {}, "ghcr.io/devcontainers-contrib/features/wget-apt-get:1": {}, "ghcr.io/devcontainers-contrib/features/yamllint:2": {}, + "ghcr.io/devcontainers-contrib/features/yt-dlp:2": {}, "ghcr.io/devcontainers-contrib/features/zsh-plugins:0": { - "plugins": "zsh-syntax-highlighting zsh-autosuggestions ubuntu jsontools gh common-aliases zsh-eza", - "omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions.git https://github.com/zsh-users/zsh-syntax-highlighting.git https://github.com/z-shell/zsh-eza.git" + "plugins": "zsh-syntax-highlighting zsh-autosuggestions ubuntu jsontools gh common-aliases zsh-aliases-lsd zsh-tfenv conda-zsh-completion", + "omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions.git https://github.com/zsh-users/zsh-syntax-highlighting.git https://github.com/conda-incubator/conda-zsh-completion.git https://github.com/z-shell/zsh-eza.git https://github.com/cda0/zsh-tfenv.git https://github.com/yuhonas/zsh-aliases-lsd.git" }, "ghcr.io/devcontainers-community/npm-features/prettier:1": {}, "ghcr.io/guiyomh/features/vim:0": {}, + "ghcr.io/hwaien/devcontainer-features/match-host-time-zone": {}, "ghcr.io/joshuanianji/devcontainer-features/github-cli-persistence:1": {}, "ghcr.io/jsburckhardt/devcontainer-features/gitleaks:1": {}, "ghcr.io/jungaretti/features/make:1": {}, "ghcr.io/lukewiwa/features/shellcheck:0": {}, "ghcr.io/mikaello/devcontainer-features/modern-shell-utils:1": {}, "ghcr.io/prulloac/devcontainer-features/pre-commit:1": {}, - "ghcr.io/schlich/devcontainer-features/powerlevel10k:1": {}, - "ghcr.io/stuartleeks/dev-container-features/azure-cli-persistence:0": {} + "ghcr.io/rocker-org/devcontainer-features/miniforge:1": {}, + "ghcr.io/stuartleeks/dev-container-features/azure-cli-persistence:0": {}, + "ghcr.io/warrenbuckley/codespace-features/sqlite:1": {} }, - "postStartCommand": "", - "postCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder} ; ./.devcontainer/postCreateCommand.sh", - "appPort": [], + "postStartCommand": "./.devcontainer/postStartCommand.sh", + "postCreateCommand": "sudo chown -R vscode:vscode ${containerWorkspaceFolder} ; git config --global --add safe.directory ${containerWorkspaceFolder} && ./.devcontainer/postCreateCommand.sh", + "appPort": ["8081:8081"], "containerEnv": {}, "runArgs": ["--name", "devops-toolkit"], "mounts": [] diff --git a/.devcontainer/devcontainer.json.dev b/.devcontainer/devcontainer.json.dev new file mode 100644 index 00000000..14cfc30d --- /dev/null +++ b/.devcontainer/devcontainer.json.dev @@ -0,0 +1,109 @@ +{ + "name": "devcontainer", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu22.04", + "customizations": { + "vscode": { + "extensions": [ + "Continue.continue", + "duniul.dircolors", + "esbenp.prettier-vscode", + "HashiCorp.terraform", + "MarkLarah.pre-commit-vscode", + "ms-azuretools.vscode-docker", + "MS-CST-E.vscode-devskim", + "ms-python.python", + "ms-python.vscode-pylance", + "ms-vscode.azure-account", + "ms-azuretools.vscode-azureterraform", + "alphaxek.github-actions-locally", + "amazonwebservices.aws-toolkit-vscode", + "github.vscode-github-actions", + "OmarTawfik.github-actions-vscode" + ], + "settings": { + "terminal.integrated.profiles.linux": { + "bash": { + "path": "/bin/bash" + }, + "zsh": { + "path": "/usr/bin/zsh" + } + }, + "terminal.integrated.defaultProfile.linux": "zsh", + "files.eol": "\n", + "files.insertFinalNewline": true, + "files.trimFinalNewlines": true, + "files.trimTrailingWhitespace": true, + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": true + } + } + } + }, + "features": { + "ghcr.io/devcontainers/features/aws-cli:1": {}, + "ghcr.io/devcontainers/features/azure-cli:1": {}, + "ghcr.io/devcontainers/features/common-utils:2": { + "configureZshAsDefaultShell": true + }, + "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}, + "ghcr.io/devcontainers/features/github-cli:1": {}, + "ghcr.io/devcontainers/features/python:1": { + "installTools": true, + "version": "3.11" + }, + "ghcr.io/devcontainers/features/terraform:1": { + "installTFsec": true, + "installTerraformDocs": true + }, + "ghcr.io/devcontainers-contrib/features/act:1": {}, + "ghcr.io/devcontainers-contrib/features/actionlint:1": {}, + "ghcr.io/devcontainers-contrib/features/ansible:2": {}, + "ghcr.io/devcontainers-contrib/features/apt-packages:1": { + "packages": [ + "software-properties-common", + "iputils-ping", + "cmake", + "libsecret-1-dev", + "yelp-tools", + "libyelp-dev", + "libgif-dev", + "autoconf", + "nodejs" + ] + }, + "ghcr.io/devcontainers-contrib/features/black:2": {}, + "ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {}, + "ghcr.io/devcontainers-contrib/features/fzf:1": {}, + "ghcr.io/devcontainers-contrib/features/markdownlint-cli2:1": {}, + "ghcr.io/devcontainers-contrib/features/tmux-apt-get:1": {}, + "ghcr.io/devcontainers-contrib/features/vscode-cli:1": {}, + "ghcr.io/devcontainers-contrib/features/vscode-server:1": {}, + "ghcr.io/devcontainers-contrib/features/wget-apt-get:1": {}, + "ghcr.io/devcontainers-contrib/features/yamllint:2": {}, + "ghcr.io/devcontainers-contrib/features/zsh-plugins:0": { + "plugins": "zsh-syntax-highlighting zsh-autosuggestions ubuntu jsontools gh common-aliases zsh-tfenv conda-zsh-completion", + "omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions.git https://github.com/zsh-users/zsh-syntax-highlighting.git https://github.com/cda0/zsh-tfenv.git https://github.com/conda-incubator/conda-zsh-completion.git" + }, + "ghcr.io/devcontainers-community/npm-features/prettier:1": {}, + "ghcr.io/guiyomh/features/vim:0": {}, + "ghcr.io/hwaien/devcontainer-features/match-host-time-zone": {}, + "ghcr.io/joshuanianji/devcontainer-features/github-cli-persistence:1": {}, + "ghcr.io/jsburckhardt/devcontainer-features/gitleaks:1": {}, + "ghcr.io/jungaretti/features/make:1": {}, + "ghcr.io/lukewiwa/features/shellcheck:0": {}, + "ghcr.io/mikaello/devcontainer-features/modern-shell-utils:1": {}, + "ghcr.io/prulloac/devcontainer-features/pre-commit:1": {}, + "ghcr.io/rocker-org/devcontainer-features/miniforge:1": {}, + "ghcr.io/stuartleeks/dev-container-features/azure-cli-persistence:0": {} + }, + "postStartCommand": "${containerWorkspaceFolder}/.devcontainer/postStartCommand.sh", + "postCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder} ; ${containerWorkspaceFolder}/.devcontainer/postCreateCommand.sh", + "appPort": [], + "containerEnv": { + "PRE_COMMIT_ALLOW_NO_CONFIG": "1" + }, + "runArgs": ["--name", "devcontainer"], + "mounts": [] +} diff --git a/.devcontainer/mkdocs.template b/.devcontainer/mkdocs.template new file mode 100644 index 00000000..01c3923d --- /dev/null +++ b/.devcontainer/mkdocs.template @@ -0,0 +1,135 @@ +--- +site_name: GITHUBREPOSITORYNAME +site_description: >- + GITHUBREPOSITORYDESCRIPTION +site_url: GITHUBPAGESURL +site_author: FIRSTNAMELASTNAME +docs_dir: docs +site_dir: site + +repo_name: GITHUBUSERNAME/GITHUBREPOSITORYNAME +repo_url: GITHUBREPOSITORYCANONICALURL +edit_uri: edit/main/docs/ + +# yamllint disable-line rule:line-length +copyright: "Try to be nice." + +extra: + annotate: + json: [.s2] + generator: false + social: + - icon: custom/fc-lib-facebook + link: https://www.facebook.com/robin.mordasiewicz/ + - icon: custom/fc-lib-twitter + link: https://twitter.com/r_mordasiewicz + - icon: custom/fc-lib-youtube + link: https://www.youtube.com/channel/UCc2rQTQp22P2WEhCArzlUoQ + - icon: custom/fc-lib-linkedin + link: https://www.linkedin.com/in/robin-mordasiewicz + +validation: + omitted_files: warn + absolute_links: warn + unrecognized_links: warn + +extra_css: [extra.css] + +theme: + name: material + custom_dir: docs/overrides + include_sidebar: false + logo: logo.svg + favicon: favicon.ico + icon: + repo: fontawesome/brands/github + features: + - announce.dismiss + - content.action.view + - content.code.annotate + - content.code.copy + # - content.tabs.link + - content.tooltips + - header.autohide + - navigation.footer + # - navigation.indexes + - navigation.instant + - navigation.instant.prefetch + - navigation.instant.progress + # - navigation.prune + # - navigation.sections + - navigation.tabs + - navigation.top + - navigation.tracking + - navigation.path + - search.highlight + - search.share + - search.suggest + - toc.follow + palette: + - media: "(prefers-color-scheme: light)" + primary: black + accent: grey + scheme: default + toggle: + icon: material/toggle-switch-off-outline + name: Switch to dark mode + - media: "(prefers-color-scheme: dark)" + primary: grey + accent: black + scheme: slate + toggle: + icon: material/toggle-switch + font: + text: Roboto + code: Roboto Mono + +markdown_extensions: + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + options: + custom_icons: + - overrides/.icons + - abbr + - admonition + - attr_list + - def_list + - footnotes + - md_in_html + - toc: + toc_depth: "1-1" + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format + - pymdownx.inlinehilite + - pymdownx.snippets + - pymdownx.tilde + - pymdownx.keys + - pymdownx.magiclink: + normalize_issue_symbols: true + repo_url_shorthand: true + user: GITHUBUSERNAME + repo: GITHUBREPOSITORYNAME + - pymdownx.mark + - pymdownx.smartsymbols + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.tabbed: + alternate_style: true + combine_header_slug: true + slugify: !!python/object/apply:pymdownx.slugs.slugify + kwds: + +plugins: + - glightbox + - search: + separator: '[\s\u200b\-_,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])' +# - blog: +# blog_dir: concepts +# post_dir: "{blog}/articles" +# post_readtime: false +# archive: false +# authors: false diff --git a/.devcontainer/opencommit-ollama.patch b/.devcontainer/opencommit-ollama.patch new file mode 100644 index 00000000..f4525508 --- /dev/null +++ b/.devcontainer/opencommit-ollama.patch @@ -0,0 +1,26 @@ +diff --git a/out/cli.cjs b/out/cli.cjs +index 52581c3..f91cdc9 100755 +--- a/out/cli.cjs ++++ b/out/cli.cjs +@@ -22006,7 +22006,7 @@ var api = new OpenAi(); + var OllamaAi = class { + async generateCommitMessage(messages) { + const model = "mistral"; +- const url3 = "http://localhost:11434/api/chat"; ++ const url3 = "http://192.168.2.28:11434/api/chat"; + const p4 = { + model, + messages, +diff --git a/src/engine/ollama.ts b/src/engine/ollama.ts +index f431ee1..517f0c3 100644 +--- a/src/engine/ollama.ts ++++ b/src/engine/ollama.ts +@@ -11,7 +11,7 @@ export class OllamaAi implements AiEngine { + //console.log(messages); + //process.exit() + +- const url = 'http://localhost:11434/api/chat'; ++ const url = 'http://192.168.2.28:11434/api/chat'; + const p = { + model, + messages, diff --git a/.devcontainer/opencommit.sh b/.devcontainer/opencommit.sh new file mode 100755 index 00000000..34b78e77 --- /dev/null +++ b/.devcontainer/opencommit.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# + +REPODIR=$(pwd) + +echo "Enter the Host IP address:" +read -r HOSTIPADDRESS + +if sed -i "s/HOSTIPADDRESS/${HOSTIPADDRESS}/g" "${REPODIR}"/.devcontainer/opencommit-ollama.patch; then + if [ -d /tmp/opencommit ]; then + rm -rf /tmp/opencommit + fi + git clone https://github.com/di-sukharev/opencommit.git /tmp/opencommit + cd /tmp/opencommit || return + git apply "${REPODIR}"/.devcontainer/opencommit-ollama.patch + sudo -H env PATH="${PATH}" npm uninstall -g + sudo -H env PATH="${PATH}" npm install -g + echo "OCO_AI_PROVIDER=ollama" >~/.opencommit + cd "${REPODIR}" || return + oco hook set +fi diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index e24e7680..a51e9616 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -1,56 +1,110 @@ #!/bin/bash # +REPODIR=$(pwd) + sudo sh -c 'echo "vscode ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/vscode' -if ! [ -d /etc/apt/keyrings ]; then - sudo mkdir -p /etc/apt/keyrings +sudo chown -R vscode:vscode /home/vscode/ +sudo chown -R vscode:vscode /dc + +wget https://github.com/lsd-rs/lsd/releases/download/v1.0.0/lsd_1.0.0_"$(dpkg-architecture -q DEB_BUILD_ARCH)".deb -O /tmp/lsd.deb +sudo apt-get install /tmp/lsd.deb +rm -rf /tmp/lsd.deb + +if ! [ -d ~/.local/bin ]; then + mkdir -p ~/.local/bin +fi +if ! [ -d ~/.oh-my-posh/themes/ ]; then + mkdir -p ~/.oh-my-posh/themes +fi +curl -s https://ohmyposh.dev/install.sh | bash -s -- -d ~/.local/bin -t ~/.oh-my-posh/themes +oh-my-posh font install Meslo +wget https://raw.githubusercontent.com/robinmordasiewicz/dotfiles/main/powerlevel10k.omp.json -O ~/.oh-my-posh/themes/powerlevel10k.omp.json +# shellcheck disable=SC2016 +echo 'eval "$(oh-my-posh init zsh --config ~/.oh-my-posh/themes/powerlevel10k.omp.json)"' >>~/.zshrc +conda init --all +wget https://raw.githubusercontent.com/Azure/azure-cli/dev/az.completion -O ~/.oh-my-zsh/custom/az.zsh + +if ! [ -d ~/.vim/pack/plugin/start ]; then + mkdir -p ~/.vim/pack/plugin/start +fi + +if ! [ -d ~/.vim/pack/plugin/start/vim-airline ]; then + git clone https://github.com/vim-airline/vim-airline ~/.vim/pack/plugin/start/vim-airline +else + cd ~/.vim/pack/plugin/start/vim-airline || return + git pull fi -if ! [ -f /etc/apt/keyrings/gierens.gpg ]; then - wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg - sudo chmod 644 /etc/apt/keyrings/gierens.gpg +if ! [ -d ~/.vim/pack/plugin/start/vim-terraform ]; then + git clone https://github.com/hashivim/vim-terraform.git ~/.vim/pack/plugin/start/vim-terraform +else + cd ~/.vim/pack/plugin/start/vim-terraform || return + git pull fi -if ! [ -f /etc/apt/sources.list.d/gierens.list ]; then - echo 'deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main' | sudo tee /etc/apt/sources.list.d/gierens.list - sudo chmod 644 /etc/apt/sources.list.d/gierens.list +if ! [ -d ~/.vim/pack/themes/start ]; then + mkdir -p ~/.vim/pack/themes/start fi -sudo apt update -sudo apt-get -y upgrade -sudo apt-get -y install eza -sudo apt -y autoremove +if ! [ -d ~/.vim/pack/themes/start/vim-code-dark ]; then + git clone https://github.com/tomasiser/vim-code-dark ~/.vim/pack/themes/start/vim-code-dark +else + cd ~/.vim/pack/themes/start/vim-code-dark || return + git pull +fi + +wget https://raw.githubusercontent.com/robinmordasiewicz/dotfiles/main/.vimrc -O ~/.vimrc + +if ! [ -f mkdocs.yml ]; then + cp .devcontainer/mkdocs.template mkdocs.yml +fi + +FIRSTNAMELASTNAME=$(git config --get user.name) +GITHUBREPOSITORYURL=$(git config --get remote.origin.url) +GITHUBREPOSITORYCANONICALURL="${GITHUBREPOSITORYURL%.git}" +GITHUBUSERNAME=$(echo "$GITHUBREPOSITORYURL" | sed 's/.*github.com\/\([^\/]*\)\/.*/\1/') +GITHUBREPOSITORYNAME=$(echo "$GITHUBREPOSITORYURL" | sed 's/.*github.com\/[^\/]*\/\([^\/]*\)\.git/\1/') +GITHUBPAGESURL="https://$GITHUBUSERNAME.github.io/$GITHUBREPOSITORYNAME/" +GITHUBREPOSITORYAPIURL="https://api.github.com/repos/$GITHUBUSERNAME/$GITHUBREPOSITORYNAME" +GITHUBREPOSITORYDESCRIPTION=$(curl -s "$GITHUBREPOSITORYAPIURL" | jq -r '.description') +sed -i "s,GITHUBUSERNAME,${GITHUBUSERNAME},g" "mkdocs.yml" +sed -i "s,FIRSTNAMELASTNAME,${FIRSTNAMELASTNAME},g" "mkdocs.yml" +sed -i "s,GITHUBREPOSITORYNAME,${GITHUBREPOSITORYNAME},g" "mkdocs.yml" +sed -i "s,GITHUBREPOSITORYCANONICALURL,${GITHUBREPOSITORYCANONICALURL},g" "mkdocs.yml" +sed -i "s,GITHUBREPOSITORYDESCRIPTION,${GITHUBREPOSITORYDESCRIPTION},g" "mkdocs.yml" +sed -i "s,GITHUBPAGESURL,${GITHUBPAGESURL},g" "mkdocs.yml" LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*') -curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz" +curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_$(dpkg-architecture -q DEB_BUILD_ARCH).tar.gz" tar xf lazygit.tar.gz lazygit rm lazygit.tar.gz sudo install lazygit /usr/local/bin rm lazygit -sudo -H env PATH="${PATH}" npm install -g npm@latest -sudo -H env PATH="${PATH}" npm install -g opencommit -sudo -H env PATH="${PATH}" oco hook set +cd "${REPODIR}" && pre-commit install --allow-missing-config -echo "chown takes a few minutes, be patient." -sudo chown -R vscode:vscode /home/vscode/ -sudo chown -R vscode:vscode /dc +sudo -H env PATH="${PATH}" npm install -g npm@latest +sudo env PATH="${PATH}" npm install -g opencommit +echo "OCO_AI_PROVIDER=ollama" >~/.opencommit +git config --global --add safe.directory /workspaces/devcontainer +cd "${REPODIR}" && oco hook set -pre-commit install +if command -v az &>/dev/null; then + yes y | az config set auto-upgrade.enable=yes + yes y | az config set auto-upgrade.prompt=no +fi -az config set auto-upgrade.enable=yes -wget https://raw.githubusercontent.com/Azure/azure-cli/dev/az.completion -O ~/.oh-my-zsh/custom/az.zsh +sudo apt update +sudo apt-get -y upgrade +sudo apt -y autoremove -if ! [ -d ~/.vim/pack/plugin/start ]; then - mkdir -p ~/.vim/pack/plugin/start -fi +yes y | conda update -n base -c conda-forge conda +yes y | conda update --all +yes y | conda update -n base -c conda-forge conda --repodata-fn=repodata.json -if ! [ -d ~/.vim/pack/plugin/start/vim-airline ]; then - git clone https://github.com/vim-airline/vim-airline ~/.vim/pack/plugin/start/vim-airline -else - cd ~/.vim/pack/plugin/start/vim-airline || return - git pull -fi +# shellcheck disable=SC1091 +source /opt/conda/etc/profile.d/conda.sh -cp .devcontainer/.vimrc ~/ +conda env create -f ./docs/mkdocs-environment.yml diff --git a/.devcontainer/postStartCommand.sh b/.devcontainer/postStartCommand.sh new file mode 100755 index 00000000..093597e6 --- /dev/null +++ b/.devcontainer/postStartCommand.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# + +echo '' >/tmp/mkdocs.tmp +# shellcheck disable=SC1091 +source /opt/conda/etc/profile.d/conda.sh + +conda activate mkdocs +nohup bash -c 'mkdocs serve&' >/tmp/mkdocs.tmp