2022-11-27 16:12:35 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: default
|
2022-11-27 16:22:30 +00:00
|
|
|
environment:
|
|
|
|
CI_REGISTRY: "git.valvin.fr"
|
|
|
|
CI_REGISTRY_USER: "valvin"
|
|
|
|
CI_REGISTRY_IMAGE: "git.valvin.fr/valvin/gemini-agate-image"
|
|
|
|
IMAGE_TAG: "latest"
|
2022-11-27 16:12:35 +00:00
|
|
|
|
|
|
|
steps:
|
2022-11-27 16:41:19 +00:00
|
|
|
- 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
|
2022-11-27 16:41:54 +00:00
|
|
|
- name: build_image_and_push
|
2022-11-27 16:12:35 +00:00
|
|
|
image: gcr.io/kaniko-project/executor:v1.7.0-debug
|
|
|
|
commands:
|
2022-11-27 16:27:56 +00:00
|
|
|
- echo "init registry credentials"
|
2022-11-27 16:31:46 +00:00
|
|
|
- echo $DRONE_WORKSPACE
|
2022-11-27 16:29:25 +00:00
|
|
|
- mkdir -p /kanico/.docker
|
2022-11-27 16:32:58 +00:00
|
|
|
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
2022-11-27 16:41:19 +00:00
|
|
|
- /kaniko/executor --context $DRONE_WORKSPACE --dockerfile Dockerfile --destination $CI_REGISTRY_IMAGE:$IMAGE_TAG --no-push
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- main
|