Skip to content

Commit

Permalink
release/v0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bourgeoisor committed Apr 6, 2023
1 parent 35adb9d commit 178cd91
Show file tree
Hide file tree
Showing 16 changed files with 1,774 additions and 986 deletions.
88 changes: 44 additions & 44 deletions docs/releasing/make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,67 +18,67 @@ set -euxo pipefail
# set env
REPO_PREFIX="${REPO_PREFIX:-us-central1-docker.pkg.dev/bank-of-anthos-ci/bank-of-anthos}"
PROFILE="development"
RELEASE_DIR="kubernetes-manifests/"
RELEASE_DIR="kubernetes-manifests"

# move to repo root
SCRIPT_DIR=$(dirname $(realpath -s $0))
REPO_ROOT=$SCRIPT_DIR/../..
cd $REPO_ROOT

# validate version number (format: v0.0.0)
if [[ ! "${NEW_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "${NEW_VERSION} argument must conform to regex string: ^v[0-9]+\.[0-9]+\.[0-9]+$ "
echo "ex. v1.0.1"
exit 1
fi
# # validate version number (format: v0.0.0)
# if [[ ! "${NEW_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
# echo "${NEW_VERSION} argument must conform to regex string: ^v[0-9]+\.[0-9]+\.[0-9]+$ "
# echo "ex. v1.0.1"
# exit 1
# fi

# ensure there are no uncommitted changes
if [[ $(git status -s | wc -l) -gt 0 ]]; then
echo "error: can't have uncommitted changes"
exit 1
fi
# # ensure there are no uncommitted changes
# if [[ $(git status -s | wc -l) -gt 0 ]]; then
# echo "error: can't have uncommitted changes"
# exit 1
# fi

# ensure that gcloud is in the PATH
if ! command -v gcloud &> /dev/null
then
echo "gcloud could not be found"
exit 1
fi
# # ensure that gcloud is in the PATH
# if ! command -v gcloud &> /dev/null
# then
# echo "gcloud could not be found"
# exit 1
# fi

# clear out previous release content
rm -rf "${REPO_ROOT}/${RELEASE_DIR}"
mkdir "${REPO_ROOT}/${RELEASE_DIR}"
# # clear out previous release content
# rm -rf "${REPO_ROOT}/${RELEASE_DIR}"
# mkdir "${REPO_ROOT}/${RELEASE_DIR}"

# build and push release images
skaffold config set local-cluster false
skaffold build --file-output="artifacts.json" --profile "${PROFILE}" \
--default-repo="${REPO_PREFIX}" --tag="${NEW_VERSION}"
skaffold config unset local-cluster
# # build and push release images
# skaffold config set local-cluster false
# skaffold build --file-output="artifacts.json" --profile "${PROFILE}" \
# --default-repo="${REPO_PREFIX}" --tag="${NEW_VERSION}"
# skaffold config unset local-cluster

# render manifests
for service in "frontend contacts userservice balancereader ledgerwriter transactionhistory loadgenerator"; do
skaffold render --build-artifacts="artifacts.json" --profile "${PROFILE}" \
--module="${service}" > "${REPO_PREFIX}/${RELEASE_DIR}/${service}.yaml"
done
# # render manifests
# for service in frontend contacts userservice balancereader ledgerwriter transactionhistory loadgenerator; do
# skaffold render --build-artifacts="artifacts.json" --profile "${PROFILE}" \
# --module="${service}" > "${REPO_ROOT}/${RELEASE_DIR}/${service}.yaml"
# done

# update version in manifests
find "${REPO_ROOT}/${RELEASE_DIR}" -name '*.yaml' -exec sed -i -e "s'value: \"dev\"'value: \"${NEW_VERSION}\"'g" {} \;
rm "${REPO_ROOT}/${RELEASE_DIR}/*-e"
# # update version in manifests
# find "${REPO_ROOT}/${RELEASE_DIR}" -name '*.yaml' -exec sed -i -e "s'value: \"dev\"'value: \"${NEW_VERSION}\"'g" {} \;
# rm ${REPO_ROOT}/${RELEASE_DIR}/*-e

# update version in terraform scripts
sed -i -e "s@sync_branch = .*@sync_branch = \"${NEW_VERSION}\"@g" ${REPO_ROOT}/iac/tf-anthos-gke/terraform.tfvars
rm "${REPO_ROOT}/iac/tf-anthos-gke/terraform.tfvars-e"
# # update version in terraform scripts
# sed -i -e "s@sync_branch = .*@sync_branch = \"${NEW_VERSION}\"@g" ${REPO_ROOT}/iac/tf-anthos-gke/terraform.tfvars
# rm ${REPO_ROOT}/iac/tf-anthos-gke/terraform.tfvars-e

# create release branch and tag
git checkout -b "release/${NEW_VERSION}"
git add "${REPO_ROOT}/${RELEASE_DIR}/*.yaml"
git add "${REPO_ROOT}/iac/tf-anthos-gke/terraform.tfvars"
git commit -m "release/${NEW_VERSION}"
git tag "${NEW_VERSION}"
# git commit -m "release/${NEW_VERSION}"
# git tag "${NEW_VERSION}"

# push branch and tag upstream
git push --set-upstream origin "release/${NEW_VERSION}"
git push --tags
# # push branch and tag upstream
# git push --set-upstream origin "release/${NEW_VERSION}"
# git push --tags

# clean up
rm "${REPO_ROOT}/artifacts.json"
# # clean up
# rm "${REPO_ROOT}/artifacts.json"
17 changes: 12 additions & 5 deletions docs/releasing.md → docs/releasing/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,19 @@ This document describes how maintainers can tag and push a new release of Bank o

2. **Choose the logical [next release tag](https://github.com/GoogleCloudPlatform/bank-of-anthos/releases)**, using [semantic versioning](https://semver.org/): `vX.Y.Z`. If this release includes significant feature changes, update the minor version (`Y`). Otherwise, for bug-fix releases or standard quarterly release, update the patch version `Z`).

## Tag the new release
3. Ensure that the following commands are in your `PATH`:
- `realpath` (found in the `coreutils` package)
- `skaffold`
- `gcloud`

Make sure that the following commands are in your `PATH`:
- `realpath` (found in the `coreutils` package)
- `skaffold`
- `gcloud`
4. Make sure that your `gcloud` is authenticated:

```sh
gcloud auth login
gcloud auth configure-docker us-central1-docker.pkg.dev
```

## Create and tag the new release

Run the `make-release.sh` script found inside the `docs/releasing` directory:

Expand Down
2 changes: 1 addition & 1 deletion iac/tf-anthos-gke/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ region = "us-central1"
zone = "us-central1-b"
cluster_name = "anthos-sample-cluster1"
sync_repo = "https://github.com/GoogleCloudPlatform/bank-of-anthos"
sync_branch = "v0.5.11"
sync_branch = "v0.6.0"
sync_rev = ""
policy_dir = "/kubernetes-manifests"
91 changes: 0 additions & 91 deletions kubernetes-manifests/accounts-db.yaml

This file was deleted.

130 changes: 0 additions & 130 deletions kubernetes-manifests/balance-reader.yaml

This file was deleted.

Loading

0 comments on commit 178cd91

Please sign in to comment.