diff options
author | Damien Martin-Guillerez <dmarting@google.com> | 2016-11-22 15:16:38 +0000 |
---|---|---|
committer | Dmitry Lomov <dslomov@google.com> | 2016-11-22 18:15:06 +0000 |
commit | 0edd35414dbe916457c5e98d7c08e1b4cfcf8d57 (patch) | |
tree | 3ca939b679093ccaecc19c57382325c8c3fd516f /scripts/release | |
parent | a79581e7a0f9f99c2985d3e5876fee72bc982637 (diff) |
Release script: add release notes to the git notes
This is a first change to get rid of the release commit on release branch.
Doing so will 1/ allows for git workflow (git cherry-pick), 2/ allows to
use merge feature from git notes.
--
Change-Id: Id6a93f0dc70b9efe8ff705f1dd2a16489989f281
Reviewed-on: https://cr.bazel.build/7337
MOS_MIGRATED_REVID=139904935
Diffstat (limited to 'scripts/release')
-rwxr-xr-x | scripts/release/common.sh | 5 | ||||
-rwxr-xr-x | scripts/release/release.sh | 4 | ||||
-rwxr-xr-x | scripts/release/release_test.sh | 2 | ||||
-rwxr-xr-x | scripts/release/relnotes.sh | 4 |
4 files changed, 13 insertions, 2 deletions
diff --git a/scripts/release/common.sh b/scripts/release/common.sh index 20925febe3..e17cedc183 100755 --- a/scripts/release/common.sh +++ b/scripts/release/common.sh @@ -49,6 +49,11 @@ function get_release_name() { git notes --ref=release show "$@" 2>/dev/null | xargs echo || true } +# Extract the release notes from the git notes +function get_release_notes() { + git notes --ref=release-notes show "$@" 2>/dev/null || true +} + # Returns the info from the branch of the release. It is the current branch # but it errors out if the current branch is not a release branch. This # method returns the tag of the release and the number of the current diff --git a/scripts/release/release.sh b/scripts/release/release.sh index b9a0f4bcbd..2dbb35fe29 100755 --- a/scripts/release/release.sh +++ b/scripts/release/release.sh @@ -213,6 +213,8 @@ function create_release() { create_release_commit "${release_title}" "${release_name}" \ "${relnotes}" "${tmpfile}" "${baseline}" $@ release_name=$(set_release_name "${release_name}" "${rc}") + # Add the release notes + git notes --ref=release-notes add -f -m "${relnotes}" git checkout ${origin_branch} &> /dev/null echo "Created ${release_name} on branch ${branch_name}." @@ -228,6 +230,7 @@ function push_release_candidate() { git push -f ${repo} +${branch} git push -f ${repo} +refs/notes/release git push -f ${repo} +refs/notes/release-candidate + git push -f ${repo} +refs/notes/release-notes done } @@ -282,6 +285,7 @@ function do_release() { git push $i +refs/tags/${tag_name} git push $i +refs/notes/release-candidate git push $i +refs/notes/release + git push $i +refs/notes/release-notes done cleanup_branches ${tag_name} fi diff --git a/scripts/release/release_test.sh b/scripts/release/release_test.sh index 3b1d87004a..8eb6cbc1db 100755 --- a/scripts/release/release_test.sh +++ b/scripts/release/release_test.sh @@ -212,6 +212,7 @@ Cherry picks: ' assert_equals "${header}Test replacement" "$(cat ${TEST_log})" + assert_equals "Test replacement" "$(get_release_notes release-v1)" assert_equals 1 "$(get_release_candidate release-v1)" push v1 @@ -233,6 +234,7 @@ Cherry picks: - Attribute error messages related to Android resources are easier to understand now.' assert_equals "${header}${RELNOTES}" "$(cat ${TEST_log})" + assert_equals "${RELNOTES}" "$(get_release_notes release-v1)" assert_equals 2 "$(get_release_candidate release-v1)" # Push the release diff --git a/scripts/release/relnotes.sh b/scripts/release/relnotes.sh index 221c9de4d2..b749028571 100755 --- a/scripts/release/relnotes.sh +++ b/scripts/release/relnotes.sh @@ -90,7 +90,7 @@ function extract_release_note() { # Build release notes arrays from a list of commits ($@) and return the release # note in an array of array. -function get_release_notes() { +function generate_release_notes() { for i in "${RELNOTES_TYPES[@]}"; do eval "RELNOTES_${i}=()" done @@ -123,7 +123,7 @@ function release_notes() { local i local commits=$(get_release_notes_commits $@) local length="${#RELNOTES_TYPES[@]}" - get_release_notes "$commits" + generate_release_notes "$commits" for (( i=0; $i < $length; i=$i+1 )); do local relnotes_title="${RELNOTES_DESC[$i]}" local relnotes_type=${RELNOTES_TYPES[$i]} |