From 7a8f1ac364dc643f328a28d4dcd4a9782ea67004 Mon Sep 17 00:00:00 2001 From: Gareth Clay Date: Fri, 15 Sep 2023 09:26:55 +0100 Subject: [PATCH] Instanced pipeline updates * Adds missing build-image.yml task * Removes redundant pipeline definition, config and script --- ci/config-concourse.yml | 4 - ci/pipeline.yml | 251 --------------------------------------- ci/tasks/build-image.yml | 19 +++ scripts/set-pipelines.sh | 35 ------ 4 files changed, 19 insertions(+), 290 deletions(-) delete mode 100644 ci/config-concourse.yml delete mode 100644 ci/pipeline.yml create mode 100644 ci/tasks/build-image.yml delete mode 100755 scripts/set-pipelines.sh diff --git a/ci/config-concourse.yml b/ci/config-concourse.yml deleted file mode 100644 index dfd5802b..00000000 --- a/ci/config-concourse.yml +++ /dev/null @@ -1,4 +0,0 @@ -artifactory-server: https://repo.spring.io -build-name: spring-cloud-open-service-broker -scosb-slack-success-channel: "#sc-app-broker" -ab-slack-failure-channel: "#sc-app-broker" diff --git a/ci/pipeline.yml b/ci/pipeline.yml deleted file mode 100644 index 74c4efec..00000000 --- a/ci/pipeline.yml +++ /dev/null @@ -1,251 +0,0 @@ ---- -aliases: - - &slack-success-notification - put: alert - params: - icon_emoji: ":concourse:" - username: concourse - channel: ((scosb-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: ((ab-slack-failure-channel)) - text: 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: scosb-ci-image - params: - build: ci-images-git-repo/ci/images/scosb-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 - 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-staging - 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-staging - 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-staging - 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: git-repo-staging - type: git - source: - uri: ((github-repo)) - username: ((github-token)) - password: ((github-password)) - branch: ((github-username))/staging - - - name: ci-images-git-repo - type: git - source: - uri: ((github-repo)) - branch: ((branch)) - paths: ["ci/images/*"] - - - name: scosb-ci-image - type: docker-image - source: - repository: ((corporate-harbor-registry))/((dockerhub-organization))/scosb-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: "build" - jobs: - - build - - name: "milestone" - jobs: - - stage-milestone - - promote-milestone - - name: "rc" - jobs: - - stage-rc - - promote-rc - - name: "release" - jobs: - - stage-release - - promote-release - - sync-to-maven-central - - name: "ci-images" - jobs: - - build-ci-images - - name: "all" - jobs: - - build - - stage-milestone - - promote-milestone - - stage-rc - - promote-rc - - stage-release - - promote-release - - sync-to-maven-central - - build-ci-images diff --git a/ci/tasks/build-image.yml b/ci/tasks/build-image.yml new file mode 100644 index 00000000..1de31aa0 --- /dev/null +++ b/ci/tasks/build-image.yml @@ -0,0 +1,19 @@ +--- +platform: linux +image_resource: + type: registry-image + source: + repository: ((dockerhub-mirror-registry))/concourse/oci-build-task + tag: 0.11.1 + +inputs: + - name: source + +outputs: + - name: image + +run: + path: build + +params: + CONTEXT: diff --git a/scripts/set-pipelines.sh b/scripts/set-pipelines.sh deleted file mode 100755 index e68cade9..00000000 --- a/scripts/set-pipelines.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -readonly FLY_TARGET="scosb" -readonly GITHUB_REPO="https://github.com/spring-cloud/spring-cloud-open-service-broker" - -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" -} - -main() { - fly -t scosb sync - - pushd "$(dirname "$0")/../ci" >/dev/null - - set_pipeline scosb-3.5.x pipeline.yml 3.5.x - - popd >/dev/null -} - -main