Skip to content

Commit

Permalink
ci: fix release pipeline, add more things to release please (keptn#1075)
Browse files Browse the repository at this point in the history
  • Loading branch information
mowies authored Mar 22, 2023
1 parent 52311c1 commit 8608f11
Show file tree
Hide file tree
Showing 18 changed files with 131 additions and 101 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ jobs:
if: matrix.config.name != 'functions-runtime'
working-directory: ./${{ matrix.config.folder }}
env:
TAG: dev-${{ env.DATETIME }}
CHART_APPVERSION: dev-${{ env.DATETIME }}
run: make release-manifests

- name: Upload release.yaml for tests
Expand Down Expand Up @@ -288,7 +288,7 @@ jobs:
if: matrix.config.name != 'functions-runtime'
working-directory: ./${{ matrix.config.folder }}
env:
TAG: dev-${{ env.DATETIME }}
CHART_APPVERSION: dev-${{ env.DATETIME }}
run: make release-manifests

- name: Upload release.yaml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:

- name: Generate helm charts
run: |
make helm-package RELEASE_REGISTRY=${{ env.RELEASE_REGISTRY }} TAG=dev-${{ env.DATETIME }}
make helm-package RELEASE_REGISTRY=${{ env.RELEASE_REGISTRY }} CHART_APPVERSION=dev-${{ env.DATETIME }}
for file in $(find ./helm/chart/templates -type f -name "*.yaml");
do
sed -i 's/{{ include "chart.fullname" . }}-//g' "$file"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ jobs:
- name: Create manifests
env:
RELEASE_REGISTRY: ghcr.keptn.sh/keptn
TAG: ${{ needs.release-please.outputs.tag_name }}
CHART_APPVERSION: ${{ needs.release-please.outputs.tag_name }}
run: |
cd scheduler
make release-manifests
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/validate-helm-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:
defaults:
run:
shell: bash
env:
CHART_APPVERSION: "0.6.0" # x-release-please-version
jobs:
check-helm-docs:
name: Check helm documentation values
Expand All @@ -24,7 +22,9 @@ jobs:
node-version: 16

- name: Generate helm charts
run: make helm-package TAG="${{ env.CHART_APPVERSION }}"
env:
RELEASE_REGISTRY: ghcr.keptn.sh/keptn
run: make helm-package

- name: Install readme generator
run: |
Expand Down
23 changes: 13 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CERT_MANAGER_VERSION ?= v1.11.0
KUSTOMIZE_VERSION?=v4.5.7
# renovate: datasource=github-tags depName=helm/helm
HELM_VERSION ?= v3.11.2
CHART_VERSION = v0.5.0 # x-release-please-version
CHART_APPVERSION ?= v0.7.0 # x-release-please-version

# renovate: datasource=docker depName=cytopia/yamllint
YAMLLINT_VERSION ?= alpine-1-0.14
Expand Down Expand Up @@ -60,10 +60,13 @@ $(KUSTOMIZE): $(LOCALBIN)
release-helm-manifests: helmify
echo "building helm overlay"
kustomize build ./helm/overlay > helmchart.yaml
envsubst < helmchart.yaml > tmp.yaml; mv tmp.yaml helmchart.yaml
cat helmchart.yaml | $(HELMIFY) -probes=true -image-pull-secrets=true -vv helm/chart

.PHONY: helm-package
helm-package: build-release-manifests release-helm-manifests
helm-package:
$(MAKE) build-release-manifests CHART_APPVERSION=$(CHART_APPVERSION) RELEASE_REGISTRY=$(RELEASE_REGISTRY)
$(MAKE) release-helm-manifests CHART_APPVERSION=$(CHART_APPVERSION) RELEASE_REGISTRY=$(RELEASE_REGISTRY)


.PHONY: build-release-manifests
Expand All @@ -72,40 +75,40 @@ build-release-manifests:
$(MAKE) -C klt-cert-manager generate
$(MAKE) -C metrics-operator generate

$(MAKE) -C operator release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG) ARCH=$(ARCH)
$(MAKE) -C scheduler release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG) ARCH=$(ARCH)
$(MAKE) -C klt-cert-manager release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG) ARCH=$(ARCH)
$(MAKE) -C metrics-operator release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG) ARCH=$(ARCH)
$(MAKE) -C operator release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG) ARCH=$(ARCH) CHART_APPVERSION=$(CHART_APPVERSION)
$(MAKE) -C scheduler release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG) ARCH=$(ARCH) CHART_APPVERSION=$(CHART_APPVERSION)
$(MAKE) -C klt-cert-manager release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG) ARCH=$(ARCH) CHART_APPVERSION=$(CHART_APPVERSION)
$(MAKE) -C metrics-operator release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG) ARCH=$(ARCH) CHART_APPVERSION=$(CHART_APPVERSION)

.PHONY: build-deploy-operator
build-deploy-operator:
$(MAKE) -C operator release-local.$(ARCH) RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG)
$(MAKE) -C operator push-local RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG)
$(MAKE) -C operator release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG) ARCH=$(ARCH)
$(MAKE) -C operator release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) CHART_APPVERSION=$(TAG) ARCH=$(ARCH)

kubectl apply -f operator/config/rendered/release.yaml

.PHONY: build-deploy-metrics-operator
build-deploy-metrics-operator:
$(MAKE) -C metrics-operator release-local.$(ARCH) RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG)
$(MAKE) -C metrics-operator push-local RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG)
$(MAKE) -C metrics-operator release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG) ARCH=$(ARCH)
$(MAKE) -C metrics-operator release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) CHART_APPVERSION=$(TAG) ARCH=$(ARCH)

kubectl apply -f metrics-operator/config/rendered/release.yaml

.PHONY: build-deploy-scheduler
build-deploy-scheduler:
$(MAKE) -C scheduler release-local.$(ARCH) RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG)
$(MAKE) -C scheduler push-local RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG)
$(MAKE) -C scheduler release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG) ARCH=$(ARCH)
$(MAKE) -C scheduler release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) CHART_APPVERSION=$(TAG) ARCH=$(ARCH)
kubectl create namespace keptn-lifecycle-toolkit-system --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -f scheduler/config/rendered/release.yaml

.PHONY: build-deploy-certmanager
build-deploy-certmanager:
$(MAKE) -C klt-cert-manager release-local.$(ARCH) RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG)
$(MAKE) -C klt-cert-manager push-local RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG)
$(MAKE) -C klt-cert-manager release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG) ARCH=$(ARCH)
$(MAKE) -C klt-cert-manager release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) CHART_APPVERSION=$(TAG) ARCH=$(ARCH)
kubectl create namespace keptn-lifecycle-toolkit-system --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -f klt-cert-manager/config/rendered/release.yaml

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ Instead, if you want to build and deploy the operator into your cluster directly
```bash
RELEASE_REGISTRY=<YOUR_DOCKER_REGISTRY>
# (optional)ARCH=<amd64(default)|arm64v8>
# (optional)TAG=<YOUR_PREFERRED_TAG (defaulting to current time)>
# (optional)CHART_APPVERSION=<YOUR_PREFERRED_TAG (defaulting to current time)>
# Build and deploy the dev images to the current kubernetes cluster
make build-deploy-dev-environment
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/docs/snippets/tasks/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ with a command like the following:
<!---x-release-please-start-version-->

```shell
kubectl apply -f https://github.com/keptn/lifecycle-toolkit/releases/download/v0.6.0/manifest.yaml
kubectl apply -f https://github.com/keptn/lifecycle-toolkit/releases/download/v0.7.0/manifest.yaml
kubectl wait --for=condition=Available deployment/lifecycle-operator -n keptn-lifecycle-toolkit-system --timeout=120s
```

Expand Down
Loading

0 comments on commit 8608f11

Please sign in to comment.