Commit 86579e9e authored by Simon Chabot's avatar Simon Chabot
Browse files

ci: use job templates to build/push images for buster and bullseye

parent cc018825da80
Pipeline #79593 passed with stage
in 1 minute and 41 seconds
......@@ -2,21 +2,22 @@
stages:
- build
cubicweb-base-test-build:
.cubicweb-base-test-build:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
rules:
- if: '$CI_MERGE_REQUEST_ID'
script:
before_script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
script:
- /kaniko/executor --context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/Dockerfile
--build-arg DIST=buster
--build-arg DIST=$DIST
--no-push
cubicweb-base-build-push:
.cubicweb-base-build-push:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
......@@ -25,16 +26,44 @@ cubicweb-base-build-push:
- if: '$CI_MERGE_REQUEST_ID'
when: never
- when: on_success
script:
before_script:
- |
echo "{\"auths\": {
\"$HUB_REGISTRY\":{\"username\":\"$HUB_REGISTRY_USER\",\"password\":\"$HUB_REGISTRY_PASSWORD\"},
\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}
}}" > /kaniko/.docker/config.json
script:
- /kaniko/executor --context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/Dockerfile
--build-arg DIST=$DIST
--destination $HUB_REGISTRY_IMAGE:$DIST-1.0
--destination $CI_REGISTRY_IMAGE:$DIST-1.0
test-build-buster:
extends: .cubicweb-base-test-build
variables:
DIST: buster
test-build-bullseye:
extends: .cubicweb-base-test-build
variables:
DIST: bullseye
build-push-buster:
extends: .cubicweb-base-build-push
variables:
DIST: buster
build-push-bullseye:
extends: .cubicweb-base-build-push
variables:
DIST: bullseye
script:
- /kaniko/executor --context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/Dockerfile
--build-arg DIST=buster
--destination $HUB_REGISTRY_IMAGE:buster-1.0
--build-arg DIST=$DIST
--destination $HUB_REGISTRY_IMAGE:$DIST-1.0
--destination $HUB_REGISTRY_IMAGE:latest
--destination $CI_REGISTRY_IMAGE:buster-1.0
--destination $CI_REGISTRY_IMAGE:$DIST-1.0
--destination $CI_REGISTRY_IMAGE:latest
......@@ -15,7 +15,8 @@ Tags
Images available:
* ``latest``,
* ``1.0``,
* ``bullseye-1.0``,
* ``buster-1.0``,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment