Skip to content

Commit

Permalink
chore: trigger new version of agent chart upon deploy (#690)
Browse files Browse the repository at this point in the history
  • Loading branch information
leg100 authored Oct 22, 2024
1 parent 3e83474 commit 155e026
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,21 @@ jobs:
repository: leg100/otf-charts
- name: Bump version
run: |
# set app version
yq -i ".appVersion = \"${{ needs.release-please.outputs.version }}\"" ./charts/otf/Chart.yaml
# set app version on all charts
yq -i ".appVersion = \"${{ needs.release-please.outputs.version }}\"" ./charts/otfd/Chart.yaml
yq -i ".appVersion = \"${{ needs.release-please.outputs.version }}\"" ./charts/otf-agent/Chart.yaml
# bump patch in chart version
yq -i '.version |= (split(".") | .[-1] |= ((. tag = "!!int") + 1) | join("."))' ./charts/otf/Chart.yaml
# render README.md to reflect updated version
CHART=otfd make bump
CHART=otf-agent make bump
# re-generate README.md to reflect updated version
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install norwoodj/tap/helm-docs
make readme
helm-docs
# create branch and commit
git config --global user.email "[email protected]"
git config --global user.name "Chart bumper"
git checkout -b new-otf-version-${{ needs.release-please.outputs.tag_name }}
git add ./charts/otf/Chart.yaml
git add ./README.md
git a -A
git commit -m "New otf version ${{ needs.release-please.outputs.tag_name }}"
git push origin new-otf-version-${{ needs.release-please.outputs.tag_name }}
- name: Create pull request
Expand Down
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ VERSION = $(shell git describe --tags --dirty --always)
GIT_COMMIT = $(shell git rev-parse HEAD)
RANDOM_SUFFIX := $(shell cat /dev/urandom | tr -dc 'a-z0-9' | head -c5)
IMAGE_NAME = leg100/otfd
IMAGE_NAME_AGENT = leg100/otf-agent
IMAGE_TAG ?= $(VERSION)-$(RANDOM_SUFFIX)
DBSTRING=postgres:///otf
LD_FLAGS = " \
Expand Down Expand Up @@ -101,6 +102,16 @@ image: build
load: image
kind load docker-image $(IMAGE_NAME):$(IMAGE_TAG)

# Build docker image for otf-agent
.PHONY: image-agent
image-agent: build
docker build -f ./Dockerfile.agent -t $(IMAGE_NAME_AGENT):$(IMAGE_TAG) -t $(IMAGE_NAME_AGENT):latest ./_build

# Build and load otf-agent image into k8s kind
.PHONY: load-agent
load-agent: image-agent
kind load docker-image $(IMAGE_NAME_AGENT):$(IMAGE_TAG)

# Install pre-commit
.PHONY: install-pre-commit
install-pre-commit:
Expand Down

0 comments on commit 155e026

Please sign in to comment.