Switch to concourse-release-scripts image

The jar file is no longer publicly available.
This commit is contained in:
Gareth Clay
2023-10-02 13:24:36 +01:00
committed by Gareth Clay
parent f9573e6911
commit e18c86ba4d
9 changed files with 11 additions and 320 deletions

View File

@@ -1,16 +1,3 @@
== CI Pipeline
Set up the Concourse target and login:
[source]
----
$ fly -t spring-credhub login -n spring-credhub -c https://runway-ci.eng.vmware.com
----
Deploy the pipelines
[source]
----
$ ./set-pipelines.sh
----
All pipelines are set from the `main` branch.

View File

@@ -1,4 +0,0 @@
artifactory-server: https://repo.spring.io
build-name: spring-credhub
spring-credhub-slack-success-channel: "#sc-app-broker"
spring-credhub-slack-failure-channel: "#sc-app-broker"

View File

@@ -48,4 +48,3 @@ RUN curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-c
WORKDIR /unpack
ADD "https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v$CONCOURSE_JAVA_SCRIPTS_VERSION/concourse-java.sh" /opt/
ADD "https://repo.spring.io/ui/native/snapshot/io/spring/concourse/releasescripts/concourse-release-scripts/$CONCOURSE_RELEASE_SCRIPTS_VERSION/concourse-release-scripts-$CONCOURSE_RELEASE_SCRIPTS_VERSION.jar" /opt/

View File

@@ -1,237 +0,0 @@
---
aliases:
- &slack-success-notification
put: alert
params:
icon_emoji: ":concourse:"
username: concourse
channel: ((spring-credhub-slack-success-channel))
text: "$BUILD_PIPELINE_NAME pipeline has succeeded with build <${ATC_EXTERNAL_URL}/builds/$BUILD_ID|$BUILD_NAME>!"
- &slack-failure-notification
put: alert
params:
icon_emoji: ":animal-1252:"
username: concourse
channel: ((spring-credhub-slack-failure-channel))
text: <!here> Build <${ATC_EXTERNAL_URL}/builds/$BUILD_ID|$BUILD_NAME> of job $BUILD_JOB_NAME in the $BUILD_PIPELINE_NAME pipeline has failed!
jobs:
- name: build-ci-images
plan:
- get: ci-images-git-repo
trigger: true
- put: spring-credhub-ci-image
params:
build: ci-images-git-repo/ci/images/spring-credhub-ci
get_params:
skip_download: "true"
- name: build
serial: true
public: true
plan:
- get: git-repo
trigger: true
- task: build-project
timeout: 1h30m
file: git-repo/ci/tasks/build-project.yml
vars:
ci-image-tag: ((ci-image-tag))
- put: artifactory-repo
params: &artifactory-params
signing_key: ((signing-key))
signing_passphrase: ((signing-passphrase))
repo: libs-snapshot-local
folder: distribution-repository
build_uri: "${ATC_EXTERNAL_URL}/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}"
build_number: "${BUILD_PIPELINE_NAME}-${BUILD_JOB_NAME}-${BUILD_NAME}"
disable_checksum_uploads: true
artifact_set:
- include:
- "/**/*-docs.zip"
properties:
"zip.type": "docs"
"zip.deployed": "false"
on_success:
*slack-success-notification
on_failure:
*slack-failure-notification
- name: stage-milestone
serial: true
plan:
- get: git-repo
- task: stage
file: git-repo/ci/tasks/stage.yml
vars:
release-type: M
ci-image-tag: ((ci-image-tag))
- put: artifactory-repo
params:
<<: *artifactory-params
repo: libs-staging-local
- put: git-repo
params:
repository: stage-git-repo
- name: stage-rc
serial: true
plan:
- get: git-repo
- task: stage
file: git-repo/ci/tasks/stage.yml
vars:
release-type: RC
ci-image-tag: ((ci-image-tag))
- put: artifactory-repo
params:
<<: *artifactory-params
repo: libs-staging-local
- put: git-repo
params:
repository: stage-git-repo
- name: stage-release
serial: true
plan:
- get: git-repo
- task: stage
file: git-repo/ci/tasks/stage.yml
vars:
release-type: RELEASE
ci-image-tag: ((ci-image-tag))
- put: artifactory-repo
params:
<<: *artifactory-params
repo: libs-staging-local
- put: git-repo
params:
repository: stage-git-repo
- name: promote-milestone
serial: true
plan:
- get: git-repo
- get: artifactory-repo
passed: [stage-milestone]
params:
save_build_info: true
- task: promote
file: git-repo/ci/tasks/promote.yml
vars:
release-type: M
ci-image-tag: ((ci-image-tag))
- name: promote-rc
serial: true
plan:
- in_parallel:
- get: git-repo
- get: artifactory-repo
passed: [stage-rc]
params:
save_build_info: true
- task: promote
file: git-repo/ci/tasks/promote.yml
vars:
release-type: RC
ci-image-tag: ((ci-image-tag))
- name: promote-release
serial: true
plan:
- in_parallel:
- get: git-repo
- get: artifactory-repo
passed: [stage-release]
params:
save_build_info: true
- task: promote
file: git-repo/ci/tasks/promote.yml
vars:
release-type: RELEASE
ci-image-tag: ((ci-image-tag))
- name: sync-to-maven-central
serial: true
plan:
- in_parallel:
- get: git-repo
- get: artifactory-repo
passed: [promote-release]
params:
save_build_info: true
- task: sync-to-maven-central
file: git-repo/ci/tasks/sync-to-maven-central.yml
vars:
ci-image-tag: ((ci-image-tag))
resource_types:
- name: artifactory-resource
type: registry-image
source:
repository: ((dockerhub-mirror-registry))/springio/artifactory-resource
tag: 0.0.14
- name: slack-notification
type: registry-image
source:
repository: ((dockerhub-mirror-registry))/cfcommunity/slack-notification-resource
tag: latest
resources:
- name: git-repo
type: git
source:
uri: ((github-repo))
username: ((github-token))
password: ((github-password))
branch: ((branch))
ignore_paths: ["ci/images/*"]
fetch_tags: true
- name: ci-images-git-repo
type: git
source:
uri: ((github-repo))
branch: ((branch))
paths: ["ci/images/*"]
- name: spring-credhub-ci-image
type: docker-image
source:
repository: ((corporate-harbor-registry))/((dockerhub-organization))/spring-credhub-ci
username: ((corporate-harbor-robot-account.username))
password: ((corporate-harbor-robot-account.password))
tag: ((ci-image-tag))
- name: artifactory-repo
type: artifactory-resource
source:
uri: ((artifactory-server))
username: ((artifactory-username))
password: ((artifactory-password))
build_name: ((build-name))
- name: alert
type: slack-notification
source:
url: ((scs-slack-webhook))
groups:
- name: "builds"
jobs:
- build
- name: "releases"
jobs:
- stage-milestone
- promote-milestone
- stage-rc
- promote-rc
- stage-release
- promote-release
- sync-to-maven-central
- name: "ci-images"
jobs:
- build-ci-images

View File

@@ -1,13 +1,10 @@
#!/bin/bash
set -euo pipefail
# shellcheck source=scripts/common.sh
source $(dirname $0)/common.sh
readonly BUILD_INFO_LOCATION="$(pwd)/artifactory-repo/build-info.json"
readonly VERSION=$( jq -r '.buildInfo.modules[0].id' < "$BUILD_INFO_LOCATION" | sed 's/.*:.*:\(.*\)/\1/' )
version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' )
export BUILD_INFO_LOCATION=$(pwd)/artifactory-repo/build-info.json
java -jar /opt/concourse-release-scripts*.jar promote $RELEASE_TYPE $BUILD_INFO_LOCATION
java -jar /concourse-release-scripts.jar promote "$RELEASE_TYPE" "$BUILD_INFO_LOCATION"
echo "Promotion complete"
echo $version > version/version
echo "$VERSION" > version/version

View File

@@ -4,8 +4,8 @@ set -euo pipefail
readonly BUILD_INFO_LOCATION="$(pwd)/artifactory-repo/build-info.json"
readonly CONFIG_DIR="$(pwd)/git-repo/ci/config"
java -jar /opt/concourse-release-scripts*.jar \
--spring.config.location="${CONFIG_DIR}/release-scripts.yml" \
java -jar /concourse-release-scripts.jar \
--spring.config.location="$CONFIG_DIR/release-scripts.yml" \
publishToCentral 'RELEASE' "$BUILD_INFO_LOCATION" "artifactory-repo"
echo "Sync complete"

View File

@@ -1,47 +0,0 @@
#!/usr/bin/env bash
#
# Copyright 2016-2021 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -euo pipefail
readonly FLY_TARGET="spring-credhub"
readonly GITHUB_REPO="https://github.com/spring-projects/spring-credhub"
set_pipeline() {
local pipeline_name pipeline_definition branch ci_image_tag
pipeline_name="${1:?pipeline name must be provided}"
pipeline_definition="${2:?pipeline definition file must be provided}"
branch="${3:?branch must be provided}"
ci_image_tag="${4:-$branch}"
echo "Setting $pipeline_name pipeline..."
fly --target "$FLY_TARGET" set-pipeline \
--pipeline "$pipeline_name" \
--config "$pipeline_definition" \
--load-vars-from config-concourse.yml \
--var "github-repo=$GITHUB_REPO" \
--var "branch=$branch" \
--var "ci-image-tag=$ci_image_tag"
}
set_pipelines() {
fly -t "$FLY_TARGET" sync
set_pipeline spring-credhub-3.0.x pipeline.yml main spring-credhub-ci
}
set_pipelines

View File

@@ -3,10 +3,8 @@ platform: linux
image_resource:
type: registry-image
source:
repository: ((corporate-harbor-registry))/((dockerhub-organization))/spring-credhub-ci
username: ((corporate-harbor-robot-account.username))
password: ((corporate-harbor-robot-account.password))
tag: ((ci-image-tag))
repository: ((dockerhub-mirror-registry))/springio/concourse-release-scripts
tag: '0.3.4'
inputs:
- name: git-repo
- name: artifactory-repo

View File

@@ -3,10 +3,8 @@ platform: linux
image_resource:
type: registry-image
source:
repository: ((corporate-harbor-registry))/((dockerhub-organization))/spring-credhub-ci
username: ((corporate-harbor-robot-account.username))
password: ((corporate-harbor-robot-account.password))
tag: ((ci-image-tag))
repository: ((dockerhub-mirror-registry))/springio/concourse-release-scripts
tag: '0.3.4'
inputs:
- name: git-repo
- name: artifactory-repo