forked from keptn/lifecycle-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (132 loc) · 4.78 KB
/
helm-checks.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Helm-test
on:
schedule:
- cron: '0 3 * * 1' # run tests at 1 AM (UTC), every monday (1)
workflow_dispatch:
env:
GO_VERSION: "~1.20"
# renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools
CONTROLLER_TOOLS_VERSION: "v0.12.0"
ENVTEST_K8S_VERSION: "1.24.2"
SCHEDULER_COMPATIBLE_K8S_VERSION: "v0.24.3"
defaults:
run:
shell: bash
jobs:
prepare_ci_run:
name: Prepare CI Run
runs-on: ubuntu-22.04
outputs:
GIT_SHA: ${{ steps.extract_branch.outputs.GIT_SHA }}
BRANCH: ${{ steps.extract_branch.outputs.BRANCH }}
BRANCH_SLUG: ${{ steps.extract_branch.outputs.BRANCH_SLUG }}
DATETIME: ${{ steps.get_datetime.outputs.DATETIME }}
BUILD_TIME: ${{ steps.get_datetime.outputs.BUILD_TIME }}
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Extract branch name
id: extract_branch
uses: keptn/gh-action-extract-branch-name@main
- name: Get current date and time
id: get_datetime
run: |
DATETIME=$(date +'%Y%m%d%H%M')
BUILD_TIME=$(date -u "+%F_%T")
echo "DATETIME=$DATETIME" >> "$GITHUB_OUTPUT"
echo "BUILD_TIME=$BUILD_TIME" >> "$GITHUB_OUTPUT"
build_image:
name: Build Docker Image
needs: prepare_ci_run
runs-on: ubuntu-22.04
env:
BRANCH: ${{ needs.prepare_ci_run.outputs.BRANCH }}
DATETIME: ${{ needs.prepare_ci_run.outputs.DATETIME }}
BUILD_TIME: ${{ needs.prepare_ci_run.outputs.BUILD_TIME }}
GIT_SHA: ${{ needs.prepare_ci_run.outputs.GIT_SHA }}
RELEASE_REGISTRY: "localhost:5000/keptn"
strategy:
matrix:
config:
- name: "lifecycle-operator"
folder: "operator/"
- name: "metrics-operator"
folder: "metrics-operator/"
- name: "scheduler"
folder: "scheduler/"
- name: "functions-runtime"
folder: "functions-runtime/"
- name: "python-runtime"
folder: "python-runtime/"
- name: "certificate-operator"
folder: "klt-cert-manager/"
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Cache build tools
id: cache-build-tools
uses: actions/cache@v3
with:
path: ./${{ matrix.config.folder }}bin
key: build-tools-${{ github.ref_name }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Build Docker Image
uses: docker/build-push-action@v4
with:
context: ${{ matrix.config.folder }}
platforms: linux/amd64
target: production
tags: |
${{ env.RELEASE_REGISTRY }}/${{ matrix.config.name }}:dev-${{ env.DATETIME }}
build-args: |
GIT_HASH=${{ env.GIT_SHA }}
RELEASE_VERSION=dev-${{ env.DATETIME }}
BUILD_TIME=${{ env.BUILD_TIME }}
CONTROLLER_TOOLS_VERSION=${{ env.CONTROLLER_TOOLS_VERSION }}
SCHEDULER_COMPATIBLE_K8S_VERSION=${{ env.SCHEDULER_COMPATIBLE_K8S_VERSION }}
builder: ${{ steps.buildx.outputs.name }}
push: false
cache-from: type=gha,scope=${{ github.ref_name }}-${{ matrix.config.name }}
cache-to: type=gha,scope=${{ github.ref_name }}-${{ matrix.config.name }}
outputs: type=docker,dest=/tmp/${{ matrix.config.name }}-image.tar
- name: Upload image as artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.config.name }}-image.tar
path: /tmp/${{ matrix.config.name }}-image.tar
build_helm_chart:
name: Build Helm Chart
needs: [prepare_ci_run, build_image]
runs-on: ubuntu-22.04
env:
RELEASE_REGISTRY: "localhost:5000/keptn"
DATETIME: ${{ needs.prepare_ci_run.outputs.DATETIME }}
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Generate helm charts
run: |
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"
done
- name: Upload KLT helm charts archive
uses: actions/upload-artifact@v3
with:
name: keptn-lifecycle-toolkit.tgz
path: ./helm/chart/*
- name: Upload generated helm yaml
uses: actions/upload-artifact@v3
with:
name: helmchart.yaml
path: ./helmchart.yaml
integration_tests:
name: Integration Tests
needs: [prepare_ci_run, build_helm_chart]
with:
runtime_tag: dev-${{ needs.prepare_ci_run.outputs.DATETIME }}
helm-install: true
uses: ./.github/workflows/integration-test.yml