From ca945cc4b07e8d5e7c878d0a8f57c7efb7c44eb7 Mon Sep 17 00:00:00 2001 From: Mathis Date: Mon, 25 Mar 2024 21:47:52 +0100 Subject: [PATCH] Initial docker image for webhook deployer --- .gitea/workflows/release.yaml | 28 ++++++++++++++++++++++++++++ Dockerfile | 15 +++++++++++++++ README.md | 10 +++++++++- 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/release.yaml create mode 100644 Dockerfile diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..9580696 --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,28 @@ +name: Build webhook-deployer container +on: + push: + branches: + - main + +jobs: + build: + name: Build image + runs-on: ubuntu-latest + container: git.namesny.com/cluster/act-runner:v1 + env: + IMAGE_NAME: webhook-deployer + REGISTRY: git.namesny.com + REPO_OWNER: cluster + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Login to Registry + uses: docker/login-action@v3 + with: + registry: git.namesny.com + username: ${{ gitea.actor }} + password: ${{ secrets.REGISTRY_TOKEN }} + - name: Build and push + run: | + docker build -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 new file mode 100644 index 0000000..53e8671 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM alpine:3 + +RUN apk add --no-cache kubectl kustomize age webhook + +# Install sops +ADD https://github.com/getsops/sops/releases/download/v3.8.1/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://raw.githubusercontent.com/viaduct-ai/kustomize-sops/master/scripts/install-ksops-archive.sh /tmp/install-ksops-archive.sh +RUN chmod +x /tmp/install-ksops-archive.sh +RUN /tmp/install-ksops-archive.sh + +ENTRYPOINT ["/usr/local/bin/webhook", "--hooks", "/etc/webhook/hooks.yaml"] \ No newline at end of file diff --git a/README.md b/README.md index aca4587..a4fc62a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ -# webhook-deployer +# Webhook 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) +- [sops](https://github.com/getsops/sops) +- [ksops](https://github.com/viaduct-ai/kustomize-sops)