From 7aedb9ee33764056f874e6f8a191af89ce5f8903 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Tue, 3 May 2022 15:50:29 +0200 Subject: [PATCH] Build CI image using oci-build-task resource --- ci/parameters.yml | 3 +++ ci/pipeline.yml | 21 ++++++++++++++----- ci/scripts/sync-to-maven-central.sh | 8 -------- ci/tasks/build-ci-image.yml | 31 +++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 13 deletions(-) delete mode 100755 ci/scripts/sync-to-maven-central.sh create mode 100644 ci/tasks/build-ci-image.yml diff --git a/ci/parameters.yml b/ci/parameters.yml index 2c45862cf41..2f970570a23 100644 --- a/ci/parameters.yml +++ b/ci/parameters.yml @@ -8,4 +8,7 @@ milestone: "5.3.x" build-name: "spring-framework" pipeline-name: "spring-framework" concourse-url: "https://ci.spring.io" +registry-mirror-host: docker.repo.spring.io +registry-mirror-username: ((artifactory-username)) +registry-mirror-password: ((artifactory-password)) task-timeout: 1h00m diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 49ee3d0b4d9..5f7e91ba466 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -24,6 +24,10 @@ anchors: username: ((docker-hub-username)) password: ((docker-hub-password)) tag: ((milestone)) + registry-mirror-vars: ®istry-mirror-vars + registry-mirror-host: ((registry-mirror-host)) + registry-mirror-username: ((registry-mirror-username)) + registry-mirror-password: ((registry-mirror-password)) slack-fail-params: &slack-fail-params text: > :concourse-failed: @@ -162,13 +166,20 @@ resources: jobs: - name: build-ci-images plan: - - get: ci-images-git-repo - trigger: true - - in_parallel: + - get: git-repo + - get: ci-images-git-repo + trigger: true + - task: build-ci-image + privileged: true + file: git-repo/ci/tasks/build-ci-image.yml + output_mapping: + image: ci-image + vars: + ci-image-name: ci-image + <<: *registry-mirror-vars - put: ci-image params: - build: ci-images-git-repo/ci/images - dockerfile: ci-images-git-repo/ci/images/ci-image/Dockerfile + image: ci-image/image.tar - name: build serial: true public: true diff --git a/ci/scripts/sync-to-maven-central.sh b/ci/scripts/sync-to-maven-central.sh deleted file mode 100755 index b42631164ed..00000000000 --- a/ci/scripts/sync-to-maven-central.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -export BUILD_INFO_LOCATION=$(pwd)/artifactory-repo/build-info.json -version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' ) -java -jar /opt/concourse-release-scripts.jar syncToCentral "RELEASE" $BUILD_INFO_LOCATION || { exit 1; } - -echo "Sync complete" -echo $version > version/version diff --git a/ci/tasks/build-ci-image.yml b/ci/tasks/build-ci-image.yml new file mode 100644 index 00000000000..2392595349e --- /dev/null +++ b/ci/tasks/build-ci-image.yml @@ -0,0 +1,31 @@ +--- +platform: linux +image_resource: + type: registry-image + source: + repository: concourse/oci-build-task + tag: 0.9.1 + registry_mirror: + host: ((registry-mirror-host)) + username: ((registry-mirror-username)) + password: ((registry-mirror-password)) +inputs: + - name: ci-images-git-repo +outputs: + - name: image +caches: + - path: ci-image-cache +params: + CONTEXT: ci-images-git-repo/ci/images + DOCKERFILE: ci-images-git-repo/ci/images/ci-image/Dockerfile + DOCKER_HUB_AUTH: ((docker-hub-auth)) +run: + path: /bin/sh + args: + - "-c" + - | + mkdir -p /root/.docker + cat > /root/.docker/config.json <