diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2022-05-12 13:14:35 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2022-05-12 13:17:29 +0200 |
commit | abe0272b8f19caf7928d85597b6c1fa54fd7c936 (patch) | |
tree | 1824cabd301eef6ef840bf5621854c58666373e0 /jjb/functest | |
parent | ee07d05941cbfe6faff2502cf270eeda157511fa (diff) |
Build multiarch images
Change-Id: I26aad0b07797814b2d9fbeafa4e9ec1d5040be11
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'jjb/functest')
-rw-r--r-- | jjb/functest/xtesting-ci-docker.yaml | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/jjb/functest/xtesting-ci-docker.yaml b/jjb/functest/xtesting-ci-docker.yaml index 6c9147d6d..8f223a0ea 100644 --- a/jjb/functest/xtesting-ci-docker.yaml +++ b/jjb/functest/xtesting-ci-docker.yaml @@ -8,6 +8,33 @@ sudo docker push {image} sudo docker system prune --all -f +- builder: + name: xtesting-ci-docker-multiarch-builder + builders: + - shell: | + sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + git clone https://github.com/estesp/manifest-tool + (cd manifest-tool && git checkout v0.9.0 && \ + sudo -E make && sudo -E make install) + (cd {dir} && \ + sudo docker build --pull -t {image}:amd64-{tag} . && \ + sudo docker push {image}) + (cd {dir} && \ + git checkout Dockerfile + sed -i -e "s|{from_amd64}|{to_arm64}|g" Dockerfile + sudo docker build --pull -t {image}:arm64-{tag} . && \ + sudo docker push {image}) + (cd {dir} && \ + git checkout Dockerfile + sed -i -e "s|{from_amd64}|{to_arm}|g" Dockerfile + sudo docker build --pull -t {image}:arm-{tag} . && \ + sudo docker push {image}) + sudo manifest-tool push from-args \ + --platforms linux/amd64,linux/arm,linux/arm64 \ + --template {image}:ARCH-{tag} \ + --target {image}:{tag} + sudo docker system prune --all -f + - scm: name: xtesting-ci-docker-scm scm: @@ -43,6 +70,23 @@ image: '{image}' dir: '{dir}' +- job-template: + name: xtesting-ci-docker-multitarch-{stream} + scm: + - xtesting-ci-docker-scm + parameters: + - xtesting-ci-docker-parameter + triggers: + - xtesting-ci-docker-trigger + builders: + - xtesting-ci-docker-multiarch-builder: + image: '{image}' + dir: '{dir}' + tag: '{tag}' + from_amd64: '{from_amd64}' + to_arm64: '{to_arm64}' + to_arm: '{to_arm}' + - project: name: xtesting-ci-docker stream: @@ -58,6 +102,19 @@ jobs: - xtesting-ci-docker-{stream} +- project: + name: xtesting-ci-docker-multiarch + stream: + - jenkins-agent-buster: + dir: jenkins-agent + image: opnfv/xtesting-jenkins-agent + tag: 3.36 + from_amd64: debian:buster + to_arm64: arm64v8/debian:buster + to_arm: arm32v7/debian:buster + jobs: + - xtesting-ci-docker-multitarch-{stream} + - builder: name: xtesting-ci-docker-trivy-builder builders: |