Commit 597b24f4 authored by Jonas Ådahl's avatar Jonas Ådahl Committed by Benjamin Tissoires
Browse files

Add publish stage pushing images to quay.io



This splits up the template variable into registry domain and path, so
that one can 'podman login domain'.
Signed-off-by: Jonas Ådahl's avatarJonas Ådahl <jadahl@gmail.com>
parent 87128504
......@@ -83,6 +83,7 @@ stages:
- ubuntu_container_build
- ubuntu_check
- deploy
- publish
#
......@@ -199,4 +200,4 @@ bootstrap-qemu:
bootstrap-qemu-mkosi:
extends: .qemu-mkosi
needs:
- bootstrap
\ No newline at end of file
- bootstrap
......@@ -71,4 +71,57 @@
- kvm
variables:
FDO_REPO_SUFFIX: qemu-mkosi-base
FDO_DISTRIBUTION_EXEC: 'mkdir -p /app && cp bootstrap/vmctl.sh /app/vmctl && bootstrap/prep_mkosi.sh'
\ No newline at end of file
FDO_DISTRIBUTION_EXEC: 'mkdir -p /app && cp bootstrap/vmctl.sh /app/vmctl && bootstrap/prep_mkosi.sh'
.publish:
script:
- podman login --username "$QUAY_USER" --password "$QUAY_TOKEN" quay.io
- set -x
- podman pull $CI_REGISTRY_IMAGE/$FDO_REPO_SUFFIX:$FDO_DISTRIBUTION_TAG
- podman push $CI_REGISTRY_IMAGE/$FDO_REPO_SUFFIX:$FDO_DISTRIBUTION_TAG quay.io/freedesktop.org/ci-templates:$FDO_DISTRIBUTION_IMAGE-$FDO_ARCHITECTURE-$FDO_DISTRIBUTION_TAG
- set +x
- podman logout quay.io
rules:
- if: '$CI_COMMIT_BRANCH == "master" && $CI_PROJECT_PATH == "freedesktop/ci-templates"'
.publish@x86_64:
extends: .publish
variables:
FDO_ARCHITECTURE: x86_64
.publish@aarch64:
extends: .publish
variables:
FDO_ARCHITECTURE: aarch64
publish-buildah@x86_64:
stage: publish
extends:
- .bootstrap
- .publish@x86_64
variables:
FDO_DISTRIBUTION_IMAGE: buildah
publish-buildah@aarch64:
stage: publish
extends:
- .bootstrap@aarch64
- .publish@aarch64
variables:
FDO_DISTRIBUTION_IMAGE: buildah
publish-qemu@x86_64:
stage: publish
extends:
- .qemu
- .publish@x86_64
variables:
FDO_DISTRIBUTION_IMAGE: qemu
publish-qemu-mkosi@x86_64:
stage: publish
extends:
- .qemu-mkosi
- .publish@x86_64
variables:
FDO_DISTRIBUTION_IMAGE: qemu-mkosi
\ No newline at end of file
......@@ -72,3 +72,56 @@
variables:
FDO_REPO_SUFFIX: qemu-mkosi-base
FDO_DISTRIBUTION_EXEC: 'mkdir -p /app && cp bootstrap/vmctl.sh /app/vmctl && bootstrap/prep_mkosi.sh'
.publish:
script:
- podman login --username "$QUAY_USER" --password "$QUAY_TOKEN" {{ci_templates_registry}}
- set -x
- podman pull $CI_REGISTRY_IMAGE/$FDO_REPO_SUFFIX:$FDO_DISTRIBUTION_TAG
- podman push $CI_REGISTRY_IMAGE/$FDO_REPO_SUFFIX:$FDO_DISTRIBUTION_TAG {{ci_templates_registry}}{{ci_templates_registry_path}}:$FDO_DISTRIBUTION_IMAGE-$FDO_ARCHITECTURE-$FDO_DISTRIBUTION_TAG
- set +x
- podman logout {{ci_templates_registry}}
rules:
- if: '$CI_COMMIT_BRANCH == "master" && $CI_PROJECT_PATH == "freedesktop/ci-templates"'
.publish@x86_64:
extends: .publish
variables:
FDO_ARCHITECTURE: x86_64
.publish@aarch64:
extends: .publish
variables:
FDO_ARCHITECTURE: aarch64
publish-buildah@x86_64:
stage: publish
extends:
- .bootstrap
- .publish@x86_64
variables:
FDO_DISTRIBUTION_IMAGE: buildah
publish-buildah@aarch64:
stage: publish
extends:
- .bootstrap@aarch64
- .publish@aarch64
variables:
FDO_DISTRIBUTION_IMAGE: buildah
publish-qemu@x86_64:
stage: publish
extends:
- .qemu
- .publish@x86_64
variables:
FDO_DISTRIBUTION_IMAGE: qemu
publish-qemu-mkosi@x86_64:
stage: publish
extends:
- .qemu-mkosi
- .publish@x86_64
variables:
FDO_DISTRIBUTION_IMAGE: qemu-mkosi
......@@ -140,4 +140,5 @@ globals:
## @ci_templates_registry_path: the path to where the templates should look
## for bootstrap images.
ci_templates_registry_path: 'registry.freedesktop.org/freedesktop/ci-templates'
ci_templates_registry: 'quay.io'
ci_templates_registry_path: '/freedesktop.org/ci-templates'
......@@ -27,6 +27,7 @@ stages:
- {{distribution}}_check
{% endfor %}
- deploy
- publish
#
......@@ -144,3 +145,4 @@ bootstrap-qemu-mkosi:
extends: .qemu-mkosi
needs:
- bootstrap
......@@ -203,7 +203,7 @@
#
.fdo.container-build@{{distribution}}:
extends: .fdo.{{distribution}}
image: {{ci_templates_registry_path}}/buildah:{{bootstrap_tag}}
image: {{ci_templates_registry}}{{ci_templates_registry_path}}:buildah-x86_64-{{bootstrap_tag}}
stage: build
script:
# log in to the registry
......@@ -318,7 +318,7 @@
# See ``.fdo.container-build@{{distribution}}`` for details.
.fdo.container-build@{{distribution}}@aarch64:
extends: .fdo.container-build@{{distribution}}
image: {{ci_templates_registry_path}}:buildah-aarch64-{{bootstrap_tag}}
image: {{ci_templates_registry}}{{ci_templates_registry_path}}:buildah-aarch64-{{bootstrap_tag}}
tags:
- aarch64
{% endif %}
......@@ -336,7 +336,7 @@
extends: .fdo.container-build@{{distribution}}
tags:
- kvm
image: {{ci_templates_registry_path}}/qemu-mkosi-base:{{qemu_tag}}
image: {{ci_templates_registry}}{{ci_templates_registry_path}}:qemu-mkosi-base-x86_64-{{qemu_tag}}
script:
# log in to the registry
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
......@@ -453,7 +453,7 @@
graphroot = "/var/lib/containers/storage"
EOF
- QEMU_BASE_IMAGE=${QEMU_BASE_IMAGE:-{{ci_templates_registry_path}}/qemu-base:{{qemu_tag}}}
- QEMU_BASE_IMAGE=${QEMU_BASE_IMAGE:-{{ci_templates_registry}}{{ci_templates_registry_path}}:qemu-base-x86_64-{{qemu_tag}}}
- echo Building $FDO_REPO_SUFFIX:$DISTRO_TAG from $QEMU_BASE_IMAGE
......
......@@ -180,7 +180,7 @@
#
.fdo.container-build@alpine:
extends: .fdo.alpine
image: registry.freedesktop.org/freedesktop/ci-templates/buildah:2020-10-30.1
image: quay.io/freedesktop.org/ci-templates:buildah-x86_64-2020-10-30.1
stage: build
script:
# log in to the registry
......@@ -284,7 +284,7 @@
# See ``.fdo.container-build@alpine`` for details.
.fdo.container-build@alpine@aarch64:
extends: .fdo.container-build@alpine
image: registry.freedesktop.org/freedesktop/ci-templates:buildah-aarch64-2020-10-30.1
image: quay.io/freedesktop.org/ci-templates:buildah-aarch64-2020-10-30.1
tags:
- aarch64
......
......@@ -180,7 +180,7 @@
#
.fdo.container-build@arch:
extends: .fdo.arch
image: registry.freedesktop.org/freedesktop/ci-templates/buildah:2020-10-30.1
image: quay.io/freedesktop.org/ci-templates:buildah-x86_64-2020-10-30.1
stage: build
script:
# log in to the registry
......
......@@ -186,7 +186,7 @@
#
.fdo.container-build@centos:
extends: .fdo.centos
image: registry.freedesktop.org/freedesktop/ci-templates/buildah:2020-10-30.1
image: quay.io/freedesktop.org/ci-templates:buildah-x86_64-2020-10-30.1
stage: build
script:
# log in to the registry
......
......@@ -186,7 +186,7 @@
#
.fdo.container-build@debian:
extends: .fdo.debian
image: registry.freedesktop.org/freedesktop/ci-templates/buildah:2020-10-30.1
image: quay.io/freedesktop.org/ci-templates:buildah-x86_64-2020-10-30.1
stage: build
script:
# log in to the registry
......@@ -299,7 +299,7 @@
# See ``.fdo.container-build@debian`` for details.
.fdo.container-build@debian@aarch64:
extends: .fdo.container-build@debian
image: registry.freedesktop.org/freedesktop/ci-templates:buildah-aarch64-2020-10-30.1
image: quay.io/freedesktop.org/ci-templates:buildah-aarch64-2020-10-30.1
tags:
- aarch64
......@@ -315,7 +315,7 @@
extends: .fdo.container-build@debian
tags:
- kvm
image: registry.freedesktop.org/freedesktop/ci-templates/qemu-mkosi-base:2020-10-30.1
image: quay.io/freedesktop.org/ci-templates:qemu-mkosi-base-x86_64-2020-10-30.1
script:
# log in to the registry
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
......@@ -414,7 +414,7 @@
graphroot = "/var/lib/containers/storage"
EOF
- QEMU_BASE_IMAGE=${QEMU_BASE_IMAGE:-registry.freedesktop.org/freedesktop/ci-templates/qemu-base:2020-10-30.1}
- QEMU_BASE_IMAGE=${QEMU_BASE_IMAGE:-quay.io/freedesktop.org/ci-templates:qemu-base-x86_64-2020-10-30.1}
- echo Building $FDO_REPO_SUFFIX:$DISTRO_TAG from $QEMU_BASE_IMAGE
......
......@@ -186,7 +186,7 @@
#
.fdo.container-build@fedora:
extends: .fdo.fedora
image: registry.freedesktop.org/freedesktop/ci-templates/buildah:2020-10-30.1
image: quay.io/freedesktop.org/ci-templates:buildah-x86_64-2020-10-30.1
stage: build
script:
# log in to the registry
......@@ -289,7 +289,7 @@
# See ``.fdo.container-build@fedora`` for details.
.fdo.container-build@fedora@aarch64:
extends: .fdo.container-build@fedora
image: registry.freedesktop.org/freedesktop/ci-templates:buildah-aarch64-2020-10-30.1
image: quay.io/freedesktop.org/ci-templates:buildah-aarch64-2020-10-30.1
tags:
- aarch64
......@@ -305,7 +305,7 @@
extends: .fdo.container-build@fedora
tags:
- kvm
image: registry.freedesktop.org/freedesktop/ci-templates/qemu-mkosi-base:2020-10-30.1
image: quay.io/freedesktop.org/ci-templates:qemu-mkosi-base-x86_64-2020-10-30.1
script:
# log in to the registry
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
......@@ -405,7 +405,7 @@
graphroot = "/var/lib/containers/storage"
EOF
- QEMU_BASE_IMAGE=${QEMU_BASE_IMAGE:-registry.freedesktop.org/freedesktop/ci-templates/qemu-base:2020-10-30.1}
- QEMU_BASE_IMAGE=${QEMU_BASE_IMAGE:-quay.io/freedesktop.org/ci-templates:qemu-base-x86_64-2020-10-30.1}
- echo Building $FDO_REPO_SUFFIX:$DISTRO_TAG from $QEMU_BASE_IMAGE
......
......@@ -186,7 +186,7 @@
#
.fdo.container-build@ubuntu:
extends: .fdo.ubuntu
image: registry.freedesktop.org/freedesktop/ci-templates/buildah:2020-10-30.1
image: quay.io/freedesktop.org/ci-templates:buildah-x86_64-2020-10-30.1
stage: build
script:
# log in to the registry
......@@ -298,7 +298,7 @@
# See ``.fdo.container-build@ubuntu`` for details.
.fdo.container-build@ubuntu@aarch64:
extends: .fdo.container-build@ubuntu
image: registry.freedesktop.org/freedesktop/ci-templates:buildah-aarch64-2020-10-30.1
image: quay.io/freedesktop.org/ci-templates:buildah-aarch64-2020-10-30.1
tags:
- aarch64
......@@ -314,7 +314,7 @@
extends: .fdo.container-build@ubuntu
tags:
- kvm
image: registry.freedesktop.org/freedesktop/ci-templates/qemu-mkosi-base:2020-10-30.1
image: quay.io/freedesktop.org/ci-templates:qemu-mkosi-base-x86_64-2020-10-30.1
script:
# log in to the registry
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
......@@ -458,7 +458,7 @@
graphroot = "/var/lib/containers/storage"
EOF
- QEMU_BASE_IMAGE=${QEMU_BASE_IMAGE:-registry.freedesktop.org/freedesktop/ci-templates/qemu-base:2020-10-30.1}
- QEMU_BASE_IMAGE=${QEMU_BASE_IMAGE:-quay.io/freedesktop.org/ci-templates:qemu-base-x86_64-2020-10-30.1}
- echo Building $FDO_REPO_SUFFIX:$DISTRO_TAG from $QEMU_BASE_IMAGE
......
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