Skip to content

Only versionize docs on new branches. #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions anago
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,11 @@ generate_release_notes() {
# @param label - The label to process
prepare_tree () {
local label=$1
local label_common=$label
local tree_object="$RELEASE_BRANCH"
local branch_arg
local branch_point
local label_common=$label
local current_branch

# Check for tag first
if git rev-parse "${RELEASE_VERSION[$label]}" >/dev/null 2>&1; then
Expand Down Expand Up @@ -349,13 +350,19 @@ prepare_tree () {
logecho -n "Checking out $tree_object: "
logrun -s git checkout $branch_arg $tree_object $branch_point || return 1

# Now set the current_branch we're on
current_branch=$(gitlib::current_branch)

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

# versionize docs
if [[ "$PARENT_BRANCH" == master ]]; then
# versionize docs on new branches (from master) only
# If the entirety of this session is based on a branch from master
# (PARENT_BRANCH), and this iteration of prepare_tree() is operating on
# the NON-master branch itself, versionize the docs
if [[ "$PARENT_BRANCH" == master && "$current_branch" != "master" ]]; then
logecho -n "Versionizing docs for ${RELEASE_VERSION[$label]}: "
logrun -s $TREE_ROOT/build/versionize-docs.sh ${RELEASE_VERSION[$label]}
logecho -n "Committing: "
Expand All @@ -368,7 +375,7 @@ prepare_tree () {

# Tagging
commit_string="Kubernetes $label_common release ${RELEASE_VERSION[$label]}"
logecho -n "Tagging $commit_string on $(gitlib::current_branch): "
logecho -n "Tagging $commit_string on $current_branch: "
logrun -s git tag -a -m "$commit_string" "${RELEASE_VERSION[$label]}"
}

Expand Down