mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 09:24:23 +00:00
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:
@@ -6,7 +6,7 @@
|
|||||||
# kyaml version
|
# kyaml version
|
||||||
export kyaml_major=0
|
export kyaml_major=0
|
||||||
export kyaml_minor=0
|
export kyaml_minor=0
|
||||||
export kyaml_patch=1
|
export kyaml_patch=2
|
||||||
|
|
||||||
# kustomize api version
|
# kustomize api version
|
||||||
export api_major=0
|
export api_major=0
|
||||||
@@ -16,14 +16,18 @@ export api_patch=0
|
|||||||
# cmd/config version
|
# cmd/config version
|
||||||
export cmd_config_major=0
|
export cmd_config_major=0
|
||||||
export cmd_config_minor=0
|
export cmd_config_minor=0
|
||||||
export cmd_config_patch=1
|
export cmd_config_patch=2
|
||||||
|
|
||||||
# cmd/kubectl version
|
# cmd/kubectl version
|
||||||
export cmd_kubectl_major=0
|
export cmd_kubectl_major=0
|
||||||
export cmd_kubectl_minor=0
|
export cmd_kubectl_minor=0
|
||||||
export cmd_kubectl_patch=1
|
export cmd_kubectl_patch=2
|
||||||
|
|
||||||
# kustomize version
|
# kustomize version
|
||||||
export kustomize_major=3
|
export kustomize_major=3
|
||||||
export kustomize_minor=5
|
export kustomize_minor=5
|
||||||
export kustomize_patch=1
|
export kustomize_patch=1
|
||||||
|
|
||||||
|
export pluginator_major=2
|
||||||
|
export pluginator_minor=1
|
||||||
|
export pluginator_patch=0
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -4,11 +4,8 @@
|
|||||||
|
|
||||||
# run this script with releasing/releasemodule.sh MODULE
|
# run this script with releasing/releasemodule.sh MODULE
|
||||||
# -- e.g. releasing/releasemodule.sh cmd/config
|
# -- 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
|
# to skip fetch from upstream, run with FETCH=false
|
||||||
# -- e.g. FETCH=false releasing/releasemodule.sh kyaml
|
# -- e.g. FETCH=false releasing/releasemodule.sh kyaml
|
||||||
# for a list of modules see releasing/releaseallmodules.sh
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# perform release for a module
|
# perform release for a module
|
||||||
@@ -28,11 +25,14 @@ function releaseModule {
|
|||||||
|
|
||||||
# create a temporary workspace for our work
|
# create a temporary workspace for our work
|
||||||
wktree=$(mktemp -d /tmp/kustomize-releases-XXXXXX)
|
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
|
git worktree add $wktree $branch # create a separate worktree for the branch
|
||||||
pushd .
|
pushd .
|
||||||
cd $wktree/$module # cd into the worktree/module
|
cd $wktree/$module # cd into the worktree/module
|
||||||
|
|
||||||
|
# merge master changes into the release branch
|
||||||
|
git merge upstream/master
|
||||||
|
|
||||||
echo "dir: $wktree"
|
echo "dir: $wktree"
|
||||||
echo "module: $module v$major.$minor.$patch"
|
echo "module: $module v$major.$minor.$patch"
|
||||||
echo "branch: $branch"
|
echo "branch: $branch"
|
||||||
@@ -81,8 +81,22 @@ function releaseBinary {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
modules="kyaml api cmd/config cmd/kubectl pluginator kustomize"
|
||||||
|
|
||||||
# configure the branch and tag names
|
# 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
|
# get the release versions
|
||||||
source releasing/VERSIONS
|
source releasing/VERSIONS
|
||||||
@@ -98,7 +112,7 @@ fi
|
|||||||
# release the module
|
# release the module
|
||||||
releaseModule $module
|
releaseModule $module
|
||||||
|
|
||||||
# release the binary
|
# release the kustomize binary if the module is kustomize
|
||||||
if [ "$BINARY" == "true" ]; then
|
if [ "$module" == "kustomize" ]; then
|
||||||
releaseBinary $module
|
releaseBinary $module
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user