diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0af3855..c7b38f8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -94,7 +94,7 @@ jobs: label_title: "Homelab Workspace" label_description: "Homelab workspace image" source_git_ref: ${{ (github.event_name == 'pull_request') && format('refs/heads/{0}', github.head_ref) || format('refs/tags/{0}', needs.create-release.outputs.released_version) }} - timeout_minutes: 120 + timeout_minutes: 180 secrets: private_registry_username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} private_registry_token: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }} diff --git a/.github/workflows/test-image.yaml b/.github/workflows/test-image.yaml index d561a90..e659742 100644 --- a/.github/workflows/test-image.yaml +++ b/.github/workflows/test-image.yaml @@ -22,7 +22,7 @@ jobs: label_title: "Homelab Workspace" label_description: "Homelab workspace image" source_git_ref: ${{ (github.event_name == 'pull_request') && format('refs/heads/{0}', github.head_ref) || github.ref }} - timeout_minutes: 120 + timeout_minutes: 180 secrets: private_registry_username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} private_registry_token: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }} diff --git a/images/homelab-workspace/Dockerfile b/images/homelab-workspace/Dockerfile index 615c47c..271185f 100644 --- a/images/homelab-workspace/Dockerfile +++ b/images/homelab-workspace/Dockerfile @@ -401,6 +401,16 @@ RUN --mount=type=tmpfs,target=/tmp \ install -o root -g root -m 0755 /tmp/krew-linux_${TARGETARCH} /usr/local/sbin/kubectl-krew && \ upx /usr/local/sbin/kubectl-krew +# kustomize +# renovate: datasource=github-releases depName=kubernetes-sigs/kustomize extractVersion=^kustomize/(?.*)$ +ARG KUSTOMIZE_VERSION="5.2.1" +RUN --mount=type=tmpfs,target=/tmp \ + --mount=type=tmpfs,target=/var/log \ + --mount=type=tmpfs,target=/var/tmp \ + wget --progress=dot:giga -c "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_${TARGETARCH}.tar.gz" -O - | tar -xzv -C /tmp && \ + install -o root -g root -m 0755 /tmp/kustomize /usr/local/sbin/kustomize && \ + upx /usr/local/sbin/kustomize + # minio-cli RUN --mount=type=tmpfs,target=/tmp \ --mount=type=tmpfs,target=/var/log \ diff --git a/images/homelab-workspace/coder/init-background.sh b/images/homelab-workspace/coder/init-background.sh index 8ab4e55..ac653eb 100755 --- a/images/homelab-workspace/coder/init-background.sh +++ b/images/homelab-workspace/coder/init-background.sh @@ -55,7 +55,7 @@ main() { install_npm_packages /opt/fnm/npm-packages.json 2>&1 | sed -E 's|^(.*)| \1|g' echo "--------------------------------------------------------------------------------------" echo "Installing packages from github-releases..." - /opt/coder/bin/install-from-github-release.sh /packages/github-releases.yaml $HOME/.local/bin + /opt/coder/bin/install-from-github-release.sh /opt/packages-github-releases.yaml $HOME/.local/bin echo "--------------------------------------------------------------------------------------" echo "Maintaining krew plugins..." $(dirname ${0})/init-krew-plugins.sh 2>&1 | sed -E 's|^(.*)| \1|g' diff --git a/images/homelab-workspace/coder/install-from-github-release.sh b/images/homelab-workspace/coder/install-from-github-release.sh index c13d186..5a12276 100755 --- a/images/homelab-workspace/coder/install-from-github-release.sh +++ b/images/homelab-workspace/coder/install-from-github-release.sh @@ -75,6 +75,11 @@ install_release() { local package_name="$1" local release_yaml="$2" + if [[ -f $INSTALL_DIR/$package_name ]]; then + echo "Already exists... skipping." + return + fi + # read package configuration from yaml local repo="$(yq -e '.[] | select(.name == "'$package_name'") | .repo' $release_yaml)" local tag="$(yq -e '.[] | select(.name == "'$package_name'") | .tag' $release_yaml)" diff --git a/images/homelab-workspace/etc/bash_completion.defaults b/images/homelab-workspace/etc/bash_completion.defaults index bf15c9b..4793a04 100644 --- a/images/homelab-workspace/etc/bash_completion.defaults +++ b/images/homelab-workspace/etc/bash_completion.defaults @@ -1,34 +1,56 @@ # kubectl -source <(kubectl completion bash) -alias k=kubectl -complete -o default -F __start_kubectl k +if command -v kubectl > /dev/null; then + source <(kubectl completion bash) + alias k=kubectl + complete -o default -F __start_kubectl k +fi # helm -source <(helm completion bash) +if command -v helm > /dev/null; then + source <(helm completion bash) +fi # kustomize -source <(kustomize completion bash) +if command -v kustomize > /dev/null; then + source <(kustomize completion bash) +fi # terraform -complete -C /opt/tfenv/versions/$(ls /opt/tfenv/versions | sort -rn | head -1)/terraform terraform +if find /opt/tfenv/versions/ -name terraform -type f -executable > /dev/null; then + complete -C /opt/tfenv/versions/$(ls /opt/tfenv/versions | sort -rn | head -1)/terraform terraform +fi # yq -source <(yq shell-completion bash) +if command -v yq > /dev/null; then + source <(yq shell-completion bash) +fi # poetry -source <(poetry completions bash) +if command -v poetry > /dev/null; then + source <(poetry completions bash) +fi # pip -source <(pip completion --bash) +if command -v pip > /dev/null; then + source <(pip completion --bash) +fi # flux -source <(flux completion bash) +if command -v flux > /dev/null; then + source <(flux completion bash) +fi # gh -source <(gh completion -s bash) +if command -v gh > /dev/null; then + source <(gh completion -s bash) +fi # kind -source <(kind completion bash) +if command -v kind > /dev/null; then + source <(kind completion bash) +fi # mc -complete -C /usr/local/sbin/mc mc +if [[ -f /usr/local/sbin/mc ]]; then + complete -C /usr/local/sbin/mc mc +fi diff --git a/images/homelab-workspace/packages/github-releases-amd64.yaml b/images/homelab-workspace/packages/github-releases-amd64.yaml index 15b7824..f6cc475 100644 --- a/images/homelab-workspace/packages/github-releases-amd64.yaml +++ b/images/homelab-workspace/packages/github-releases-amd64.yaml @@ -63,11 +63,6 @@ # renovate: datasource=github-releases depName=yannh/kubeconform tag: "v0.6.7" asset_regex: "kubeconform-linux-amd64.tar.gz" -- name: kustomize - repo: https://github.com/kubernetes-sigs/kustomize - # renovate: datasource=github-releases depName=kubernetes-sigs/kustomize extractVersion=^kustomize/(?.*)$ - tag: "v5.2.1" - asset_regex: ".*_linux_amd64.tar.gz" - name: shellcheck repo: https://github.com/koalaman/shellcheck # renovate: datasource=github-releases depName=koalaman/shellcheck diff --git a/images/homelab-workspace/packages/github-releases-arm64.yaml b/images/homelab-workspace/packages/github-releases-arm64.yaml index f585fb1..e861337 100644 --- a/images/homelab-workspace/packages/github-releases-arm64.yaml +++ b/images/homelab-workspace/packages/github-releases-arm64.yaml @@ -63,11 +63,6 @@ # renovate: datasource=github-releases depName=yannh/kubeconform tag: "v0.6.7" asset_regex: "kubeconform-linux-arm64.tar.gz" -- name: kustomize - repo: https://github.com/kubernetes-sigs/kustomize - # renovate: datasource=github-releases depName=kubernetes-sigs/kustomize extractVersion=^kustomize/(?.*)$ - tag: "v5.4.3" - asset_regex: ".*_linux_arm64.tar.gz" - name: shellcheck repo: https://github.com/koalaman/shellcheck # renovate: datasource=github-releases depName=koalaman/shellcheck