-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'keptn:main' into feat/721/configurable-pull-policy
- Loading branch information
Showing
18 changed files
with
202 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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.19" | ||
# renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools | ||
CONTROLLER_TOOLS_VERSION: "v0.9.2" | ||
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 }} | ||
NON_FORKED_AND_NON_ROBOT_RUN: ${{ steps.get_run_type.outputs.NON_FORKED_AND_NON_ROBOT_RUN }} | ||
|
||
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" | ||
- name: Get workflow run type | ||
id: get_run_type | ||
run: | | ||
NON_FORKED_AND_NON_ROBOT_RUN=${{ ( github.actor != 'renovate[bot]' && github.actor != 'dependabot[bot]' ) && ( github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository ) }} | ||
echo "github.actor != 'renovate[bot]' = ${{ github.actor != 'renovate[bot]' }}" | ||
echo "github.actor != 'dependabot[bot]' = ${{ github.actor != 'dependabot[bot]' }}" | ||
echo "github.event_name == 'push' = ${{ github.event_name == 'push' }}" | ||
echo "github.event.pull_request.head.repo.full_name == github.repository = ${{ github.event.pull_request.head.repo.full_name == github.repository }}" | ||
echo "NON_FORKED_AND_NON_ROBOT_RUN = $NON_FORKED_AND_NON_ROBOT_RUN" | ||
echo "NON_FORKED_AND_NON_ROBOT_RUN=$NON_FORKED_AND_NON_ROBOT_RUN" >> "$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: "keptn-lifecycle-operator" | ||
folder: "operator/" | ||
- name: "scheduler" | ||
folder: "scheduler/" | ||
- name: "functions-runtime" | ||
folder: "functions-runtime/" | ||
- name: "klt-cert-manager" | ||
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" | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Generate helm charts | ||
run: | | ||
make helm-package RELEASE_REGISTRY=${{ env.RELEASE_REGISTRY }} TAG=dev-${{ needs.prepare_ci_run.outputs.DATETIME }} | ||
sed -i 's/imagePullPolicy: Always/imagePullPolicy: Never/g' ./helm/chart/templates/rendered.yaml | ||
sed -i 's/ghcr.keptn.sh\/keptn\/functions-runtime:.*/localhost:5000\/keptn\/functions-runtime dev-${{ needs.prepare_ci_run.outputs.DATETIME }}/g' ./helm/chart/templates/rendered.yaml | ||
rm -r ./helm/chart/charts | ||
- name: Upload KLT helm charts archive | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: keptn-lifecycle-toolkit.tgz | ||
path: ./helm/chart/* | ||
|
||
integration_tests: | ||
name: Integration Tests | ||
needs: [ build_helm_chart ] | ||
with: | ||
functions_runtime_tag: dev-${{ needs.prepare_ci_run.outputs.DATETIME }} | ||
helm-install: true | ||
uses: ./.github/workflows/integration-test.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,7 +79,7 @@ jobs: | |
uses: sigstore/[email protected] | ||
|
||
- name: Build Docker Image | ||
uses: docker/build-push-action@v3 | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ${{ matrix.config.folder }} | ||
platforms: linux/amd64,linux/arm64 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.