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

Commit

Permalink
feat: Release helm charts on GitHub pages (#6559)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mowies committed Jan 20, 2022
1 parent 26bf933 commit efc285e
Show file tree
Hide file tree
Showing 27 changed files with 201 additions and 757 deletions.
67 changes: 56 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,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/github-action-get-previous-tag@v1.1"
- name: 'Get next patch version'
id: get_next_semver_tag
uses: "WyriHaximus/github-action-next-semvers@v1.1"
with:
version: ${{ steps.get_previous_tag.outputs.tag }}
- name: Get the version
id: get_version
env:
Expand All @@ -184,9 +176,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 @@ -357,6 +355,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')
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 <86361500+keptn-bot@users.noreply.github.com>"
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
95 changes: 0 additions & 95 deletions .github/workflows/create_release_branch.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/setup-node@v2.5.1
with:
node-version: 14
node-version: 16
- name: Install npm libs
run: |
yarn global add license-report
Expand Down
46 changes: 28 additions & 18 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
description: 'Can be one of [major,minor,patch]. CAUTION: This will enforce a new pre-release with the specified semantic version type bumped.'
required: false
env:
NODE_VERSION: 14
NODE_VERSION: 16
KEPTN_BOT_NAME: "Keptn Bot"
KEPTN_BOT_EMAIL: "keptn-bot <86361500+keptn-bot@users.noreply.github.com>"
RELEASE_NOTES_FILE: "RELEASE-BODY.md"
Expand Down Expand Up @@ -280,6 +280,15 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
path: keptn
token: ${{ secrets.KEPTN_BOT_TOKEN }}

- name: Checkout helm-charts repo
uses: actions/checkout@v2
with:
repository: keptn/helm-charts
path: helm-charts
ref: gh-pages
token: ${{ secrets.KEPTN_BOT_TOKEN }}

- name: Set up Node.js
Expand All @@ -292,15 +301,16 @@ jobs:
KEPTN_BOT_NAME: ${{ env.KEPTN_BOT_NAME }}
KEPTN_BOT_EMAIL: ${{ env.KEPTN_BOT_EMAIL }}
run: |
git config user.name "$KEPTN_BOT_NAME"
git config user.email "$KEPTN_BOT_EMAIL"
git config --global user.name "$KEPTN_BOT_NAME"
git config --global user.email "$KEPTN_BOT_EMAIL"
- name: Download Pre-Release Artifacts
uses: actions/download-artifact@v2
with:
path: ./dist

- name: Prepare GitHub Pre-Release Notes
working-directory: keptn
env:
SEMVER_TYPE: ${{ github.event.inputs.semver-type }}
run: |
Expand Down Expand Up @@ -330,6 +340,7 @@ jobs:

- name: Create pre-release package
id: create-release-package
working-directory: keptn
env:
SEMVER_TYPE: ${{ github.event.inputs.semver-type }}
GITHUB_TOKEN: ${{ secrets.KEPTN_BOT_TOKEN }}
Expand Down Expand Up @@ -363,35 +374,34 @@ jobs:
enforce_admins: true

- name: Create GitHub Pre-Release
working-directory: keptn
env:
GITHUB_TOKEN: ${{ secrets.KEPTN_BOT_TOKEN }}
RELEASE_TAG: ${{ steps.create-release-package.outputs.tag-name }}
run: |
gh release create "$RELEASE_TAG" --draft --prerelease --notes-file "${{ env.RELEASE_NOTES_FILE }}" --title "$RELEASE_TAG"
- name: Upload Release Assets
working-directory: keptn
env:
GITHUB_TOKEN: ${{ secrets.KEPTN_BOT_TOKEN }}
RELEASE_TAG: ${{ steps.create-release-package.outputs.tag-name }}
run: |
gh release upload "$RELEASE_TAG" ./dist/keptn-installer/*.tgz
gh release upload "$RELEASE_TAG" ./dist/keptn-cli/*.tar.gz
gh release upload "$RELEASE_TAG" ../dist/keptn-installer/*.tgz
gh release upload "$RELEASE_TAG" ../dist/keptn-cli/*.tar.gz
- name: Upload Helm Charts to Google Cloud
id: upload_helm_charts
- name: Upload helm charts
env:
GCLOUD_SERVICE_KEY: ${{ secrets.GCLOUD_SERVICE_KEY }}
GCLOUD_PROJECT_NAME: ${{ secrets.GCLOUD_PROJECT_NAME }}
CLOUDSDK_COMPUTE_ZONE: "us-east1-b"
CLOUDSDK_REGION: "us-east1"
ARTIFACTS: "./dist/keptn-installer/*.tgz"
RELEASE_TAG: ${{ steps.create-release-package.outputs.tag-name }}
run: |
echo "Installing GCloud CLI"
export OS_TYPE="linux"
mkdir ~/downloads
./test/utils/download_and_install_gcloud.sh
echo ${GCLOUD_SERVICE_KEY} | base64 --decode > ~/gcloud-service-key.json
gcloud auth activate-service-account --key-file ~/gcloud-service-key.json
gh-actions-scripts/upload_helm_chart_to_google_cloud.sh dist/keptn-installer/
mv "$ARTIFACTS" ./helm-charts/packages
cd ./helm-charts
helm repo index ./ --url https://charts.keptn.sh/ --merge ./index.yaml
git add *.tgz
git add index.yaml
git commit --signoff -m "Keptn Release $RELEASE_TAG"
git push
- name: Attach docker image digests to release
env:
Expand Down
46 changes: 28 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
description: 'Can be one of [major,minor,patch]. CAUTION: This will enforce a new release with the specified semantic version type bumped.'
required: false
env:
NODE_VERSION: 14
NODE_VERSION: 16
KEPTN_BOT_NAME: "Keptn Bot"
KEPTN_BOT_EMAIL: "keptn-bot <86361500+keptn-bot@users.noreply.github.com>"
RELEASE_NOTES_FILE: "RELEASE-BODY.md"
Expand Down Expand Up @@ -277,6 +277,15 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
path: keptn
token: ${{ secrets.KEPTN_BOT_TOKEN }}

- name: Checkout helm-charts repo
uses: actions/checkout@v2
with:
repository: keptn/helm-charts
path: helm-charts
ref: gh-pages
token: ${{ secrets.KEPTN_BOT_TOKEN }}

- name: Set up Node.js
Expand All @@ -289,15 +298,16 @@ jobs:
KEPTN_BOT_NAME: ${{ env.KEPTN_BOT_NAME }}
KEPTN_BOT_EMAIL: ${{ env.KEPTN_BOT_EMAIL }}
run: |
git config user.name "$KEPTN_BOT_NAME"
git config user.email "$KEPTN_BOT_EMAIL"
git config --global user.name "$KEPTN_BOT_NAME"
git config --global user.email "$KEPTN_BOT_EMAIL"
- name: Download Release Artifacts
uses: actions/download-artifact@v2
with:
path: ./dist

- name: Prepare GitHub Release Notes
working-directory: keptn
env:
SEMVER_TYPE: ${{ github.event.inputs.semver-type }}
run: |
Expand Down Expand Up @@ -330,6 +340,7 @@ jobs:

- name: Create release package
id: create-release-package
working-directory: keptn
env:
SEMVER_TYPE: ${{ github.event.inputs.semver-type }}
GITHUB_TOKEN: ${{ secrets.KEPTN_BOT_TOKEN }}
Expand Down Expand Up @@ -359,35 +370,34 @@ jobs:
enforce_admins: true

- name: Create GitHub Release
working-directory: keptn
env:
GITHUB_TOKEN: ${{ secrets.KEPTN_BOT_TOKEN }}
RELEASE_TAG: ${{ steps.create-release-package.outputs.tag-name }}
run: |
gh release create "$RELEASE_TAG" --draft --notes-file "${{ env.RELEASE_NOTES_FILE }}" --title "$RELEASE_TAG"
- name: Upload Release Assets
working-directory: keptn
env:
GITHUB_TOKEN: ${{ secrets.KEPTN_BOT_TOKEN }}
RELEASE_TAG: ${{ steps.create-release-package.outputs.tag-name }}
run: |
gh release upload "$RELEASE_TAG" ./dist/keptn-installer/*.tgz
gh release upload "$RELEASE_TAG" ./dist/keptn-cli/*.tar.gz
gh release upload "$RELEASE_TAG" ../dist/keptn-installer/*.tgz
gh release upload "$RELEASE_TAG" ../dist/keptn-cli/*.tar.gz
- name: Upload Helm Charts to Google Cloud
id: upload_helm_charts
- name: Upload helm charts
env:
GCLOUD_SERVICE_KEY: ${{ secrets.GCLOUD_SERVICE_KEY }}
GCLOUD_PROJECT_NAME: ${{ secrets.GCLOUD_PROJECT_NAME }}
CLOUDSDK_COMPUTE_ZONE: "us-east1-b"
CLOUDSDK_REGION: "us-east1"
ARTIFACTS: "./dist/keptn-installer/*.tgz"
RELEASE_TAG: ${{ steps.create-release-package.outputs.tag-name }}
run: |
echo "Installing GCloud CLI"
export OS_TYPE="linux"
mkdir ~/downloads
./test/utils/download_and_install_gcloud.sh
echo ${GCLOUD_SERVICE_KEY} | base64 --decode > ~/gcloud-service-key.json
gcloud auth activate-service-account --key-file ~/gcloud-service-key.json
gh-actions-scripts/upload_helm_chart_to_google_cloud.sh dist/keptn-installer/
mv "$ARTIFACTS" ./helm-charts/packages
cd ./helm-charts
helm repo index ./ --url https://charts.keptn.sh/ --merge ./index.yaml
git add *.tgz
git add index.yaml
git commit --signoff -m "Keptn Release $RELEASE_TAG"
git push
- name: Attach docker image digests to release
env:
Expand Down
Loading

0 comments on commit efc285e

Please sign in to comment.