Files
spring-credhub/ci/pipeline.yml
2024-05-23 13:14:13 +01:00

257 lines
7.1 KiB
YAML

---
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
- task: generate-docker-credentials
file: ci-images-git-repo/ci/tasks/generate-docker-credentials.yml
input_mapping:
git-repo: ci-images-git-repo
vars:
registry: ((spring-credhub-dev-docker-registry))
registry-username: ((broadcom-jfrog-artifactory-robot-account.username))
registry-password: ((broadcom-jfrog-artifactory-robot-account.password))
- task: build-image
privileged: true
file: ci-images-git-repo/ci/tasks/build-oci-image.yml
input_mapping:
git-repo: ci-images-git-repo
params:
CONTEXT: git-repo/ci/images/spring-credhub-ci
- put: spring-credhub-ci-image
inputs: detect
params:
image: image/image.tar
no_get: true
on_failure: *slack-failure-notification
- name: build
serial: true
public: true
plan:
- get: git-repo
trigger: true
- task: build-project
privileged: true
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
- 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
- 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
- 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
resource_types:
- name: artifactory-resource
type: registry-image
source:
repository: ((spring-credhub-virtual-docker-registry))/springio/artifactory-resource
username: ((broadcom-jfrog-artifactory-robot-account.username))
password: ((broadcom-jfrog-artifactory-robot-account.password))
tag: 0.0.14
- name: slack-notification
type: registry-image
source:
repository: ((spring-credhub-virtual-docker-registry))/cfcommunity/slack-notification-resource
username: ((broadcom-jfrog-artifactory-robot-account.username))
password: ((broadcom-jfrog-artifactory-robot-account.password))
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/*
- ci/scripts/generate-docker-credentials.sh
- ci/tasks/build-oci-image.yml
- ci/tasks/generate-docker-credentials.yml
- name: spring-credhub-ci-image
type: registry-image
source:
repository: ((spring-credhub-dev-docker-registry))/ci/spring-credhub-ci
username: ((broadcom-jfrog-artifactory-robot-account.username))
password: ((broadcom-jfrog-artifactory-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