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

Create make release target to update versions #610

Merged
merged 17 commits into from
Feb 5, 2020
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ GIT_VERSION = $(shell git describe --always --abbrev=7)
GIT_COMMIT = $(shell git rev-list -1 HEAD)
DATE = $(shell date -u +"%Y.%m.%d.%H.%M.%S")

K8S_DEPLOY_FILES = $(shell find ./deploy -name '*.yaml')

##################################################
# All #
##################################################
Expand Down Expand Up @@ -63,6 +65,15 @@ endif
.PHONY: build
build: checkenv build-adapter build-controller

.PHONY: release
Cottonglow marked this conversation as resolved.
Show resolved Hide resolved
release:
@sed -i 's@Version =.*@Version = "$(IMAGE_TAG)"@g' ./version/version.go;
@for file in $(K8S_DEPLOY_FILES); do \
sed -i 's@app.kubernetes.io/version:.*@app.kubernetes.io/version: "$(IMAGE_TAG)"@g' $$file; \
sed -i 's@image: docker.io/kedacore/keda:.*@image: docker.io/kedacore/keda:$(IMAGE_TAG)@g' $$file; \
sed -i 's@image: docker.io/kedacore/keda-metrics-adapter:.*@image: docker.io/kedacore/keda-metrics-adapter:$(IMAGE_TAG)@g' $$file; \
done

.PHONY: build-controller
build-controller: generate-api pkg/scalers/liiklus/LiiklusService.pb.go
$(GO_BUILD_VARS) operator-sdk build $(IMAGE_CONTROLLER) \
Expand Down
30 changes: 10 additions & 20 deletions RELEASE-PROCESS.MD
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,16 @@ The next version will thus be 1.2.0

**1) Update KEDA version in code and YAMLs**

Update version string in:
https://github.com/kedacore/keda/blob/master/version/version.go

Update sections related to images in these yamls:
https://github.com/kedacore/keda/blob/master/deploy/12-operator.yaml
https://github.com/kedacore/keda/blob/master/deploy/22-metrics-deployment.yaml

Update sections related to the version label in these yamls:
https://github.com/kedacore/keda/blob/master/deploy/00-namespace.yaml
https://github.com/kedacore/keda/blob/master/deploy/01-service_account.yaml
https://github.com/kedacore/keda/blob/master/deploy/10-cluster_role.yaml
https://github.com/kedacore/keda/blob/master/deploy/11-role_binding.yaml
https://github.com/kedacore/keda/blob/master/deploy/12-operator.yaml
https://github.com/kedacore/keda/blob/master/deploy/20-metrics-cluster_role.yaml
https://github.com/kedacore/keda/blob/master/deploy/21-metrics-role_binding.yaml
https://github.com/kedacore/keda/blob/master/deploy/22-metrics-deployment.yaml
https://github.com/kedacore/keda/blob/master/deploy/23-metrics-service.yaml
https://github.com/kedacore/keda/blob/master/deploy/24-metrics-api_service.yaml

Commit these changes.
* Set the `IMAGE_TAG` value to the next version, eg 1.2.0.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking whether we shouldn't rename variable IMAGE_TAG to VERSION as it is more correct description of what it actually is?
If we do so, we will need to modify Readme and release script a little bit.

WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, during the release process, when we change the yaml files, shouldn't it also need to commit those files too? To reflect in git?
Also should the release process also include build and publish?

Copy link
Member

@zroubalik zroubalik Feb 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there is a note about commiting the changes in the document.

And for the build and publish part, I'd keep it as it is, as it is handled by the github release workflow, if I am not mistaken

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I would prefer VERSION as it is used for both versioning files and 'versioning' image tags.

I'll change it for now and if someone feels strongly against it, I can revert then :)

```bash
export IMAGE_TAG=1.2.0
```
* Run the following command to update the versions:
```bash
make release
Cottonglow marked this conversation as resolved.
Show resolved Hide resolved
```
> Note: This will update the version label and images in the yaml files located in the `deploy` folder as well as the version in `version.go`.
* Commit these changes.

**2) Deploy the new KEDA images to Docker Hub**

Expand Down