-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
250 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -o pipefail | ||
|
||
custom_notes=$(pwd)/bucc/ci/release_notes.md | ||
notes=$(pwd)/release-notes/notes.md | ||
|
||
touch ${custom_notes} | ||
cp ${custom_notes} ${notes} | ||
|
||
curl -L >$(which bosh2) https://s3.amazonaws.com/bosh-cli-artifacts/bosh-cli-2.0.10-linux-amd64 && chmod 755 $(which bosh2) | ||
|
||
get_releases() { | ||
mkdir -p state | ||
echo "virtualbox" > state/cpi | ||
echo "foo: bar" > vars.yml | ||
ops=$(find ops/cpis/*/*.yml | grep -v 'virtualbox\|google' | sed 's/^/-o /' | xargs) | ||
spruce json <(echo "releases:"; ./bin/bucc int ${ops} --path /releases) | jq -c -r -M '.releases[]' | ||
} | ||
|
||
get_stemcell_version() { | ||
mkdir -p state | ||
echo "virtualbox" > state/cpi | ||
echo "foo: bar" > vars.yml | ||
spruce json <(echo "releases:"; ./bin/bucc int --path /releases) | jq '.releases[0].url' \ | ||
| tr '-' '\n' | grep trusty -A 1 | tail -1 | ||
} | ||
|
||
get_release_url() { | ||
# sort results to prefere cloudfoundry over cloudfoundry-{incubator,community} | ||
local path=$(curl -s bosh.io/releases/ | grep '<a href="/releases/' | cut -d'"' -f2 | cut -d'?' -f1 | grep "/${1}$\|/${1}-release$\|/${1}-boshrelease$" | sort -n | tail -n 1) | ||
|
||
if [ ! -z "${path}" ]; then | ||
echo "https://bosh.io${path}?version=${2}" | ||
fi | ||
} | ||
|
||
pushd bucc-stable > /dev/null | ||
stable_releases=$(get_releases) | ||
stable_stemcell=$(get_stemcell_version) | ||
popd > /dev/null | ||
|
||
pushd bucc > /dev/null | ||
new_releases=$(get_releases) | ||
new_stemcell=$(get_stemcell_version) | ||
popd > /dev/null | ||
|
||
notes_releases="" | ||
for release in $(echo ${new_releases} | jq -c '.'); do | ||
name=$(echo ${release} | jq -r '.name') | ||
version=$(echo ${release} | jq -r '.version') | ||
stable_version=$(echo ${stable_releases} | jq -s -r --arg name "${name}" '.[] | select(.name == $name).version') | ||
|
||
release_url=$(get_release_url ${name} ${version}) | ||
if [ ! -z "${release_url}" ]; then | ||
notes_releases+="| ${name} | [${version}](${release_url}) |" | ||
else | ||
notes_releases+="| ${name} | ${version} |" | ||
fi | ||
|
||
if [[ "${version}" != "${stable_version}" ]]; then | ||
notes_releases+=" yes |\n" | ||
else | ||
notes_releases+=" no |\n" | ||
fi | ||
done | ||
|
||
if [ ! -z "${notes_releases}" ]; then | ||
echo "## Release updates:" >> ${notes} | ||
echo "| Name | Version | Changed |" >> ${notes} | ||
echo "| ---- | ------- | ------- |" >> ${notes} | ||
echo -e "${notes_releases}" >> ${notes} | ||
fi | ||
|
||
if [[ ${stemcell} != ${new_stemcell} ]]; then | ||
echo "## Stemcell update:" >> ${notes} | ||
stemcell_url="https://github.com/cloudfoundry/bosh-linux-stemcell-builder/releases/tag/v${new_stemcell}" | ||
echo -e "Bumped to [${new_stemcell}](${stemcell_url})" >> ${notes} | ||
fi | ||
|
||
cat ${notes} | ||
|
Oops, something went wrong.