Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

Commit 67bea2f

Browse files
piyalibanerjeeJaskanwal Pawar
andcommitted
Release notes script also looks at DB migrations
- Concourse used to do this for us, but because of no longer having CCNG submoduled into this repo, easiest thing to do was to move the logic of determining what new migrations were added into this release notes script here [#173368867] Co-authored-by: Piyali Banerjee <pbanerjee@pivotal.io> Co-authored-by: Jaskanwal Pawar <jpawar@pivotal.io>
1 parent feba9f1 commit 67bea2f

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

scripts/generate_release_notes.sh

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,17 @@ pushd "${HOME}/workspace/git_repo_changelog" > /dev/null
2424

2525
pushd "${HOME}/workspace/capi-k8s-release" > /dev/null
2626
git checkout ${OLD_VERSION} 2>/dev/null
27-
old_ccng_image_digest="$(bosh int --path=/images/ccng values/images.yml)"
28-
old_ccng_sha="$(git log --grep="${old_ccng_image_digest}" | rg "cloud_controller_ng" -A1 | tail -n+2)"
27+
OLD_CCNG_IMAGE_DIGEST="$(bosh int --path=/images/ccng values/images.yml)"
28+
OLD_CCNG_SHA="$(git log --grep="${OLD_CCNG_IMAGE_DIGEST}" | rg "cloud_controller_ng" -A1 | tail -n+2)"
2929

3030
git checkout ${NEW_VERSION} 2>/dev/null
31-
new_ccng_image_digest="$(bosh int --path=/images/ccng values/images.yml)"
32-
new_ccng_sha="$(git log --grep="${new_ccng_image_digest}" | rg "cloud_controller_ng" -A1 | tail -n+2)"
31+
NEW_CCNG_IMAGE_DIGEST="$(bosh int --path=/images/ccng values/images.yml)"
32+
NEW_CCNG_SHA="$(git log --grep="${NEW_CCNG_IMAGE_DIGEST}" | rg "cloud_controller_ng" -A1 | tail -n+2)"
33+
popd > /dev/null
34+
35+
pushd "${HOME}/workspace/capi-release/src/cloud_controller_ng" > /dev/null
36+
git checkout ${NEW_CCNG_SHA} 2>/dev/null
37+
MIGRATIONS=($(git diff --diff-filter=A --name-only $OLD_CCNG_SHA db/migrations))
3338
popd > /dev/null
3439

3540
echo ""
@@ -38,6 +43,19 @@ pushd "${HOME}/workspace/git_repo_changelog" > /dev/null
3843
# NOTE: if you're not authorized properly, this could mask that (i.e. gave a valid tracker token
3944
# but don't have permissions on our project)
4045
bundle exec rake \
41-
"changelog[${HOME}/workspace/capi-release/src/cloud_controller_ng,${old_ccng_sha},${new_ccng_sha},]" \
46+
"changelog[${HOME}/workspace/capi-release/src/cloud_controller_ng,${OLD_CCNG_SHA},${NEW_CCNG_SHA},]" \
4247
2>/dev/null | tail -n+2 | sort | uniq | rg -v "failed to fetch story title"
48+
49+
echo ""
50+
echo "🚀 Generating database migrations list for cloud_controller_ng... 🚀" 1>&2
51+
MIGRATIONS_FORMATTED=()
52+
if [ ${#MIGRATIONS[@]} -eq '0' ]; then
53+
MIGRATIONS_FORMATTED+=("None")
54+
else
55+
for i in "${MIGRATIONS[@]}"
56+
do
57+
MIGRATIONS_FORMATTED+=("- [$(basename $i)](https://github.com/cloudfoundry/cloud_controller_ng/blob/$NEW_CCNG_SHA/$i)")
58+
done
59+
fi
60+
echo "${MIGRATIONS_FORMATTED[*]}"
4361
popd > /dev/null

0 commit comments

Comments
 (0)