diff --git a/cf/broker_config.yml b/cf/broker_config.yml index 5a40d97..e123889 100644 --- a/cf/broker_config.yml +++ b/cf/broker_config.yml @@ -7,7 +7,7 @@ basic_plan_name: basic basic_plan_id: basic description: Broker to create config-servers long_description: Broker to create config-servers -config_server_release_tag: v3.1.0 +config_server_release_tag: v3.0.0 cloud_foundry_config: api_url: (( param "Please override cloud_foundry_config.api_url in inputs.yml" )) skip_ssl_validation: true diff --git a/ci/pipeline.yml b/ci/pipeline.yml index b358fc4..7ced5ac 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -9,7 +9,14 @@ meta: uri: (( concat "git@github.com:" meta.github.owner "/" meta.github.repo )) owner: (( param "Please specify the name of the user / organization that owns the Github repository" )) repo: (( param "Please specify the name of the Github repository" )) - branch: master + branch: update-release-tag + private_key: (( param "Please generate an SSH Deployment Key for this repo and specify it here" )) + + spring-github: + uri: (( concat "git@github.com:" meta.github.owner "/" meta.github.repo )) + owner: (( param "Please specify the name of the user / organization that owns the Github repository" )) + repo: (( param "Please specify the name of the Github repository" )) + branch: ci private_key: (( param "Please generate an SSH Deployment Key for this repo and specify it here" )) go: @@ -64,6 +71,7 @@ groups: - shipit - major - minor + - bump-ccs-ver - bump-patch jobs: @@ -107,6 +115,7 @@ jobs: - in_parallel: - { get: pipeline-tasks } - { get: git, trigger: true, passed: [test] } + - { get: fetch-spring-latest-rel } - task: teardown-testflight config: platform: linux @@ -136,6 +145,7 @@ jobs: repository: (( grab meta.image.name )) tag: (( grab meta.image.tag )) inputs: + - name: fetch-spring-latest-rel - name: pipeline-tasks - name: git run: @@ -193,6 +203,34 @@ jobs: icon_url: (( grab meta.slack.icon )) text: '(( concat meta.slack.fail_url " " meta.pipeline ": minor job failed" ))' + - name: bump-ccs-ver + public: true + plan: + - do: + - { get: fetch-spring-latest-rel, trigger: false} + - { get: pipeline-tasks } + - task: bump-ccs-tag + config: + platform: linux + image_resource: + type: docker-image + source: + repository: (( grab meta.image.name )) + tag: (( grab meta.image.tag )) + inputs: + - name: pipeline-tasks + - name: git + run: + path: pipeline-tasks/ci/scripts/bump-ccs-tag + args: [] + on_failure: + put: notify + params: + channel: (( grab meta.slack.channel )) + username: (( grab meta.slack.username )) + icon_url: (( grab meta.slack.icon )) + text: '(( concat meta.slack.fail_url " " meta.pipeline ": bump-ccs-tag job failed" ))' + - name: major public: true plan: @@ -405,3 +443,9 @@ resources: user: (( grab meta.github.owner )) repository: (( grab meta.github.repo )) access_token: (( grab meta.github.access_token )) + - name: fetch-spring-latest-rel + type: github-release + source: + user: (( grab meta.spring-github.owner )) + repository: (( grab meta.spring-github.repo )) + access_token: (( grab meta.spring-github.access_token )) diff --git a/ci/scripts/bump-ccs-tag b/ci/scripts/bump-ccs-tag new file mode 100755 index 0000000..0474183 --- /dev/null +++ b/ci/scripts/bump-ccs-tag @@ -0,0 +1,8 @@ +#!/bin/bash + +set -eu + +echo "bump-ccs-tag" + +latest_release_tag=$(cat fetch-spring-latest-rel/tag) +sed -i "s/config_server_release_tag:.*/config_server_release_tag: ${latest_release_tag}/" git/cf/broker_config.yml diff --git a/ci/scripts/deploy-testflight b/ci/scripts/deploy-testflight index 15a2f72..5f0eec1 100755 --- a/ci/scripts/deploy-testflight +++ b/ci/scripts/deploy-testflight @@ -6,6 +6,17 @@ echo "deploy-testflight" cf login -a ${CF_API_URL} --skip-ssl-validation -u ${CF_USERNAME} -p ${CF_PASSWORD} -o ${CF_ORG} -s ${CF_SPACE} +apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64 +apt-get install software-properties-common -y +apt-get update -y +add-apt-repository ppa:rmescandon/yq -y +apt update -y +apt install yq -y + +latest_release_tag=$(cat fetch-spring-latest-rel/tag) +echo $latest_release_tag +yq w git/cf/broker_config.yml config_server_release_tag $latest_release_tag + pushd git app_name=testflight-config-server-broker diff --git a/ci/settings.yml b/ci/settings.yml index 5524dbd..68db18d 100644 --- a/ci/settings.yml +++ b/ci/settings.yml @@ -14,7 +14,14 @@ meta: github: owner: starkandwayne repo: config-server-broker - branch: master + branch: update-release-tag + private_key: ((github.private-key)) + access_token: ((github.access-token)) + + spring-github: + owner: starkandwayne + repo: spring-cloud-config-server + branch: ci private_key: ((github.private-key)) access_token: ((github.access-token))