Changes for releasing 1.13 (#2070)
* Changes for releasing 1.13 - Changed release version in charts 1.13 - Made changes in release scripts and makefile Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Update helm chart maintainers Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
@@ -1,21 +1,17 @@
|
||||
#### Fission release
|
||||
# Fission release
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
## Prerequisites
|
||||
|
||||
1. Get a dockerhub account if you don't have one.
|
||||
1. Get access to:
|
||||
|
||||
Get access to:
|
||||
- The fission dockerhub account (https://hub.docker.com/r/fission/ if you have access, you will see Fission listed in your organizations: https://hub.docker.com/organizations/ )
|
||||
- Fission-charts repo (https://github.com/fission/fission-charts)
|
||||
- Fission Documentation Repo (https://github.com/fission/docs.fission.io)
|
||||
- Fission main repo (https://github.com/fission/fission)
|
||||
a. [The fission dockerhub account](https://hub.docker.com/r/fission/), if you have access, you will see Fission listed in [your organizations](https://hub.docker.com/organizations/)
|
||||
b. [Fission-charts repo](https://github.com/fission/fission-charts)
|
||||
c. [Fission Documentation Repo](https://github.com/fission/docs.fission.io)
|
||||
d. [Fission main repo](https://github.com/fission/fission)
|
||||
|
||||
2. Get a Github "personal access token":
|
||||
https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
|
||||
2. Get a Github [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)
|
||||
|
||||
Save the token to ~/.gh-access-token (make sure that the file is
|
||||
readable only by you)
|
||||
Save the token to ~/.github-token (make sure that the file is readable only by you)
|
||||
|
||||
3. Go toolchain set up.
|
||||
|
||||
@@ -23,28 +19,24 @@ Prerequisites
|
||||
|
||||
`docker login` with your own username; get this username added to
|
||||
the fission team on dockerhub.
|
||||
|
||||
4. Install changelog generator tool "github_changelog_generator": https://github.com/skywinder/github-changelog-generator
|
||||
|
||||
4. Install changelog generator tool [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)
|
||||
|
||||
5. Install realpath if you don't already have it : https://github.com/harto/realpath-osx (You can use the brew method on Mac)
|
||||
|
||||
6. Install gothub if you don't already have it : https://github.com/itchio/gothub
|
||||
You just have to go get github.com/itchio/gothub, that'll install gothub in $GOPATH/bin. Ensure this is already
|
||||
in $PATH env variable.
|
||||
6. Install [Github CLI](https://cli.github.com/)
|
||||
|
||||
|
||||
Check that the build is green!
|
||||
------------------------------
|
||||
## Check that the build is green
|
||||
|
||||
Fix the build if it is not green. DON'T proceed unless build is GREEN!
|
||||
|
||||
|
||||
Updating Fission Repo (https://github.com/fission/fission)
|
||||
------------------------------
|
||||
## Updating [Fission Repo](https://github.com/fission/fission)
|
||||
|
||||
1. cd to the top of the fission repo, create a branch:
|
||||
|
||||
```shell
|
||||
git checkout -b release-X.Y.Z
|
||||
```
|
||||
|
||||
2. Change references of old version to new version in charts directory. You use replace and find all with a quick preview in your IDE.
|
||||
|
||||
@@ -69,31 +61,30 @@ Updating Fission Repo (https://github.com/fission/fission)
|
||||
|
||||
8. Test build from master branch for sanity check and make sure the master build is green
|
||||
|
||||
Updating Fission Charts (https://github.com/fission/fission-charts)
|
||||
------------------------------
|
||||
## Updating [Fission Charts](https://github.com/fission/fission-charts)
|
||||
|
||||
a. Switch to fission/fission-charts repo and run `index.sh` in that repo. (Don't edit the index.yaml in this repo manually. index.sh generates it, using the helm repo CLI.)
|
||||
|
||||
b. You should have index.yaml and fission-core-*, fission-all-* charts as change, add, commit and push it to repo.
|
||||
|
||||
9. Go to Github Web UI --> Releases, here you will notice a pre-release for the version x.y.z you just created.
|
||||
1. Go to Github Web UI --> Releases, here you will notice a pre-release for the version x.y.z you just created.
|
||||
|
||||
Edit it and add links to:
|
||||
|
||||
* Install guide in docs
|
||||
* Changelog.md
|
||||
a. Install guide in docs
|
||||
b. Changelog.md
|
||||
|
||||
Before you save the release - UNCHECK the "This is a pre-release" checkbox. This mark the release as ready for consumption (If release is stable).
|
||||
|
||||
Updating Fission Docs (https://github.com/fission/docs.fission.io)
|
||||
------------------------------
|
||||
## Updating [Fission Docs](https://github.com/fission/docs.fission.io)
|
||||
|
||||
10. Documentation Update
|
||||
1. Documentation Update
|
||||
|
||||
a. Merge documentation PRs that are peer reviewed and get latest master locally.
|
||||
|
||||
b. In the repo fission/docs.fission.io change version in version.sh file to latest version (x.y.z) and run build.sh script
|
||||
|
||||
c. ** ONLY ** in the dist/x.y.z directory i.e. current version directory - replace all references from previous release to current release. Please use your IDE as there will be thousands of references.
|
||||
c. **ONLY** in the dist/x.y.z directory i.e. current version directory - replace all references from previous release to current release. Please use your IDE as there will be thousands of references.
|
||||
|
||||
d.VERIFY: There should be changes only in dist/x.y.z - where x.y.z is current version and in following files:
|
||||
|
||||
@@ -101,14 +92,6 @@ d.VERIFY: There should be changes only in dist/x.y.z - where x.y.z is current ve
|
||||
- dist/index.html
|
||||
- version.sh
|
||||
|
||||
## Announce the release
|
||||
|
||||
Announce the release
|
||||
--------------------
|
||||
|
||||
Announce the release on #contributors.
|
||||
|
||||
|
||||
Update Fission.io
|
||||
-----------------
|
||||
|
||||
Tell #marketing channel to update link
|
||||
Announce the release on Fission Slack and Twitter.
|
||||
@@ -1,219 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
#set -x
|
||||
|
||||
DIR=`realpath $(dirname $0)/../`
|
||||
BUILDDIR=$(realpath $DIR)/build
|
||||
|
||||
# Build CLI binaries for mac/linux/windows
|
||||
build_all_cli() {
|
||||
local version=$1
|
||||
local date=$2
|
||||
local gitcommit=$3
|
||||
|
||||
build_cli "linux" "linux" $version $date $gitcommit
|
||||
build_cli "darwin" "osx" $version $date $gitcommit
|
||||
build_cli "windows" "windows" $version $date $gitcommit
|
||||
}
|
||||
|
||||
# Build cli binary for one OS, and put it in $BUILDDIR/cli/<os>/
|
||||
build_cli() {
|
||||
os=$1
|
||||
osName=$2
|
||||
local version=$3
|
||||
local date=$4
|
||||
local gitcommit=$5
|
||||
arch="amd64" # parameterize if/when we need to
|
||||
|
||||
pushd $DIR/cmd/fission-cli
|
||||
|
||||
if [ "$osName" == "windows" ]
|
||||
then
|
||||
binary=fission-cli-${osName}.exe
|
||||
else
|
||||
binary=fission-cli-${osName}
|
||||
fi
|
||||
|
||||
GOOS=$os GOARCH=$arch go build -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH \
|
||||
-ldflags "-X github.com/fission/fission/pkg/info.GitCommit=$gitcommit -X github.com/fission/fission/pkg/info.BuildDate=$date -X github.com/fission/fission/pkg/info.Version=$version" -o $binary .
|
||||
|
||||
outdir=$BUILDDIR/cli/$osName/
|
||||
mkdir -p $outdir
|
||||
mv $binary $outdir
|
||||
|
||||
popd
|
||||
}
|
||||
|
||||
# Build fission-bundle image
|
||||
build_fission_bundle_image() {
|
||||
local version=$1
|
||||
local date=$2
|
||||
local gitcommit=$3
|
||||
|
||||
local tag=fission/fission-bundle:$version
|
||||
|
||||
docker build -t $tag -f $DIR/cmd/fission-bundle/Dockerfile.fission-bundle --build-arg GITCOMMIT=$gitcommit \
|
||||
--build-arg BUILDDATE=$date --build-arg BUILDVERSION=$version $DIR
|
||||
docker tag $tag fission/fission-bundle:latest
|
||||
}
|
||||
|
||||
build_fetcher_image() {
|
||||
local version=$1
|
||||
local date=$2
|
||||
local gitcommit=$3
|
||||
local tag=fission/fetcher:$version
|
||||
|
||||
docker build -t $tag -f $DIR/cmd/fetcher/Dockerfile.fission-fetcher --build-arg GITCOMMIT=$gitcommit \
|
||||
--build-arg BUILDDATE=$date --build-arg BUILDVERSION=$version $DIR
|
||||
docker tag $tag fission/fetcher:latest
|
||||
}
|
||||
|
||||
push_fetcher_image() {
|
||||
local version=$1
|
||||
local tag=fission/fetcher:$version
|
||||
}
|
||||
|
||||
build_builder_image() {
|
||||
local version=$1
|
||||
local date=$2
|
||||
local gitcommit=$3
|
||||
local tag=fission/builder:$version
|
||||
|
||||
docker build -t $tag -f $DIR/cmd/builder/Dockerfile.fission-builder --build-arg GITCOMMIT=$gitcommit \
|
||||
--build-arg BUILDDATE=$date --build-arg BUILDVERSION=$version $DIR
|
||||
docker tag $tag fission/builder:latest
|
||||
}
|
||||
|
||||
# Build reporter image
|
||||
build_reporter_image() {
|
||||
local version=$1
|
||||
local date=$2
|
||||
local gitcommit=$3
|
||||
|
||||
local tag=fission/reporter:$version
|
||||
|
||||
docker build -t $tag -f $DIR/cmd/reporter/Dockerfile.reporter \
|
||||
--build-arg GITCOMMIT=$gitcommit --build-arg BUILDDATE=$date --build-arg BUILDVERSION=$version $DIR
|
||||
docker tag $tag fission/reporter:latest
|
||||
}
|
||||
|
||||
# Build pre-upgrade-checks image
|
||||
build_pre_upgrade_checks_image() {
|
||||
local version=$1
|
||||
local date=$2
|
||||
local gitcommit=$3
|
||||
|
||||
local tag=fission/pre-upgrade-checks:$version
|
||||
|
||||
docker build -t $tag -f $DIR/cmd/preupgradechecks/Dockerfile.fission-preupgradechecks \
|
||||
--build-arg GITCOMMIT=$gitcommit --build-arg BUILDDATE=$date --build-arg BUILDVERSION=$version $DIR
|
||||
docker tag $tag fission/pre-upgrade-checks:latest
|
||||
}
|
||||
|
||||
build_charts() {
|
||||
local version=$1
|
||||
mkdir -p $BUILDDIR/charts
|
||||
pushd $DIR/charts
|
||||
find . -iname *.~?~ | xargs -r rm
|
||||
for c in fission-all fission-core
|
||||
do
|
||||
helm package -u $c/
|
||||
mv *.tgz $BUILDDIR/charts/
|
||||
done
|
||||
popd
|
||||
}
|
||||
|
||||
build_yamls() {
|
||||
local version=$1
|
||||
|
||||
mkdir -p ${BUILDDIR}/yamls
|
||||
pushd ${DIR}/charts
|
||||
find . -iname *.~?~ | xargs -r rm
|
||||
|
||||
releaseName=fission-$(echo ${version} | sed 's/\./-/g')
|
||||
|
||||
for c in fission-all fission-core
|
||||
do
|
||||
# fetch dependencies
|
||||
pushd ${c}
|
||||
helm dependency update
|
||||
popd
|
||||
|
||||
# for minikube and other environments that don't support LoadBalancer
|
||||
helm template ${c} -n ${releaseName} --namespace fission --set analytics=false,analyticsNonHelmInstall=true,serviceType=NodePort,routerServiceType=NodePort > ${c}-${version}-minikube.yaml
|
||||
# for environments that support LoadBalancer
|
||||
helm template ${c} -n ${releaseName} --namespace fission --set analytics=false,analyticsNonHelmInstall=true > ${c}-${version}.yaml
|
||||
# for OpenShift
|
||||
helm template ${c} -n ${releaseName} --namespace fission --set analytics=false,analyticsNonHelmInstall=true,logger.enableSecurityContext=true,prometheus.enabled=false > ${c}-${version}-openshift.yaml
|
||||
|
||||
# copy yaml files to build directory
|
||||
mv *.yaml ${BUILDDIR}/yamls/
|
||||
done
|
||||
|
||||
popd
|
||||
}
|
||||
|
||||
build_all() {
|
||||
local version=$1
|
||||
|
||||
if [ -z "$version" ]
|
||||
then
|
||||
echo "Version unspecified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local date=$2
|
||||
|
||||
if [ -z "$date" ]
|
||||
then
|
||||
echo "Build date unspecified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local gitcommit=$3
|
||||
|
||||
if [ -z "gitcommit" ]
|
||||
then
|
||||
echo "Git commit unspecified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -e $BUILDDIR ]
|
||||
then
|
||||
echo "Removing existing build dir ($BUILDDIR)."
|
||||
rm -rf $BUILDDIR
|
||||
fi
|
||||
|
||||
mkdir -p $BUILDDIR
|
||||
|
||||
# generate swagger (OpenApi 2.0) doc before building bundle image
|
||||
generate_swagger_doc
|
||||
|
||||
build_fission_bundle_image $version $date $gitcommit
|
||||
build_fetcher_image $version $date $gitcommit
|
||||
build_builder_image $version $date $gitcommit
|
||||
build_all_cli $version $date $gitcommit
|
||||
build_pre_upgrade_checks_image $version $date $gitcommit
|
||||
build_reporter_image $version $date $gitcommit
|
||||
|
||||
remove_generated_swagger_doc
|
||||
}
|
||||
|
||||
generate_swagger_doc() {
|
||||
pushd $DIR/pkg/apis/core/v1/tool
|
||||
./update-generated-swagger-docs.sh
|
||||
popd
|
||||
}
|
||||
|
||||
remove_generated_swagger_doc() {
|
||||
rm $DIR/pkg/apis/core/v1/types_swagger_doc_generated.go
|
||||
}
|
||||
|
||||
version=${VERSION}
|
||||
date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
gitcommit=$(git rev-parse HEAD)
|
||||
|
||||
build_all $version $date $gitcommit
|
||||
build_charts $version
|
||||
build_yamls $version
|
||||
+207
-234
@@ -6,214 +6,57 @@ set -e
|
||||
DIR=$(realpath $(dirname $0))/../
|
||||
BUILDDIR=$(realpath $DIR)/build
|
||||
|
||||
artifacts=()
|
||||
source $(realpath ${DIR}/test/init_tools.sh)
|
||||
|
||||
# Ensure we're on the master branch
|
||||
check_branch() {
|
||||
local version=$1
|
||||
curr_branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
if [ $curr_branch != "release-${version}" ]
|
||||
then
|
||||
if [ $curr_branch != "release-${version}" ]; then
|
||||
echo "Not on release-${version} branch."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Ensure working dir is clean
|
||||
check_clean() {
|
||||
if ! git diff-index --quiet HEAD --
|
||||
then
|
||||
check_clean() {
|
||||
if ! git diff-index --quiet HEAD --; then
|
||||
echo "Unclean tree"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Push fission-bundle image
|
||||
push_fission_bundle_image() {
|
||||
local version=$1
|
||||
local tag=fission/fission-bundle:$version
|
||||
docker push $tag
|
||||
}
|
||||
|
||||
push_fetcher_image() {
|
||||
local version=$1
|
||||
local tag=fission/fetcher:$version
|
||||
docker push $tag
|
||||
}
|
||||
|
||||
|
||||
push_builder_image() {
|
||||
local version=$1
|
||||
local tag=fission/builder:$version
|
||||
docker push $tag
|
||||
}
|
||||
|
||||
# Push pre-upgrade-checks image
|
||||
push_pre_upgrade_checks_image() {
|
||||
local version=$1
|
||||
local tag=fission/pre-upgrade-checks:$version
|
||||
docker push $tag
|
||||
}
|
||||
|
||||
push_all() {
|
||||
local version=$1
|
||||
push_fission_bundle_image $version
|
||||
push_fission_bundle_image latest
|
||||
|
||||
push_fetcher_image $version
|
||||
push_fetcher_image latest
|
||||
|
||||
push_builder_image $version
|
||||
push_builder_image latest
|
||||
|
||||
push_pre_upgrade_checks_image $version
|
||||
push_pre_upgrade_checks_image latest
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Build and push fission-bundle image
|
||||
push_multiarch_fission_bundle_image() {
|
||||
TAG=$1 make multiarch-bundle
|
||||
}
|
||||
|
||||
push_multiarch_fetcher_image() {
|
||||
TAG=$1 make multiarch-fetcher
|
||||
}
|
||||
|
||||
|
||||
push_builder_image() {
|
||||
TAG=$1 make multiarch-builder
|
||||
}
|
||||
|
||||
# Push pre-upgrade-checks image
|
||||
push_pre_upgrade_checks_image() {
|
||||
TAG=$1 make multiarch-preupgrade
|
||||
}
|
||||
|
||||
push_builder_image() {
|
||||
TAG=$1 make multiarch-reporter
|
||||
}
|
||||
|
||||
push_multiarch_all() {
|
||||
TAG=$version make image-multiarch
|
||||
TAG=latest make image-multiarch
|
||||
}
|
||||
|
||||
tag_and_release() {
|
||||
local version=$1
|
||||
local gittag=$version
|
||||
local prefix="v"
|
||||
local gopkgtag=${version/#/${prefix}}
|
||||
|
||||
if [[ ${version} == v* ]]; # if version starts with "v", don't append prefix.
|
||||
then
|
||||
gopkgtag=${version}
|
||||
fi
|
||||
|
||||
# tag the release
|
||||
git tag $gittag
|
||||
git tag -a $gopkgtag -m "Fission $gopkgtag"
|
||||
|
||||
# push tag
|
||||
git push origin $gittag
|
||||
git push origin $gopkgtag
|
||||
|
||||
# create gh release
|
||||
gothub release \
|
||||
--user fission \
|
||||
--repo fission \
|
||||
--tag $gittag \
|
||||
--name "$version" \
|
||||
--description "$version" \
|
||||
--pre-release
|
||||
}
|
||||
|
||||
attach_github_release_cli() {
|
||||
local version=$1
|
||||
local gittag=$version
|
||||
# cli
|
||||
echo "Uploading osx cli"
|
||||
gothub upload \
|
||||
--replace \
|
||||
--user fission \
|
||||
--repo fission \
|
||||
--tag $gittag \
|
||||
--name fission-cli-osx \
|
||||
--file $BUILDDIR/cli/osx/fission-cli-osx
|
||||
|
||||
echo "Uploading linux cli"
|
||||
gothub upload \
|
||||
--replace \
|
||||
--user fission \
|
||||
--repo fission \
|
||||
--tag $gittag \
|
||||
--name fission-cli-linux \
|
||||
--file $BUILDDIR/cli/linux/fission-cli-linux
|
||||
|
||||
echo "Uploading windows cli"
|
||||
gothub upload \
|
||||
--replace \
|
||||
--user fission \
|
||||
--repo fission \
|
||||
--tag $gittag \
|
||||
--name fission-cli-windows.exe \
|
||||
--file $BUILDDIR/cli/windows/fission-cli-windows.exe
|
||||
echo "Artifact for osx amd64 cli"
|
||||
artifacts+=("$BUILDDIR/darwin/amd64/$version/fission#fission-cli-osx")
|
||||
echo "Artifact for windows amd64 cli"
|
||||
artifacts+=("$BUILDDIR/windows/amd64/$version/fission.exe#fission-cli-windows.exe")
|
||||
echo "Artifact for linux amd64 cli"
|
||||
artifacts+=("$BUILDDIR/linux/amd64/$version/fission#fission-cli-linux")
|
||||
echo "Artifact for linux arm cli"
|
||||
artifacts+=("$BUILDDIR/linux/arm/$version/fission#fission-cli-linux-arm")
|
||||
echo "Artifact for linux arm64 cli"
|
||||
artifacts+=("$BUILDDIR/linux/arm64/$version/fission#fission-cli-linux-arm64")
|
||||
}
|
||||
|
||||
attach_github_release_charts() {
|
||||
local version=$1
|
||||
local gittag=$version
|
||||
|
||||
# helm charts
|
||||
gothub upload \
|
||||
--replace \
|
||||
--user fission \
|
||||
--repo fission \
|
||||
--tag $gittag \
|
||||
--name fission-all-$version.tgz \
|
||||
--file $BUILDDIR/charts/fission-all-$version.tgz
|
||||
|
||||
gothub upload \
|
||||
--replace \
|
||||
--user fission \
|
||||
--repo fission \
|
||||
--tag $gittag \
|
||||
--name fission-core-$version.tgz \
|
||||
--file $BUILDDIR/charts/fission-core-$version.tgz
|
||||
|
||||
echo "fission-all chart"
|
||||
artifacts+=("$BUILDDIR/charts/fission-all-$version.tgz#fission-all-$version.tgz")
|
||||
echo "Fission-core chart"
|
||||
artifacts+=("$BUILDDIR/charts/fission-core-$version.tgz#fission-core-$version.tgz")
|
||||
}
|
||||
|
||||
attach_github_release_yamls() {
|
||||
local version=$1
|
||||
local gittag=$version
|
||||
|
||||
for c in fission-all fission-core
|
||||
do
|
||||
for c in fission-all fission-core; do
|
||||
# YAML
|
||||
gothub upload \
|
||||
--replace \
|
||||
--user fission \
|
||||
--repo fission \
|
||||
--tag $gittag \
|
||||
--name ${c}-${version}-minikube.yaml \
|
||||
--file $BUILDDIR/yamls/${c}-${version}-minikube.yaml
|
||||
|
||||
gothub upload \
|
||||
--replace \
|
||||
--user fission \
|
||||
--repo fission \
|
||||
--tag $gittag \
|
||||
--name ${c}-${version}.yaml \
|
||||
--file $BUILDDIR/yamls/${c}-${version}.yaml
|
||||
|
||||
gothub upload \
|
||||
--replace \
|
||||
--user fission \
|
||||
--repo fission \
|
||||
--tag $gittag \
|
||||
--name ${c}-${version}-openshift.yaml \
|
||||
--file $BUILDDIR/yamls/${c}-${version}-openshift.yaml
|
||||
artifacts+=("$BUILDDIR/yamls/${c}-${version}-minikube.yaml#${c}-${version}-minikube.yaml")
|
||||
artifacts+=("$BUILDDIR/yamls/${c}-${version}.yaml#${c}-${version}.yaml")
|
||||
artifacts+=("$BUILDDIR/yamls/${c}-${version}-openshift.yaml#${c}-${version}-openshift.yaml")
|
||||
done
|
||||
}
|
||||
|
||||
@@ -228,102 +71,232 @@ update_github_charts_repo() {
|
||||
popd
|
||||
}
|
||||
|
||||
tag_and_release() {
|
||||
local version=$1
|
||||
local gittag=$version
|
||||
local prefix="v"
|
||||
local gopkgtag=${version/#/${prefix}}
|
||||
|
||||
if [[ ${version} == v* ]]; then # if version starts with "v", don't append prefix.
|
||||
gopkgtag=${version}
|
||||
fi
|
||||
|
||||
# tag the release
|
||||
git tag $gittag
|
||||
git tag -a $gopkgtag -m "Fission $gopkgtag"
|
||||
|
||||
# push tag
|
||||
git push origin $gittag
|
||||
git push origin $gopkgtag
|
||||
|
||||
relnotes="
|
||||
Install Guide: https://docs.fission.io/installation/
|
||||
Full Changelog: https://github.com/fission/fission/blob/master/CHANGELOG.md
|
||||
"
|
||||
gh release create $gittag --prerelease --title $gittag --notes $relnotes --target $gitcommit ${artifacts[@]}
|
||||
}
|
||||
|
||||
generate_changelog() {
|
||||
local version=$1
|
||||
|
||||
echo "# ${version}" > new_CHANGELOG.md
|
||||
echo "# ${version}" >new_CHANGELOG.md
|
||||
echo
|
||||
echo "[Documentation](https://docs.fission.io/)" >> new_CHANGELOG.md
|
||||
echo "[Documentation](https://docs.fission.io/)" >>new_CHANGELOG.md
|
||||
echo
|
||||
|
||||
create_downloads_table ${version} >> new_CHANGELOG.md
|
||||
create_downloads_table ${version} >>new_CHANGELOG.md
|
||||
|
||||
# generate changelog from github
|
||||
github_changelog_generator -u fission -p fission -t ${GITHUB_TOKEN} --future-release ${version} --no-issues -o tmp_CHANGELOG.md
|
||||
sed -i '$ d' tmp_CHANGELOG.md
|
||||
|
||||
# concatenate two files
|
||||
cat tmp_CHANGELOG.md >> new_CHANGELOG.md
|
||||
cat tmp_CHANGELOG.md >>new_CHANGELOG.md
|
||||
mv new_CHANGELOG.md ${DIR}/CHANGELOG.md
|
||||
|
||||
rm tmp_CHANGELOG.md
|
||||
}
|
||||
|
||||
create_downloads_table () {
|
||||
local release_tag=$1
|
||||
local url_prefix="https://github.com/fission/fission/releases/download"
|
||||
create_downloads_table() {
|
||||
local release_tag=$1
|
||||
local url_prefix="https://github.com/fission/fission/releases/download"
|
||||
|
||||
echo "## Downloads for ${version}"
|
||||
echo
|
||||
echo "## Downloads for ${version}"
|
||||
echo
|
||||
|
||||
local files=$(find build -name '*' -type f)
|
||||
local files=$(find build -name '*' -type f)
|
||||
|
||||
echo
|
||||
echo "filename | sha256 hash"
|
||||
echo "-------- | -----------"
|
||||
for file in $files; do
|
||||
echo "[${file##*/}]($url_prefix/$release_tag/${file##*/}) | \`$(shasum -a 256 $file | cut -d' ' -f 1)\`"
|
||||
done
|
||||
echo
|
||||
echo
|
||||
echo "filename | sha256 hash"
|
||||
echo "-------- | -----------"
|
||||
for file in ${artifacts[@]}; do
|
||||
filepath=$(echo $file | cut -d'#' -f 1)
|
||||
filename=$(echo $file | cut -d'#' -f 2)
|
||||
echo "[${filename}]($url_prefix/$release_tag/${filename}) | \`$(shasum -a 256 ${filepath} | cut -d' ' -f 1)\`"
|
||||
done
|
||||
echo
|
||||
}
|
||||
export -f create_downloads_table
|
||||
|
||||
release_environment_check() {
|
||||
local version=$1
|
||||
local chartsrepo=$2
|
||||
local version=$1
|
||||
local chartsrepo=$2
|
||||
|
||||
check_branch $version
|
||||
check_clean
|
||||
check_branch $version
|
||||
check_clean
|
||||
|
||||
if [ ! -f $HOME/.gh-access-token ]
|
||||
then
|
||||
echo "Error finding github access token at ${HOME}/.gh-access-token."
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f $HOME/.github-token ]; then
|
||||
echo "Error finding github access token at ${HOME}/.github-token"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d $chartsrepo ]
|
||||
then
|
||||
echo "Error finding chart repo at $GOPATH/src/github.com/fission/fission-charts"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -d $chartsrepo ]; then
|
||||
echo "Error finding chart repo at $chartsrepo"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d $FISSION_HOME ]
|
||||
then
|
||||
echo "The FISSION_HOME variable should be set to directory where Fission and fission-charts are checked out"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -d $FISSION_HOME ]; then
|
||||
echo "The FISSION_HOME variable should be set to directory where Fission and fission-charts are checked out"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
export GITHUB_TOKEN=$(cat ~/.gh-access-token)
|
||||
build_charts() {
|
||||
local version=$1
|
||||
mkdir -p $BUILDDIR/charts
|
||||
pushd $DIR/charts
|
||||
find . -iname *.~?~ | xargs -r rm
|
||||
for c in fission-all fission-core; do
|
||||
helm package -u $c/
|
||||
mv *.tgz $BUILDDIR/charts/
|
||||
done
|
||||
popd
|
||||
}
|
||||
|
||||
build_yamls() {
|
||||
local version=$1
|
||||
|
||||
mkdir -p ${BUILDDIR}/yamls
|
||||
pushd ${DIR}/charts
|
||||
find . -iname *.~?~ | xargs -r rm
|
||||
|
||||
releaseName=fission-$(echo ${version} | sed 's/\./-/g')
|
||||
|
||||
for c in fission-all fission-core; do
|
||||
# fetch dependencies
|
||||
pushd ${c}
|
||||
helm dependency update
|
||||
popd
|
||||
|
||||
# for minikube and other environments that don't support LoadBalancer
|
||||
helm template ${c} -n ${releaseName} --namespace fission --set analytics=false,analyticsNonHelmInstall=true,serviceType=NodePort,routerServiceType=NodePort >${c}-${version}-minikube.yaml
|
||||
# for environments that support LoadBalancer
|
||||
helm template ${c} -n ${releaseName} --namespace fission --set analytics=false,analyticsNonHelmInstall=true >${c}-${version}.yaml
|
||||
# for OpenShift
|
||||
helm template ${c} -n ${releaseName} --namespace fission --set analytics=false,analyticsNonHelmInstall=true,logger.enableSecurityContext=true,prometheus.enabled=false >${c}-${version}-openshift.yaml
|
||||
|
||||
# copy yaml files to build directory
|
||||
mv *.yaml ${BUILDDIR}/yamls/
|
||||
done
|
||||
|
||||
popd
|
||||
}
|
||||
|
||||
build_all() {
|
||||
local version=$1
|
||||
|
||||
if [ -z "$version" ]; then
|
||||
echo "Version unspecified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local date=$2
|
||||
|
||||
if [ -z "$date" ]; then
|
||||
echo "Build date unspecified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local gitcommit=$3
|
||||
|
||||
if [ -z "gitcommit" ]; then
|
||||
echo "Git commit unspecified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -e $BUILDDIR ]; then
|
||||
echo "Removing existing build dir ($BUILDDIR)."
|
||||
rm -rf $BUILDDIR
|
||||
fi
|
||||
|
||||
mkdir -p $BUILDDIR
|
||||
|
||||
# generate swagger (OpenApi 2.0) doc before building bundle image
|
||||
VERSION=$version TIMESTAMP=$date COMMITSHA=$gitcommit make generate-swagger-doc
|
||||
|
||||
# Build CLI for all platforms
|
||||
VERSION=$version TIMESTAMP=$date COMMITSHA=$gitcommit make all-fission-cli
|
||||
}
|
||||
|
||||
build_images() {
|
||||
local version=$1
|
||||
if [ -z "$version" ]; then
|
||||
echo "Version unspecified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local date=$2
|
||||
if [ -z "$date" ]; then
|
||||
echo "Build date unspecified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local gitcommit=$3
|
||||
if [ -z "gitcommit" ]; then
|
||||
echo "Git commit unspecified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Build and push all images
|
||||
VERSION=$version TAG=$version TIMESTAMP=$date COMMITSHA=$gitcommit make all-images
|
||||
VERSION=$version TAG=latest TIMESTAMP=$date COMMITSHA=$gitcommit make all-images
|
||||
}
|
||||
|
||||
check_commands() {
|
||||
if ! command -v hub >/dev/null; then
|
||||
echo "Github CLI hub not found. Please get from https://cli.github.com/"
|
||||
fi
|
||||
}
|
||||
|
||||
export GITHUB_TOKEN=$(cat ~/.github-token)
|
||||
|
||||
version=$1
|
||||
chartsrepo=$2
|
||||
|
||||
if [ -z $chartsrepo ]
|
||||
then
|
||||
chartsrepo="$DIR../fission-charts"
|
||||
if [ -z $version ]; then
|
||||
echo "Release version not mentioned"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
gitcommit=$(git rev-parse HEAD)
|
||||
|
||||
chartsrepo=$2
|
||||
if [ -z $chartsrepo ]; then
|
||||
chartsrepo="$DIR../fission-charts"
|
||||
fi
|
||||
|
||||
check_commands
|
||||
release_environment_check $version $chartsrepo
|
||||
build_all $version $date $gitcommit
|
||||
# build_images $version $date $gitcommit
|
||||
build_charts $version
|
||||
build_yamls $version
|
||||
|
||||
# Build release-builder image
|
||||
#docker build -t fission-release-builder -f $FISSION_HOME/fission/hack/Dockerfile .
|
||||
|
||||
# Build all binaries & container images in docker
|
||||
# Here we mount docker.sock into container so that docker client can communicate with host docker daemon.
|
||||
# For more detail please visit https://docs.docker.com/machine/overview/
|
||||
docker run --rm -it -v $FISSION_HOME:/go/src/github.com/fission -v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-e VERSION=$version -w "/go/src/github.com/fission/fission/hack" fission-release-builder sh -c "./release-build.sh"
|
||||
|
||||
push_multiarch_all $version
|
||||
|
||||
tag_and_release $version
|
||||
attach_github_release_cli $version
|
||||
attach_github_release_charts $version
|
||||
attach_github_release_yamls $version
|
||||
update_github_charts_repo $version $chartsrepo
|
||||
|
||||
generate_changelog $version
|
||||
tag_and_release $version
|
||||
|
||||
echo "############ DONE #############"
|
||||
echo "Congratulation, ${version} is ready to ship !!"
|
||||
|
||||
Reference in New Issue
Block a user