diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f1568b5..af61f86 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,18 +1,22 @@ stages: - build - - trigger variables: - IMAGE_NAME: thallian/confd-env - CI_BUILD_ARCHS: "linux/amd64,linux/arm64" - DOWNSTREAM_PROJECTS: " 19 20 21 25 27 28 29 30 31 32 34 35 36 37 39 40 41 42 43 44 47 48 74 88 98 109 112 120" + CI_REGISTRY_IMAGE: thallian/confd-env + DOWNSTREAM_PROJECTS: "" build: stage: build + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] script: - - docker login -u $DOCKER_USER -p $DOCKER_PASSWORD $DOCKER_REGISTRY - - docker buildx build --platform "$CI_BUILD_ARCHS" --progress plain --pull --tag "$IMAGE_NAME:$CI_COMMIT_SHA" --tag "$IMAGE_NAME:$CI_COMMIT_REF_NAME" --tag "$IMAGE_NAME:latest" --push . - - | - for proj in $DOWNSTREAM_PROJECTS; do - curl --request POST --form "token=$CI_JOB_TOKEN" --form ref=master $CI_API_V4_URL/projects/$proj/trigger/pipeline - done + - mkdir -p /kaniko/.docker + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(printf "%s:%s" "$CI_REGISTRY_USER" "$CI_REGISTRY_PASSWORD" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json + - >- + /kaniko/executor + --context "$CI_PROJECT_DIR" + --dockerfile "$CI_PROJECT_DIR/Dockerfile" + --destination "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA" + --destination "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME" + --destination "$CI_REGISTRY_IMAGE:latest" diff --git a/rootfs/bin/confd-env b/rootfs/bin/confd-env new file mode 100755 index 0000000..ed5c333 --- /dev/null +++ b/rootfs/bin/confd-env @@ -0,0 +1,2 @@ +#!/command/with-contenv sh +confd -onetime -backend env diff --git a/rootfs/etc/s6-overlay/s6-rc.d/confd/up b/rootfs/etc/s6-overlay/s6-rc.d/confd/up index ed5c333..74f92c5 100644 --- a/rootfs/etc/s6-overlay/s6-rc.d/confd/up +++ b/rootfs/etc/s6-overlay/s6-rc.d/confd/up @@ -1,2 +1 @@ -#!/command/with-contenv sh -confd -onetime -backend env +confd-env diff --git a/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/confd b/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/confd deleted file mode 100644 index e69de29..0000000