Rework deployer container
Build webhook-deployer container / Build image (push) Failing after 9s Details

This commit is contained in:
LordMathis 2024-05-15 19:14:46 +02:00
parent 7e9a5ab301
commit a8c2bced56
5 changed files with 55 additions and 8 deletions

View File

@ -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

View File

@ -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"]
ENTRYPOINT ["/sbin/tini", "--"]

View File

@ -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)

36
renovate.json Normal file
View File

@ -0,0 +1,36 @@
{
"extends": [
"config:best-practices"
],
"ignoreTests": true,
"customManagers": [
{
"customType": "regex",
"fileMatch": [
"^versions\\.env$"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\n.*?=(?<currentValue>.*)"
],
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
}
],
"packageRules": [
{
"matchPackagePatterns": [
".*"
],
"matchManagers": [
"custom.regex"
],
"extractVersion": "^(v|release-)?(?<version>.*)$",
"automerge": true
}
],
"pin": {
"automerge": true
},
"digest": {
"automerge": true
}
}

4
versions.env Normal file
View File

@ -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