From 43d7abdc08ea2fd27930a8d9ad1ffeac2e968917 Mon Sep 17 00:00:00 2001 From: Cyril TOVENA Date: Sat, 8 Sep 2018 00:37:42 -0400 Subject: [PATCH] add push to do-release target and update documentation --- build/Makefile | 28 ++++++++++++++++++++++ docs/governance/templates/release.md | 7 ++++++ docs/governance/templates/release_issue.md | 3 ++- install/helm/README.md | 18 ++++++-------- 4 files changed, 44 insertions(+), 12 deletions(-) diff --git a/build/Makefile b/build/Makefile index 7b8d733ce0..62506d71f5 100644 --- a/build/Makefile +++ b/build/Makefile @@ -43,6 +43,7 @@ KUBECONFIG ?= ~/.kube/config # The (gcloud) test cluster that is being worked against GCP_CLUSTER_NAME ?= test-cluster GCP_CLUSTER_ZONE ?= us-west1-c +GCP_BUCKET_CHARTS ?= agones-chart # the profile to use when developing on minikube MINIKUBE_PROFILE ?= agones @@ -108,6 +109,31 @@ build: build-images build-sdks # build the docker images build-images: build-controller-image build-agones-sdk-image +# package the current agones helm chart +build-chart: RELEASE_VERSION ?= $(base_version) +build-chart: CHART_DIR ?= install/helm/agones/ +build-chart: $(ensure-build-image) + docker run --rm $(common_mounts) -w $(mount_path) $(build_tag) bash -c \ + "mkdir -p install/helm/bin/ && rm -rf install/helm/bin/* && \ + helm init --client-only && helm package -d install/helm/bin/ --version $(RELEASE_VERSION) $(CHART_DIR)" + +# push the current chart to google cloud storage and update the index +push-chart: $(ensure-build-image) build-chart + docker run --rm $(common_mounts) -w $(mount_path) $(build_tag) bash -c \ + "gsutil copy gs://$(GCP_BUCKET_CHARTS)/index.yaml ./install/helm/bin/index.yaml || /bin/true && \ + helm repo index --merge ./install/helm/bin/index.yaml ./install/helm/bin && \ + cat ./install/helm/bin/index.yaml && ls ./install/helm/bin/ && \ + gsutil copy ./install/helm/bin/*.* gs://$(GCP_BUCKET_CHARTS)/" + +# push a specific release useful to push previous missing release +push-release-chart: RELEASE_VERSION ?= $(base_version) +push-release-chart: $(ensure-build-image) + rm -rf /tmp/agones $(agones_path)/install/.helm-$(RELEASE_VERSION)/ + mkdir -p $(agones_path)/install/.helm-$(RELEASE_VERSION)/ + cd /tmp && git clone --single-branch -b release-$(RELEASE_VERSION) git@github.com:GoogleCloudPlatform/agones.git + mv /tmp/agones/install/helm/agones $(agones_path)/install/.helm-$(RELEASE_VERSION)/ + CHART_DIR=install/.helm-$(RELEASE_VERSION)/agones $(MAKE) push-chart + #build all the sdks build-sdks: build-sdk-cpp @@ -277,6 +303,7 @@ gen-changelog: # - Build binaries and images # - Creates sdk and binary archives, and moves the into the /release folder for upload # - Creates a zip of the install.yaml, LICENCE and README.md for installation +# - Pushes the current chart version to the helm repository hosted on gcs. do-release: RELEASE_VERSION ?= $(base_version) do-release: @echo "Starting release for version: $(RELEASE_VERSION)" @@ -291,6 +318,7 @@ do-release: cp $(agones_path)/sdks/cpp/bin/agonessdk-$(RELEASE_VERSION)-dev-linux-arch_64.tar.gz $(agones_path)/release cp $(agones_path)/sdks/cpp/bin/agonessdk-$(RELEASE_VERSION)-src.zip $(agones_path)/release cd $(agones_path) && zip -r ./release/agones-install-$(RELEASE_VERSION).zip ./README.md ./install ./LICENSE + $(MAKE) push-chart $(MAKE) gcloud-auth-docker push VERSION=$(RELEASE_VERSION) git push -u upstream release-$(RELEASE_VERSION) @echo "Now go make the $(RELEASE_VERSION) release on Github!" diff --git a/docs/governance/templates/release.md b/docs/governance/templates/release.md index 8bd26ae1f8..fbda46ce87 100644 --- a/docs/governance/templates/release.md +++ b/docs/governance/templates/release.md @@ -13,8 +13,15 @@ See [CHANGELOG](https://github.com/GoogleCloudPlatform/agones/blob/{release-bran This software is currently alpha, and subject to change. Not to be used in production systems. Images available with this release: + - [gcr.io/agones-images/agones-controller:{version}](https://gcr.io/agones-images/agones-controller:{version}) - [gcr.io/agones-images/agones-sdk:{version}](https://gcr.io/agones-images/agones-sdk:{version}) - [gcr.io/agones-images/cpp-simple-server:{example-version}](https://gcr.io/agones-images/cpp-simple-server:{example-version}) - [gcr.io/agones-images/udp-server:{example-version}](https://gcr.io/agones-images/udp-server:{example-version}) - [gcr.io/agones-images/xonotic-example:{example-version}](https://gcr.io/agones-images/xonotic-example:{example-version}) + +Helm chart available with this release: + +- [`helm install agones/agones --version {example-version}](https://agones.dev/chart/stable/agones-{example-version}.tgz) + +> Make sure to add our stable helm repository using `helm repo add https://agones.dev/chart/stable` diff --git a/docs/governance/templates/release_issue.md b/docs/governance/templates/release_issue.md index 08aa0ff6a3..37cefba81e 100644 --- a/docs/governance/templates/release_issue.md +++ b/docs/governance/templates/release_issue.md @@ -21,7 +21,8 @@ and copy it into a release issue. Fill in relevent values, found inside {} - [ ] Create PR with these changes, and merge them with approval - [ ] Confirm local git remote `upstream` points at `git@github.com:GoogleCloudPlatform/agones.git` - [ ] Run `git checkout master && git reset --hard upstream/master` to ensure your code is in line with upstream (unless this is a hotfix, then do the same, but for the the release branch) -- [ ] Run `make do-release`. (if release candidate `make do-release RELEASE_VERSION={version}.rc`) to create and push the docker images. +- [ ] Run `make do-release`. (if release candidate `make do-release RELEASE_VERSION={version}.rc`) to create and push the docker images and helm chart. +- [ ] Do a `helm repo add agones https://agones.dev/chart/stable` and verify that the new version is available via the command `helm search agones/` - [ ] Do a `helm install` and a smoke test to confirm everything is working. - [ ] Create a release with the [release template][release-template] - [ ] Make a `tag` with the release version. diff --git a/install/helm/README.md b/install/helm/README.md index 4e85ebaa4a..6cf9ef2c09 100644 --- a/install/helm/README.md +++ b/install/helm/README.md @@ -13,15 +13,11 @@ This chart install the Agones application and defines deployment on a [Kubernete > If you don't have `Helm` installed locally, or `Tiller` installed in your Kubernetes cluster, read the [Using Helm](https://docs.helm.sh/using_helm/) documentation to get started. -To install the chart with the release name `my-release`: - -Download the latest `agones-install` zip from the [releases](https://github.com/GoogleCloudPlatform/agones/releases) archive. +To install the chart with the release name `my-release` using our stable helm repository: ```bash -$ wget https://github.com/GoogleCloudPlatform/agones/releases/download/v0.4.0/agones-install-0.4.0.zip -$ unzip agones-install-0.4.0.zip -$ cd install/helm/ -$ helm install --name my-release --namespace agones-system agones +$ helm repo add agones https://agones.dev/chart/stable +$ helm install --name my-release --namespace agones-system agones/agones ``` _We recommend to install Agones in its own namespaces (like `agones-system` as shown above) @@ -30,7 +26,7 @@ you can use the helm `--namespace` parameter to specify a different namespace._ The command deploys Agones on the Kubernetes cluster with the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. > **Tip**: List all releases using `helm list` -> + > If you are installing a development build of Agones (i.e. not the 0.4.0 release), you will need to install Agones the following way: @@ -51,7 +47,7 @@ For example to use `default` **and** `xbox` namespaces: ```bash $ kubectl create namespace xbox -$ helm install --set "gameservers.namespaces={default,xbox}" --namespace agones-system --name my-release agones +$ helm install --set "gameservers.namespaces={default,xbox}" --namespace agones-system --name my-release agones/agones ``` > You need to create your namespaces before installing Agones. @@ -60,7 +56,7 @@ If you want to add a new namespace afterward simply upgrade your release: ```bash $ kubectl create namespace ps4 -$ helm upgrade --set "gameservers.namespaces={default,xbox,ps4}" my-release agones +$ helm upgrade --set "gameservers.namespaces={default,xbox,ps4}" my-release agones/agones ``` ## RBAC @@ -120,7 +116,7 @@ The above command sets the namespace where Agones is deployed to `mynamespace`. Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, ```bash -$ helm install --name my-release --namespace agones-system -f values.yaml agones +$ helm install --name my-release --namespace agones-system -f values.yaml agones/agones ``` > **Tip**: You can use the default [values.yaml](agones/values.yaml)