From ae1d1323df32061ac9a9b9293f905fed6172a241 Mon Sep 17 00:00:00 2001 From: valvin Date: Mon, 28 Nov 2022 21:19:27 +0000 Subject: [PATCH] chore: add drone file (#1) Reviewed-on: https://git.valvin.fr/valvin/gemini-agate-image/pulls/1 --- .drone.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..bc37093 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,32 @@ +--- +kind: pipeline +type: docker +name: default +environment: + CI_REGISTRY: "git.valvin.fr" + CI_REGISTRY_USER: "valvin" + CI_REGISTRY_IMAGE: "git.valvin.fr/valvin/gemini-agate-image" + IMAGE_TAG: "latest" + +steps: +- name: test_build_image + image: gcr.io/kaniko-project/executor:v1.7.0-debug + commands: + - echo "testing build image without push" + - /kaniko/executor --context $DRONE_WORKSPACE --dockerfile Dockerfile --destination $CI_REGISTRY_IMAGE:$IMAGE_TAG --no-push + when: + event: + - pull_request +- name: build_image_and_push + image: gcr.io/kaniko-project/executor:v1.7.0-debug + commands: + - echo "init registry credentials" + - echo $DRONE_WORKSPACE + - mkdir -p /kanico/.docker + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json + - /kaniko/executor --context $DRONE_WORKSPACE --dockerfile Dockerfile --destination $CI_REGISTRY_IMAGE:$IMAGE_TAG + when: + branch: + - main + event: + - push \ No newline at end of file