aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.d/container-template.yml
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2021-05-19 20:54:57 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2021-05-27 16:39:23 +0200
commitfb3c0334dedc09994359b213df303440a8ee6edd (patch)
tree51af7febb08f533cf43431e80a02aac9d9075b9c /.gitlab-ci.d/container-template.yml
parent840cafced12f962e7447de4333a55b67b44030a1 (diff)
gitlab: Extract container job template to container-template.yml
Extract the container job template to a new file (container-template.yml) to be able to reuse it without having to run all the jobs included, which are mainly useful for mainstream CI. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Message-Id: <20210519185504.2198573-4-f4bug@amsat.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to '.gitlab-ci.d/container-template.yml')
-rw-r--r--.gitlab-ci.d/container-template.yml21
1 files changed, 21 insertions, 0 deletions
diff --git a/.gitlab-ci.d/container-template.yml b/.gitlab-ci.d/container-template.yml
new file mode 100644
index 0000000000..1baecd9460
--- /dev/null
+++ b/.gitlab-ci.d/container-template.yml
@@ -0,0 +1,21 @@
+.container_job_template:
+ image: docker:stable
+ stage: containers
+ services:
+ - docker:dind
+ before_script:
+ - export TAG="$CI_REGISTRY_IMAGE/qemu/$NAME:latest"
+ - export COMMON_TAG="$CI_REGISTRY/qemu-project/qemu/$NAME:latest"
+ - apk add python3
+ - docker info
+ - docker login $CI_REGISTRY -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
+ script:
+ - echo "TAG:$TAG"
+ - echo "COMMON_TAG:$COMMON_TAG"
+ - ./tests/docker/docker.py --engine docker build
+ -t "qemu/$NAME" -f "tests/docker/dockerfiles/$NAME.docker"
+ -r $CI_REGISTRY/qemu-project/qemu
+ - docker tag "qemu/$NAME" "$TAG"
+ - docker push "$TAG"
+ after_script:
+ - docker logout