Skip to content

Commit

Permalink
No longer need to update base.go via rev_version_base().
Browse files Browse the repository at this point in the history
  • Loading branch information
david-mcmahon committed Nov 9, 2017
1 parent 98b3ff5 commit 3112075
Showing 1 changed file with 0 additions and 51 deletions.
51 changes: 0 additions & 51 deletions anago
Original file line number Diff line number Diff line change
Expand Up @@ -377,52 +377,6 @@ rev_openapi_versions () {
fi
}

###############################################################################
# Updates pkg/version/base.go files with RELEASE_VERSION
#
# Note: the only reason we update these files is so that the source archives
# exported by GitHub contain a valid version. Normally the version information
# is filled in at build time using git metadata (including the tag), but no
# such metadata is included in the source archives, so we must commit it into
# the tree before tagging the release.
#
# Uses the RELEASE_VERSION global dict
# @param label - label index to RELEASE_VERSION
rev_version_base () {
local label=$1
local version_file="pkg/version/base.go"
local staging_file="staging/src/k8s.io/client-go/$version_file"
local minor_plus
local gitmajor
local gitminor

logecho "Updating $version_file to ${RELEASE_VERSION[$label]}..."

if [[ ${RELEASE_VERSION[$label]} =~ ${VER_REGEX[release]} ]]; then
gitmajor=${BASH_REMATCH[1]}
gitminor=${BASH_REMATCH[2]}
fi

[[ "$label" =~ ^beta || "$label" =~ ^rc ]] && minor_plus="+"

sed -i -e "s/\(gitMajor *string = \)\"[^\"]*\"/\1\"$gitmajor\"/g" \
-e "s/\(gitMinor *string = \)\"[^\"]*\"/\1\"$gitminor$minor_plus\"/g" \
-e "s/\(gitVersion *string = \)\"[^\"]*\"/\1\"${RELEASE_VERSION[$label]}+\$Format:%h\$\"/g" $version_file

logecho -n "Formatting $version_file: "
logrun -s gofmt -s -w $version_file
logrun git add $version_file
if [[ -f $staging_file ]]; then
logrun cp $version_file $staging_file
logrun git add $staging_file
fi

logecho -n "Committing versioned files: "
logrun -s git commit -am \
"Kubernetes version ${RELEASE_VERSION[$label]} file updates"
}


###############################################################################
# Update $CHANGELOG_FILE on master
generate_release_notes() {
Expand Down Expand Up @@ -555,11 +509,6 @@ prepare_tree () {
# Now set the current_branch we're on
current_branch=$(gitlib::current_branch)

# rev base.go
case $label in
beta*|rc|official) rev_version_base $label || return 1 ;;
esac

# if this is a new branch, rev openapi-spec version files
if [[ -n "$PARENT_BRANCH" ]]; then
# Only on master
Expand Down

0 comments on commit 3112075

Please sign in to comment.