Address issues in release scripts

- Merge in changes to branches
- Get rid of releaseall.sh -- it is too error prone right now
- Support for releasing pluginator
- Automatically release binaries for kustomize
This commit is contained in:
Phillip Wittrock
2019-12-16 16:30:08 -08:00
parent b38c0bc5c1
commit 60188ebe20
3 changed files with 28 additions and 31 deletions

View File

@@ -6,7 +6,7 @@
# kyaml version
export kyaml_major=0
export kyaml_minor=0
export kyaml_patch=1
export kyaml_patch=2
# kustomize api version
export api_major=0
@@ -16,14 +16,18 @@ export api_patch=0
# cmd/config version
export cmd_config_major=0
export cmd_config_minor=0
export cmd_config_patch=1
export cmd_config_patch=2
# cmd/kubectl version
export cmd_kubectl_major=0
export cmd_kubectl_minor=0
export cmd_kubectl_patch=1
export cmd_kubectl_patch=2
# kustomize version
export kustomize_major=3
export kustomize_minor=5
export kustomize_patch=1
export pluginator_major=2
export pluginator_minor=1
export pluginator_patch=0

View File

@@ -1,21 +0,0 @@
#!/bin/bash
# Copyright 2019 The Kubernetes Authors.
# SPDX-License-Identifier: Apache-2.0
set -e
# fetch upstream once
git fetch upstream
export FETCH="false"
# release modules without binaries
for module in "kyaml api cmd/config cmd/kubectl"
do
releasing/releasemodule.sh $module
done
# release modules with binaries
for binary in "kustomize"
do
BINARY=true releasing/releasemodule.sh $binary
done

View File

@@ -4,11 +4,8 @@
# run this script with releasing/releasemodule.sh MODULE
# -- e.g. releasing/releasemodule.sh cmd/config
# to push the latest tag to release a binary, run with BINARY=true
# -- e.g. BINARY=true releasing/releasemodule.sh kustomize
# to skip fetch from upstream, run with FETCH=false
# -- e.g. FETCH=false releasing/releasemodule.sh kyaml
# for a list of modules see releasing/releaseallmodules.sh
set -e
# perform release for a module
@@ -28,11 +25,14 @@ function releaseModule {
# create a temporary workspace for our work
wktree=$(mktemp -d /tmp/kustomize-releases-XXXXXX)
git branch -f $branch upstream/master # always release from master
git branch $branch upstream/$branch
git worktree add $wktree $branch # create a separate worktree for the branch
pushd .
cd $wktree/$module # cd into the worktree/module
# merge master changes into the release branch
git merge upstream/master
echo "dir: $wktree"
echo "module: $module v$major.$minor.$patch"
echo "branch: $branch"
@@ -81,8 +81,22 @@ function releaseBinary {
fi
}
modules="kyaml api cmd/config cmd/kubectl pluginator kustomize"
# configure the branch and tag names
module="${1?must provide the module to release as an argument}"
module="${1?must provide the module to release as an argument: supported modules [$modules]}"
# verify the module
found=false
for m in $modules; do
if [ "$m" == "$module" ]; then
found=true
fi
done
if [ "$found" != "true" ]; then
echo "unknown module \"$module\", must be one of: [$modules]"
exit 1
fi
# get the release versions
source releasing/VERSIONS
@@ -98,7 +112,7 @@ fi
# release the module
releaseModule $module
# release the binary
if [ "$BINARY" == "true" ]; then
# release the kustomize binary if the module is kustomize
if [ "$module" == "kustomize" ]; then
releaseBinary $module
fi