diff --git a/.release b/.release new file mode 100644 index 0000000000..e2ed7558ea --- /dev/null +++ b/.release @@ -0,0 +1 @@ +release=1.0.0 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..6fb8fe1f77 --- /dev/null +++ b/Makefile @@ -0,0 +1,51 @@ +IMAGE_REPO=infracloud/botkube +TAG=$(shell cut -d'=' -f2- .release) + +.DEFAULT_GOAL := release +.PHONY: release git-tag check-git-status build pre-build tag-image publish + +#Docker Tasks +#Make a release +release: git-tag build tag-image publish + @echo "Successfully released version $(TAG)" + +#Create a git tag +git-tag: check-git-status + @echo "Creating a git tag" + @git add . + @git commit -m "Bumped to version $(TAG)" ; + @git tag $(TAG) ; + @git push --tags ; + @echo 'Git tag pushed successfully' ; + +#Check git status +check-git-status: + @echo "Checking git status" + @if [ -n "$(shell git tag | grep $(TAG))" ] ; then echo 'Tag already exists' && exit 1 ; fi + @if [ -z "$(shell git remote -v)" ] ; then echo 'No remote to push tags to' && exit 1 ; fi + @if [ -z "$(shell git config user.email)" ] ; then echo 'Unable to detect git credentials' && exit 1 ; fi + +#Build the image +build: pre-build + @echo "Building docker image" + @docker build --build-arg GOOS_VAL=$(shell go env GOOS) --build-arg GOARCH_VAL=$(shell go env GOARCH) -t $(IMAGE_REPO) -f build/Dockerfile --no-cache . + @echo "Docker image build successfully" + +#Pre-build checks +pre-build: + @echo "Checking system information" + @if [ -z "$(shell go env GOOS)" ] || [ -z "$(shell go env GOARCH)" ] ; then echo 'Could not determine the system architecture.' && exit 1 ; fi + + +#Tag images +tag-image: + @echo 'Tagging image' + @docker tag $(IMAGE_REPO) $(IMAGE_REPO):$(TAG) + @docker tag $(IMAGE_REPO) $(IMAGE_REPO):latest + +#Docker push image +publish: + @echo "Pushing docker image to repository" + @docker login + @docker push $(IMAGE_REPO):$(TAG) + @docker push $(IMAGE_REPO):latest diff --git a/helm/botkube/values.yaml b/helm/botkube/values.yaml index b92b74e2ab..f44ea95417 100644 --- a/helm/botkube/values.yaml +++ b/helm/botkube/values.yaml @@ -6,7 +6,7 @@ replicaCount: 1 image: repository: infracloud/botkube - tag: "0.4" + tag: "latest" pullPolicy: Always nameOverride: ""