Skip to content

Commit

Permalink
feat: amend default values & increment version functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
mentlak0 committed Jul 21, 2023
1 parent be287c7 commit 614586a
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 73 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/increment-version.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ jobs:
steps:
- name: check source code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get Chart.yaml version change
id: check-change
run: |
if git diff --name-only -r HEAD^1 HEAD | grep charts/tekton-pipeline/Chart.yaml; then
echo "changed_version=$(git diff --name-only -r HEAD^1 HEAD | grep charts/tekton-pipeline/Chart.yaml)"
else
exit 1
fi
- uses: J12934/helm-gh-pages-action@master
with:
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
NAME := tekton-pipeline
CHART_DIR := charts/${NAME}
CHART_VERSION ?= latest
RELEASE_VERSION := $(shell jx-release-version -previous-version=from-file:charts/tekton-pipeline/Chart.yaml)

CHART_REPO := gs://jenkinsxio/charts

Expand Down Expand Up @@ -61,8 +62,8 @@ delete:
clean:

release: clean
sed -i -e "s/version:.*/version: $(VERSION)/" Chart.yaml

# Increment Chart.yaml version for minor changes to helm chart
yq eval '.version = "$(RELEASE_VERSION)"' -i charts/tekton-pipeline/Chart.yaml
helm dependency build
helm lint
helm package .
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The following tools need to be installed locally:

- [kustomize](https://kubectl.docs.kubernetes.io/installation/kustomize/)
- [yq](https://github.com/mikefarah/yq/#install)
- [jx-release-version](https://github.com/jenkins-x-plugins/jx-release-version)

### Jenkins X

Expand All @@ -28,6 +29,12 @@ To fetch a specific version (say 0.32.0), use CHART_VERSION
make CHART_VERSION=0.32.0 fetch
```

```bash
make release
```
This will check the current version in Chart.yaml and increment the minor version by 0.0.1.
Please use this command when making changes to the charts to maintain version control.

Also, remember to change the `version` in `charts/tekton-pipeline/Chart.yaml`.
The `app_version` will be set to the `CHART_VERSION` automatically by the makefile if a `CHART_VERSION` is specified.
For latest set `app_version` to the latest tekton version from the [tekton release page](https://github.com/tektoncd/pipeline/releases) and not `latest`.
Expand Down
2 changes: 1 addition & 1 deletion charts/tekton-pipeline/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: A Helm chart for Tekton Pipelines
name: tekton-pipeline
version: 1.0.0
version: 1.0.1
appVersion: 0.42.0
icon: https://avatars2.githubusercontent.com/u/47602533
home: https://github.com/cdfoundation/tekton-helm-chart
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ spec:
{{- end}}
spec:
affinity:
nodeAffinity:
helmTemplateRemoveMe: |
{{- with .Values.controllerDeploymentTolerations.nodeAffinity }}
{{- toYaml . | nindent 8 }}
{{- toYaml . | nindent 10 }}
{{- end }}
containers:
- name: tekton-pipelines-controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ spec:
{{- end}}
spec:
affinity:
helmTemplateRemoveMe: |
{{- with .Values.webhookDeploymentTolerations.nodeAffinity }}
{{- toYaml . | nindent 8 }}
{{- end }}
nodeAffinity:
helmTemplateRemoveMe: |
{{- with .Values.webhookDeploymentTolerations.nodeAffinity }}
{{- toYaml . | nindent 10 }}
{{- end }}
containers:
- name: webhook
envFrom:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ spec:
version: v0.42.0
spec:
affinity:
{{- with .Values.controllerDeploymentTolerations.nodeAffinity }}
{{- toYaml . | nindent 8 }}
{{- end }}
nodeAffinity:
{{- with .Values.controllerDeploymentTolerations.nodeAffinity }}
{{- toYaml . | nindent 10 }}
{{- end }}
containers:
- args:
- -kubeconfig-writer-image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ spec:
version: v0.42.0
spec:
affinity:
{{- with .Values.webhookDeploymentTolerations.nodeAffinity }}
{{- toYaml . | nindent 8 }}
{{- end }}
nodeAffinity:
{{- with .Values.webhookDeploymentTolerations.nodeAffinity }}
{{- toYaml . | nindent 10 }}
{{- end }}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
Expand Down
38 changes: 18 additions & 20 deletions charts/tekton-pipeline/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,30 +107,28 @@ resolverDeploymentTolerations:
# - "node"
nodeSelector: []
tolerations: []
# Add node affinity tolerations for tekton-pipeline-controller
# Add node affinity tolerations for tekton-pipeline-controller. Add additional matchExpressions below. Default is set.
controllerDeploymentTolerations:
nodeAffinity: {}
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: "key"
# operator: "In"
# values:
# - "node"
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: NotIn
values:
- windows
nodeSelector: []
tolerations: []
# Add node affinity tolerations for tekton-pipelines-webhook
# Add node affinity tolerations for tekton-pipelines-webhook. Add additional matchExpressions below. Default is set.
webhookDeploymentTolerations:
nodeAffinity: {}
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: "key"
# operator: "In"
# values:
# - "node"
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: NotIn
values:
- windows
nodeSelector: []
tolerations: []
gitResolverConfig:
Expand Down

0 comments on commit 614586a

Please sign in to comment.