Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
ci: Backport CI changes (#7056)
Browse files Browse the repository at this point in the history
* ci: Add pipeline to nightly check docker image digests (#6598)

Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Minor pipeline improvements (#6613)

Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Only push docker images if not from a forked repo (#6618)

Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Fix digest checker pipeline (#6619)

Co-authored-by: Giovanni Liva <[email protected]>
Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Fix CI pipeline not pushing master images to registry (#6634)

Signed-off-by: Moritz Wiesinger <[email protected]>

* feat: Release helm charts on GitHub pages (#6559)

BREAKING CHANGES: The Keptn Helm charts are now served from the [keptn/helm-charts](https://github.com/keptn/helm-charts) repository through GitHub pages. They are accessible by using https://charts.keptn.sh as a helm chart repository.

Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Remove unneeded pipelines and config files (#6642)

Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Fix master builds not pushing docker images (#6643)

Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Fix master builds not pushing docker images (#6659)

Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Fix intergation tests taking master artifacts from bot commits (#6670)

Signed-off-by: Moritz Wiesinger <[email protected]>

* test: Integration Tests on static GKE clusters (#6632)

Co-authored-by: Giovanni Liva <[email protected]>
Signed-off-by: Moritz Wiesinger <[email protected]>

* chore: Add k8s resource stats to release notes (#6718)

Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Fix dev helm charts not having a unique image name (#6816)

Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Disable manual triggers of the CI pipeline (#6819)

Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Always use datetimed version for integration tests (#6820)

Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Ensure that build matrix runs as far as possible (#6875)

Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Only upload dev helm chart for non-fork PRs (#6763)

(cherry picked from commit 134d487)
Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Push dev images to dev dockerhub registry, adjust helm charts (#6857)

(cherry picked from commit 59a7762)
Signed-off-by: Moritz Wiesinger <[email protected]>

* chore: Removed makefile and all usages of it (#6804)

(cherry picked from commit e55355f)
Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Fix cleanup in integration tests to also include clusterroles and clusterrolebindings (#6931)

(cherry picked from commit 3dd71e5)
Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Fix release pipeline not uploading helm charts correctly (#6944)

(cherry picked from commit 0609c7d)
Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Fix integration test pipeline not starting if there were 404ing CI pipeline runs in the source branch (#6966)

(cherry picked from commit 23c4c37)
Signed-off-by: Moritz Wiesinger <[email protected]>

* ci: Fix resource cleanup in integration tests when resource arrays are empty (#6971)

(cherry picked from commit 2abb21c)
Signed-off-by: Moritz Wiesinger <[email protected]>

* Remove backport artifact

Signed-off-by: Moritz Wiesinger <[email protected]>

Co-authored-by: Giovanni Liva <[email protected]>
  • Loading branch information
mowies and thisthat authored Mar 3, 2022
1 parent 9ea7630 commit b991724
Show file tree
Hide file tree
Showing 96 changed files with 978 additions and 1,518 deletions.
80 changes: 63 additions & 17 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ on:
branches:
- 'master'
- '[0-9]+.[1-9][0-9]*.x'
workflow_dispatch: # run CI when triggered manually
env:
GO_VERSION: "^1.16"
KUBE_CONSTRAINTS: ">= 1.14, <= 1.21"
CLI_FOLDER: "cli/"
INSTALLER_FOLDER: "installer/"

Expand Down Expand Up @@ -168,14 +166,6 @@ jobs:
# see https://github.com/keptn/gh-action-extract-branch-name for details
uses: keptn/gh-action-extract-branch-name@main

- name: 'Get Previous tag'
id: get_previous_tag
uses: "WyriHaximus/[email protected]"
- name: 'Get next patch version'
id: get_next_semver_tag
uses: "WyriHaximus/[email protected]"
with:
version: ${{ steps.get_previous_tag.outputs.tag }}
- name: Get the version
id: get_version
env:
Expand All @@ -184,9 +174,15 @@ jobs:
shell: bash
run: |
# determine version
GIT_LAST_TAG=${{ steps.get_previous_tag.outputs.tag }}
GIT_NEXT_TAG=${{ steps.get_next_semver_tag.outputs.patch }}
echo "GIT_LAST_TAG=${GIT_LAST_TAG}, GIT_NEXT_TAG=${GIT_NEXT_TAG}"
npx standard-version@^9.3.1 \
--skip.commit \
--skip.tag \
--skip.changelog
GIT_NEXT_TAG=$(cat VERSION.txt)
git checkout HEAD -- VERSION.txt
echo "GIT_NEXT_TAG=${GIT_NEXT_TAG}"
if [[ "$BRANCH" == "master" ]]; then
# master branch = latest
Expand Down Expand Up @@ -322,7 +318,10 @@ jobs:
${{ runner.os }}-go-cli
- name: Test CLI
run: make test-unit-cli
working-directory: cli
run: |
go get gotest.tools/[email protected]
gotestsum --no-color=false --format=testname -- -race -v -coverprofile=coverage.txt -covermode=atomic ./...
- name: Report test coverage for CLI
uses: codecov/codecov-action@v2
Expand Down Expand Up @@ -357,6 +356,53 @@ jobs:
keptn-spec-version: ${{ needs.prepare_ci_run.outputs.KEPTN_SPEC_VERSION }}
datetime: ${{ needs.prepare_ci_run.outputs.DATE }}${{ needs.prepare_ci_run.outputs.TIME }}

helm_charts_upload:
name: Publish helm charts to dev repo
needs: [prepare_ci_run, helm_charts_build]
if: ((needs.prepare_ci_run.outputs.BUILD_EVERYTHING == 'true') || (needs.prepare_ci_run.outputs.BUILD_INSTALLER == 'true')) && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository))
runs-on: ubuntu-20.04
steps:
- name: Checkout helm-charts repo
uses: actions/checkout@v2
with:
repository: keptn/helm-charts-dev
path: helm-charts-dev
ref: gh-pages
token: ${{ secrets.KEPTN_BOT_TOKEN }}

- name: Configure Git
working-directory: helm-charts-dev
env:
KEPTN_BOT_NAME: "Keptn Bot"
KEPTN_BOT_EMAIL: "keptn-bot <[email protected]>"
run: |
git config user.name "$KEPTN_BOT_NAME"
git config user.email "$KEPTN_BOT_EMAIL"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.7.2

- name: Download Helm Chart artifacts
id: download_helm_chart
uses: actions/download-artifact@v2
with:
name: keptn-installer
path: dist/keptn-installer

- name: Upload helm charts to dev repo
env:
RELEASE_TAG: ${{ needs.prepare_ci_run.outputs.VERSION }}
run: |
mv ./dist/keptn-installer/*.tgz ./helm-charts-dev/packages
cd ./helm-charts-dev
helm repo index ./ --url https://charts-dev.keptn.sh/ --merge ./index.yaml
git add *.tgz
git add index.yaml
git commit --signoff -m "Keptn Dev Version $RELEASE_TAG"
git push
############################################################################
# Build Docker Images #
############################################################################
Expand Down Expand Up @@ -396,9 +442,9 @@ jobs:
with:
context: ${{ matrix.config.working-dir }}
tags: |
keptn/${{ matrix.config.artifact }}:${{ env.VERSION }}
keptn/${{ matrix.config.artifact }}:${{ env.VERSION }}.${{ env.DATETIME }}
keptndev/${{ matrix.config.artifact }}:${{ env.VERSION }}
keptndev/${{ matrix.config.artifact }}:${{ env.VERSION }}.${{ env.DATETIME }}
build-args: |
version=${{ env.VERSION }}
push: ${{ matrix.config.should-push-image && ( github.actor != 'renovate[bot]' && github.actor != 'dependabot[bot]' ) }}
push: ${{ matrix.config.should-push-image == 'true' && (( github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository ) || ( github.event_name == 'push' )) && github.actor != 'renovate[bot]' && github.actor != 'dependabot[bot]' }}
pull: true
28 changes: 16 additions & 12 deletions .github/workflows/build-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ jobs:
key: ${{ runner.os }}-go-cli-${{ hashFiles('cli/go.sum') }}
restore-keys: |
${{ runner.os }}-go-cli
- name: Build CLI
working-directory: cli
env:
GOARCH: ${{ matrix.GOARCH }}
GOOS: ${{ matrix.GOOS }}
Expand All @@ -76,37 +78,39 @@ jobs:
if [[ "$GOOS" == "windows" ]]; then
FILE_ENDING=".exe"
fi
# determine output file name based on version, go os, architecture
OUTPUT_EXECUTABLE_NAME="keptn-${VERSION}-${GOOS}-${GOARCH}${FILE_ENDING}"
OUTPUT_ARCHIVE_NAME="keptn-${VERSION}-${GOOS}-${GOARCH}" # no need for file-ending in the archive name
if [[ "$BRANCH" == "master" ]] && [[ "$RELEASE_BUILD" == 'false' ]] && [[ "$DATETIME" != '' ]]; then
# use VERSION.DATETIME for the cli version (e.g., nightly build)
VERSION=${VERSION}.${DATETIME}
fi
if [[ "$GOOS" == "linux" ]]; then
# enable static build for linux
export CGO_ENABLED=0
fi
if [[ "$GOOS" == "darwin" ]]; then
# enable CGO for compiling docker credential helper natively
export CGO_ENABLED=1
fi
# build the binary using makefile
make build-cli OUTPUT_EXECUTABLE_NAME="$OUTPUT_EXECUTABLE_NAME"
# verify output file exists
ls bin/${OUTPUT_EXECUTABLE_NAME}
echo "Building Keptn CLI with filename $OUTPUT_EXECUTABLE_NAME"
go mod download
go build -ldflags="-X 'github.com/keptn/keptn/cli/cmd.Version=$VERSION'" -o "${OUTPUT_EXECUTABLE_NAME}"
ls "${OUTPUT_EXECUTABLE_NAME}"
# create a .tar.gz archive of the binary
mkdir dist
tar -zcvf dist/${OUTPUT_ARCHIVE_NAME}.tar.gz -C bin ${OUTPUT_EXECUTABLE_NAME}
tar -zcvf dist/${OUTPUT_ARCHIVE_NAME}.tar.gz ${OUTPUT_EXECUTABLE_NAME}
- name: Upload Keptn CLI as an artifact
uses: actions/upload-artifact@v2
with:
name: keptn-cli
path: dist/
path: cli/dist/
6 changes: 3 additions & 3 deletions .github/workflows/build-helm-charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ jobs:
- name: Build Helm Charts
id: build_helm_charts
run: |
if [[ "$BRANCH" == "master" ]] && [[ "$RELEASE_BUILD" == 'false' ]] && [[ $DATETIME != "" ]]; then
if [[ "$RELEASE_BUILD" == "false" ]] && [[ $DATETIME != "" ]]; then
# use VERSION.DATETIME for the image tag (e.g., nightly build)
./gh-actions-scripts/build_helm_charts.sh "${VERSION}" "${VERSION}.${DATETIME}" "${KEPTN_SPEC_VERSION}"
./gh-actions-scripts/build-helm-charts.sh "${VERSION}" "${VERSION}.${DATETIME}" "${KEPTN_SPEC_VERSION}" "keptndev"
else
# just use VERSION for the image tag
./gh-actions-scripts/build_helm_charts.sh "${VERSION}" "${VERSION}" "${KEPTN_SPEC_VERSION}"
./gh-actions-scripts/build-helm-charts.sh "${VERSION}" "${VERSION}" "${KEPTN_SPEC_VERSION}" "keptn"
fi
- name: Upload Helm Chart as an artifact
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/check-docker-image-digests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Check Docker Image Digests
on:
workflow_dispatch:
schedule:
- cron: '0 5 * * *'
defaults:
run:
shell: bash
jobs:
check:
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/[email protected]

- name: Check docker image digests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gh-actions-scripts/check-image-digests.sh
95 changes: 0 additions & 95 deletions .github/workflows/create_release_branch.yml

This file was deleted.

8 changes: 0 additions & 8 deletions .github/workflows/dco.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/dependencies-and-licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Set up Node
uses: actions/[email protected]
with:
node-version: 14
node-version: 16
- name: Install npm libs
run: |
yarn global add license-report
Expand Down
Loading

0 comments on commit b991724

Please sign in to comment.