Build CI image using oci-build-task resource
This commit is contained in:
@@ -8,4 +8,7 @@ milestone: "5.3.x"
|
|||||||
build-name: "spring-framework"
|
build-name: "spring-framework"
|
||||||
pipeline-name: "spring-framework"
|
pipeline-name: "spring-framework"
|
||||||
concourse-url: "https://ci.spring.io"
|
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
|
task-timeout: 1h00m
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ anchors:
|
|||||||
username: ((docker-hub-username))
|
username: ((docker-hub-username))
|
||||||
password: ((docker-hub-password))
|
password: ((docker-hub-password))
|
||||||
tag: ((milestone))
|
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
|
slack-fail-params: &slack-fail-params
|
||||||
text: >
|
text: >
|
||||||
:concourse-failed: <https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} failed!>
|
:concourse-failed: <https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} failed!>
|
||||||
@@ -162,13 +166,20 @@ resources:
|
|||||||
jobs:
|
jobs:
|
||||||
- name: build-ci-images
|
- name: build-ci-images
|
||||||
plan:
|
plan:
|
||||||
- get: ci-images-git-repo
|
- get: git-repo
|
||||||
trigger: true
|
- get: ci-images-git-repo
|
||||||
- in_parallel:
|
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
|
- put: ci-image
|
||||||
params:
|
params:
|
||||||
build: ci-images-git-repo/ci/images
|
image: ci-image/image.tar
|
||||||
dockerfile: ci-images-git-repo/ci/images/ci-image/Dockerfile
|
|
||||||
- name: build
|
- name: build
|
||||||
serial: true
|
serial: true
|
||||||
public: true
|
public: true
|
||||||
|
|||||||
@@ -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
|
|
||||||
31
ci/tasks/build-ci-image.yml
Normal file
31
ci/tasks/build-ci-image.yml
Normal file
@@ -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 <<EOF
|
||||||
|
{ "auths": { "https://index.docker.io/v1/": { "auth": "$DOCKER_HUB_AUTH" }}}
|
||||||
|
EOF
|
||||||
|
build
|
||||||
Reference in New Issue
Block a user