Skip to content
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

Update the release script #722

Merged
merged 1 commit into from Jul 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
49 changes: 46 additions & 3 deletions script/release.sh
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.

# Constants. Enter relevant repo information here.
UPSTREAM_REPO="kubernetes-incubator"
UPSTREAM_REPO="kubernetes"
CLI="kompose"
GITPATH="$GOPATH/src/github.com/kubernetes/kompose"

Expand Down Expand Up @@ -97,8 +97,11 @@ replaceversion() {
echo "Replaced version in README.md"
sed -i "s/$1/$2/g" README.md

echo "Replaced version in docs/setup.md"
sed -i "s/$1/$2/g" docs/setup.md
echo "Replaced version in docs/installation.md"
sed -i "s/$1/$2/g" docs/installation.md

echo "Replaced version in build/VERSION"
sed -i "s/$1/$2/g" build/VERSION
}

changelog() {
Expand Down Expand Up @@ -159,6 +162,42 @@ git_tag() {
git tag v$1
}

generate_install_guide() {
echo "
# Installation

__Linux and macOS:__

\`\`\`sh
# Linux
curl -L https://github.com/kubernetes/kompose/releases/download/v$1/kompose-linux-amd64 -o kompose

# macOS
curl -L https://github.com/kubernetes/kompose/releases/download/v$1/kompose-darwin-amd64 -o kompose

chmod +x kompose
sudo mv ./kompose /usr/local/bin/kompose
\`\`\`

__Windows:__

Download from [GitHub](https://github.com/kubernetes/kompose/releases/download/v$1/kompose-windows-amd64.exe) and add the binary to your PATH.

__Checksums:__

Filename | SHA256 Hash
-----------------------" > install_guide.txt

for f in bin/*
do
HASH=`sha256sum $f | head -n1 | awk '{print $1;}'`
echo "$f | $HASH" >> install_guide.txt
done

# Append the file to the file
cat install_guide.txt >> changes.txt
}

push() {
CHANGES=$(cat changes.txt)
# Release it!
Expand Down Expand Up @@ -248,6 +287,7 @@ main() {
"Create tag"
"Build binaries"
"Create tarballs"
"Generate install guide"
"Upload the binaries and push to GitHub release page"
"Clean"
"Quit")
Expand Down Expand Up @@ -282,6 +322,9 @@ main() {
"Create tarballs")
create_tarballs
;;
"Generate install guide")
generate_install_guide $VERSION
;;
"Upload the binaries and push to GitHub release page")
push $VERSION
;;
Expand Down