diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index 9580696..6fb8f6a 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest container: git.namesny.com/cluster/act-runner:v1 env: - IMAGE_NAME: webhook-deployer + IMAGE_NAME: kube-deployer REGISTRY: git.namesny.com REPO_OWNER: cluster steps: @@ -24,5 +24,10 @@ jobs: password: ${{ secrets.REGISTRY_TOKEN }} - name: Build and push run: | - docker build -t ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:latest . + set -a + source versions.env + set +a + docker build --build-arg=SOPS_VERSION=${SOPS_VERSION} \ + --build-arg=KUSTOMIZE_SOPS_VERSION=${KUSTOMIZE_SOPS_VERSION} \ + -t ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:latest . docker push ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index c0ffae8..af3e7ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,19 @@ FROM alpine:3 -RUN apk add --no-cache kubectl kustomize age webhook git +ARG SOPS_VERSION +ARG KUSTOMIZE_SOPS_VERSION + +RUN apk add --no-cache kubectl kustomize age git bash tini # Install sops -ADD https://github.com/getsops/sops/releases/download/v3.8.1/sops-v3.8.1.linux.amd64 /tmp/sops +ADD https://github.com/getsops/sops/releases/download/v${SOPS_VERSION}/sops-v3.8.1.linux.amd64 /tmp/sops RUN mv /tmp/sops /usr/local/bin/sops RUN chmod +x /usr/local/bin/sops # Install ksops -ADD https://github.com/viaduct-ai/kustomize-sops/releases/download/v4.3.1/ksops_latest_Linux_x86_64.tar.gz /tmp/ksops.tar.gz +ADD https://github.com/viaduct-ai/kustomize-sops/releases/download/v${KUSTOMIZE_SOPS_VERSION}/ksops_latest_Linux_x86_64.tar.gz /tmp/ksops.tar.gz RUN tar -xzf /tmp/ksops.tar.gz -C /tmp RUN mv /tmp/ksops /usr/local/bin/ksops RUN chmod +x /usr/local/bin/ksops -ENTRYPOINT ["/usr/bin/webhook", "--hooks", "/etc/webhook/hook.json"] \ No newline at end of file +ENTRYPOINT ["/sbin/tini", "--"] \ No newline at end of file diff --git a/README.md b/README.md index 222ab66..2e98f65 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ -# Webhook Deployer +# Kube Deployer Docker container with: -- [webhooks](https://github.com/adnanh/webhook) - [kubectl](https://github.com/kubernetes/kubectl) - [kustomize](https://github.com/kubernetes-sigs/kustomize) - [age](https://github.com/FiloSottile/age) diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..972231b --- /dev/null +++ b/renovate.json @@ -0,0 +1,36 @@ +{ + "extends": [ + "config:best-practices" + ], + "ignoreTests": true, + "customManagers": [ + { + "customType": "regex", + "fileMatch": [ + "^versions\\.env$" + ], + "matchStrings": [ + "# renovate: datasource=(?.*?) depName=(?.*?)( versioning=(?.*?))?\n.*?=(?.*)" + ], + "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}" + } + ], + "packageRules": [ + { + "matchPackagePatterns": [ + ".*" + ], + "matchManagers": [ + "custom.regex" + ], + "extractVersion": "^(v|release-)?(?.*)$", + "automerge": true + } + ], + "pin": { + "automerge": true + }, + "digest": { + "automerge": true + } +} \ No newline at end of file diff --git a/versions.env b/versions.env new file mode 100644 index 0000000..2fcd792 --- /dev/null +++ b/versions.env @@ -0,0 +1,4 @@ +# renovate: datasource=github-releases depName=getsops/sops +SOPS_VERSION=3.8.1 +# renovate: datasource=github-releases depName=viaduct-ai/kustomize-sops +KUSTOMIZE_SOPS_VERSION=4.3.1 \ No newline at end of file