Automate homebrew tap repo update

Closes gh-24677
pull/25129/head
Madhura Bhave 4 years ago
parent a302238e21
commit b309980a59

@ -3,6 +3,7 @@ email-from: "ci@spring.io"
email-to: ["spring-boot-dev@pivotal.io"] email-to: ["spring-boot-dev@pivotal.io"]
github-repo: "https://github.com/spring-projects/spring-boot.git" github-repo: "https://github.com/spring-projects/spring-boot.git"
github-repo-name: "spring-projects/spring-boot" github-repo-name: "spring-projects/spring-boot"
homebrew-tap-repo: "https://github.com/spring-io/homebrew-tap.git"
docker-hub-organization: "springci" docker-hub-organization: "springci"
artifactory-server: "https://repo.spring.io" artifactory-server: "https://repo.spring.io"
branch: "2.3.x" branch: "2.3.x"

@ -73,6 +73,11 @@ anchors:
silent: true silent: true
icon_emoji: ":concourse:" icon_emoji: ":concourse:"
username: concourse-ci username: concourse-ci
homebrew-tap-repo-resource-source: &homebrew-tap-repo-resource-source
uri: ((homebrew-tap-repo))
username: ((github-username))
password: ((github-password))
branch: master
resource_types: resource_types:
- name: artifactory-resource - name: artifactory-resource
type: registry-image type: registry-image
@ -206,6 +211,11 @@ resources:
type: time type: time
icon: clock-outline icon: clock-outline
source: { interval: "24h" } source: { interval: "24h" }
- name: homebrew-tap-repo
type: git
icon: github
source:
<<: *homebrew-tap-repo-resource-source
jobs: jobs:
- name: build-ci-images - name: build-ci-images
plan: plan:
@ -614,11 +624,31 @@ jobs:
RELEASE_TYPE: RELEASE RELEASE_TYPE: RELEASE
BRANCH: ((branch)) BRANCH: ((branch))
LATEST_GA: false LATEST_GA: false
- name: update-homebrew-tap
serial: true
plan:
- get: ci-image
- get: git-repo
resource: homebrew-tap-repo
- get: artifactory-repo
passed: [sync-to-maven-central]
params:
download_artifacts: false
save_build_info: true
- task: update-homebrew-tap
image: ci-image
file: git-repo/ci/tasks/update-homebrew-tap.yml
params:
LATEST_GA: false
- put: git-repo
resource: homebrew-tap-repo
params:
repository: updated-repo
groups: groups:
- name: "builds" - name: "builds"
jobs: ["build", "jdk11-build", "jdk15-build", "windows-build"] jobs: ["build", "jdk11-build", "jdk15-build", "windows-build"]
- name: "releases" - name: "releases"
jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "sync-to-maven-central", "publish-to-sdkman"] jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "sync-to-maven-central", "publish-to-sdkman", "update-homebrew-tap"]
- name: "ci-images" - name: "ci-images"
jobs: ["build-ci-images", "detect-docker-updates", "detect-jdk-updates", "detect-ubuntu-image-updates"] jobs: ["build-ci-images", "detect-docker-updates", "detect-jdk-updates", "detect-ubuntu-image-updates"]
- name: "pull-requests" - name: "pull-requests"

@ -0,0 +1,20 @@
#!/bin/bash
set -e
version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' )
git clone git-repo updated-repo > /dev/null
if [[ $LATEST_GA = true ]]; then
pushd updated-repo > /dev/null
cd homebrew-tap
wget https://repo.spring.io/libs-release-local/org/springframework/boot/spring-boot-cli/${version}/spring-boot-cli-${version}-homebrew.rb
rm spring-boot.rb
mv spring-boot-cli-*.rb spring-boot.rb
git config user.name "Spring Buildmaster" > /dev/null
git config user.email "buildmaster@springframework.org" > /dev/null
git add spring-boot.rb > /dev/null
git commit -m "Upgrade to Spring Boot ${version}" > /dev/null
echo "DONE"
popd > /dev/null
fi

@ -0,0 +1,11 @@
---
platform: linux
inputs:
- name: git-repo
- name: artifactory-repo
outputs:
- name: updated-repo
params:
LATEST_GA:
run:
path: git-repo/ci/scripts/update-homebrew-tap.sh
Loading…
Cancel
Save