diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..ba5bde5 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,23 @@ + + + +## This PR + + +- adds this new feature + +### Related Issues + + +Fixes #1234523 + +### Notes + + +### Follow-up Tasks + + + +### How to test + + diff --git a/.github/semantic.yml b/.github/semantic.yml new file mode 100644 index 0000000..05c5328 --- /dev/null +++ b/.github/semantic.yml @@ -0,0 +1,13 @@ +titleOnly: true +types: + - feat # A new feature + - fix # A bug fix + - build # Changes that affect the build system or external dependencies + - chore # Other changes that don't modify src or test files + - ci # Changes to our CI configuration files and scripts + - docs # Documentation only changes + - perf # A code change that improves performance + - refactor # A code change that neither fixes a bug nor adds a feature + - revert # Reverts a previous commit + - style # Changes that do not affect the meaning of the code + - test # Adding missing tests or correcting existing tests diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml new file mode 100644 index 0000000..f7bd64b --- /dev/null +++ b/.github/workflows/pre-release.yml @@ -0,0 +1,63 @@ +name: Pre-Release +on: + workflow_dispatch: +env: + NODE_VERSION: 14 + KEPTN_BOT_NAME: "Keptn Bot" + KEPTN_BOT_EMAIL: "keptn-bot <86361500+keptn-bot@users.noreply.github.com>" + RELEASE_NOTES_FILE: "RELEASE-BODY.md" + PRERELEASE_KEYWORD: "next" +defaults: + run: + shell: bash +jobs: + pre-release: + name: Pre-Release + runs-on: ubuntu-20.04 + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Configure Git + env: + 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" + + - name: Prepare GitHub Release Notes + run: | + npx standard-version@^9.3.1 --prerelease "${{ env.PRERELEASE_KEYWORD }}" -i "${{ env.RELEASE_NOTES_FILE }}" --skip.commit --skip.tag --header "" + + - name: Enhance Release Notes with Build Metadata + run: | + echo "#### Build Information" >> "${{ env.RELEASE_NOTES_FILE }}" + echo "" >> "${{ env.RELEASE_NOTES_FILE }}" + echo "**GitHub Actions Run:** $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> "${{ env.RELEASE_NOTES_FILE }}" + + - name: Create pre-release package + id: create-release-package + env: + GITHUB_TOKEN: ${{ secrets.KEPTN_BOT_TOKEN }} + run: | + echo "🚀 Creating pre-release package now..." + npx standard-version@^9.3.1 --prerelease "${{ env.PRERELEASE_KEYWORD }}" --skip.commit --skip.changelog + + echo "::set-output name=tag-name::$(git describe --tags --abbrev=0)" + echo "⚡️ Pushing changes to remote repository..." + git push --follow-tags + + - name: Create GitHub Release + env: + GITHUB_TOKEN: ${{ secrets.KEPTN_BOT_TOKEN }} + RELEASE_TAG: ${{ steps.create-release-package.outputs.tag-name }} + run: | + gh release create "$RELEASE_TAG" --prerelease --notes-file "${{ env.RELEASE_NOTES_FILE }}" --title "$RELEASE_TAG" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2a1aa43 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,79 @@ +name: Release +on: + workflow_dispatch: +env: + NODE_VERSION: 14 + KEPTN_BOT_NAME: "Keptn Bot" + KEPTN_BOT_EMAIL: "keptn-bot <86361500+keptn-bot@users.noreply.github.com>" + RELEASE_NOTES_FILE: "RELEASE-BODY.md" +defaults: + run: + shell: bash +jobs: + release: + name: "Release" + runs-on: ubuntu-20.04 + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Configure Git + env: + 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" + + - name: Prepare GitHub Release Notes + run: | + # Delete pre-release tags to be able to generate a changelog from last 'real' release + # This is a workaround for a known limitation of standard-version + # Reference: https://github.com/conventional-changelog/standard-version/issues/203#issuecomment-872415140 + git tag -l | grep -vE '^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$' | xargs git tag -d + + npx standard-version@^9.3.1 -i "${{ env.RELEASE_NOTES_FILE }}" --skip.commit --skip.tag --header "" + + - name: Temporarily disable "include administrators" branch protection + uses: benjefferies/branch-protection-bot@6d0ac2b2d9bfd39794b017f8241adb7da7f0ab98 # pin@1.0.7 + with: + access_token: ${{ secrets.KEPTN_BOT_TOKEN }} + branch: ${{ github.event.repository.default_branch }} + enforce_admins: false + + - name: Create release package + id: create-release-package + env: + GITHUB_TOKEN: ${{ secrets.KEPTN_BOT_TOKEN }} + run: | + echo "🚀 Creating release package now..." + npx standard-version@^9.3.1 + + echo "::set-output name=tag-name::$(git describe --tags --abbrev=0)" + + echo "Fetching previously deleted old tags..." + git fetch origin --tags -f + echo "⚡️ Pushing changes to remote repository..." + git push --follow-tags + + - name: Enable "include administrators" branch protection + uses: benjefferies/branch-protection-bot@6d0ac2b2d9bfd39794b017f8241adb7da7f0ab98 # pin@1.0.7 + if: always() # Force to always run this step to ensure "include administrators" is always turned back on + with: + access_token: ${{ secrets.KEPTN_BOT_TOKEN }} + branch: ${{ github.event.repository.default_branch }} + enforce_admins: true + + - name: Create GitHub Release + 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" diff --git a/.versionrc.json b/.versionrc.json new file mode 100644 index 0000000..0c59595 --- /dev/null +++ b/.versionrc.json @@ -0,0 +1,52 @@ +{ + "preMajor": true, + "scripts": { + "postchangelog": "./gh-actions-scripts/post-changelog-actions.sh" + }, + "types": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "chore", + "section": "Other" + }, + { + "type": "docs", + "section": "Docs" + }, + { + "type": "perf", + "section": "Performance" + }, + { + "type": "build", + "hidden": true + }, + { + "type": "ci", + "hidden": true + }, + { + "type": "refactor", + "section": "Refactoring" + }, + { + "type": "revert", + "hidden": true + }, + { + "type": "style", + "hidden": true + }, + { + "type": "test", + "hidden": true + } + ] +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..40a18b1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,57 @@ +# Changelog + +## [0.9.0](https://github.com/keptn/examples/compare/0.8.4...0.9.0) + +This release has been created to keep the version of the examples in sync with the Keptn release version. + +## [0.8.4](https://github.com/keptn/examples/compare/0.8.3...0.8.4) + +### Bug Fixes + +- Updated Istio Ingress API Version from `networking.k8s.io/v1beta1` to `networking.k8s.io/v1` #174 + +## [0.8.3](https://github.com/keptn/examples/compare/0.8.2...0.8.3) + +### Features + +- Added SLO and shipyard files and for Dynatrace self healing example #165 +- Added time frame for evaluation of remediation action (part of [#4079](https://github.com/keptn/keptn/issues/4079)) + +### Fixed issues + +- Improve output of `configure-istio.sh` script #157 + +## [0.8.2](https://github.com/keptn/examples/compare/0.8.1...0.8.2) + +This release has been created to keep the version of the examples in sync with the Keptn release version. + +## [0.8.1](https://github.com/keptn/examples/compare/0.8.0...0.8.1) + +This release has been created to keep the version of the examples in sync with the Keptn release version. + +## [0.8.0](https://github.com/keptn/examples/compare/0.7.3...0.8.0) + +Note: Update of License file [#151](https://github.com/keptn/examples/issues/151) + +### Features + +- Update of Shipyard files according to new specification [#143](https://github.com/keptn/examples/issues/143) +- Deleted obsolete installation scripts for Dynatrace OneAgent +- Updated Istio configuration scripts + +### Fixed issues + +- Fixed SLI Config for Prometheus [#152](https://github.com/keptn/examples/issues/152) + + +## [0.7.3](https://github.com/keptn/examples/compare/0.7.2...0.7.3) + +### Bug Fixes + +- Set URL of Dynatrace OneAgent Operator in OpenShift script to: `release-0.8` instead of `master` + +## 0.7.2 + +### Features + +- Added install script for the Dynatrace OneAgent on OpenShift diff --git a/README.md b/README.md index 9fe66c3..f2e43ba 100644 --- a/README.md +++ b/README.md @@ -10,23 +10,7 @@ Maintained examples are updated with every [Keptn release](https://github.com/ke ### Carts -|Name | Version | Description | -------------- | ------------- | ------------ | -| **onboard-carts** | [0.9.0](https://github.com/keptn/examples/tree/release-0.9.0) | This example allows to demonstrate the [Keptn tutorials](https://tutorials.keptn.sh). | -| **onboard-carts** | [0.8.4](https://github.com/keptn/examples/tree/release-0.8.4) | This example allows to demonstrate the [Keptn tutorials](https://tutorials.keptn.sh). | -| **onboard-carts** | [0.8.3](https://github.com/keptn/examples/tree/release-0.8.3) | This example allows to demonstrate the [Keptn tutorials](https://tutorials.keptn.sh). | -| **onboard-carts** | [0.8.2](https://github.com/keptn/examples/tree/release-0.8.2) | This example allows to demonstrate the [Keptn tutorials](https://tutorials.keptn.sh). | -| **onboard-carts** | [0.8.1](https://github.com/keptn/examples/tree/release-0.8.1) | This example allows to demonstrate the [Keptn tutorials](https://tutorials.keptn.sh). | -| **onboard-carts** | [0.8.0](https://github.com/keptn/examples/tree/release-0.8.0) | This example allows to demonstrate the [Keptn tutorials](https://tutorials.keptn.sh). | -| **onboard-carts** | [0.8.0-alpha](https://github.com/keptn/examples/tree/release-0.8.0-alpha) | Examples for Keptn 0.8.0-alpha, no tutorial available yet. | -| **onboard-carts** | [0.7.3](https://github.com/keptn/examples/tree/release-0.7.3) | This example allows to demonstrate the [Keptn tutorials](https://tutorials.keptn.sh). | -| **onboard-carts** | [0.7.2](https://github.com/keptn/examples/tree/release-0.7.2) | This example allows to demonstrate the [Keptn tutorials](https://tutorials.keptn.sh). | -| **onboard-carts** | [0.7.1](https://github.com/keptn/examples/tree/release-0.7.1) | This example allows to demonstrate the [Keptn tutorials](https://tutorials.keptn.sh). | -| **onboard-carts** | [0.7.0](https://github.com/keptn/examples/tree/release-0.7.0) | This example allows to demonstrate the [Keptn tutorials](https://tutorials.keptn.sh). | -| **onboard-carts** | [0.6.2](https://github.com/keptn/examples/tree/release-0.6.2) | This example allows to demonstrate the [Keptn use cases](https://keptn.sh/docs/0.6.0/usecases/). | -| **onboard-carts** | [0.6.1](https://github.com/keptn/examples/tree/release-0.6.1) | This example allows to demonstrate the [Keptn use cases](https://keptn.sh/docs/0.6.0/usecases/). | -| **onboard-carts** | [0.6.0](https://github.com/keptn/examples/tree/release-0.6.0) | This example allows to demonstrate the [Keptn use cases](https://keptn.sh/docs/0.6.0/usecases/). | -| **onboard-carts** | [0.5.0](https://github.com/keptn/examples/tree/release-0.5.0) | This example allows to demonstrate the [Keptn use cases](https://keptn.sh/docs/0.5.0/usecases/). | +This example allows to demonstrate the [Keptn tutorials](https://tutorials.keptn.sh). You can find the source code of the carts microservice at https://github.com/keptn-sockshop/carts @@ -34,39 +18,28 @@ You can find the source code of the carts microservice at https://github.com/kep The following commands will set up a basic load generator for the carts microservice that generates traffic in **all three stages**: -* Keptn 0.7.x, 0.8.x and 0.9.x: - * Basic (Background traffic) - ```console - kubectl apply -f https://raw.githubusercontent.com/keptn/examples/release-0.8.2/load-generation/cartsloadgen/deploy/cartsloadgen-base.yaml - ``` - * More traffic - ```console - kubectl apply -f https://raw.githubusercontent.com/keptn/examples/release-0.8.2/load-generation/cartsloadgen/deploy/cartsloadgen-fast.yaml - ``` - * Faulty item in cart (generates cpu usage) - ```console - kubectl apply -f https://raw.githubusercontent.com/keptn/examples/release-0.8.2/load-generation/cartsloadgen/deploy/cartsloadgen-faulty.yaml - ``` +* Basic (Background traffic) + ```console + kubectl apply -f https://raw.githubusercontent.com/keptn/examples/master/load-generation/cartsloadgen/deploy/cartsloadgen-base.yaml + ``` +* More traffic + ```console + kubectl apply -f https://raw.githubusercontent.com/keptn/examples/master/load-generation/cartsloadgen/deploy/cartsloadgen-fast.yaml + ``` +* Faulty item in cart (generates cpu usage) + ```console + kubectl apply -f https://raw.githubusercontent.com/keptn/examples/master/load-generation/cartsloadgen/deploy/cartsloadgen-faulty.yaml + ``` ### Unleash -|Name | Version | Description | -------------- | ------------- | ------------ | -| **unleash-server** | [0.9.x](https://github.com/keptn/examples/tree/release-0.9.0) | This example allows to demonstrate the [Self-healing with Feature Flags tutorials](https://tutorials.keptn.sh). | -| **unleash-server** | [0.8.x](https://github.com/keptn/examples/tree/release-0.8.4) | This example allows to demonstrate the [Self-healing with Feature Flags tutorials](https://tutorials.keptn.sh). | -| **unleash-server** | [0.7.x](https://github.com/keptn/examples/tree/release-0.7.3) | This example allows to demonstrate the [Self-healing with Feature Flags tutorials](https://tutorials.keptn.sh). | -| **unleash-server** | [0.6.x](https://github.com/keptn/examples/tree/release-0.6.2) | This example allows to demonstrate the [Self-healing with Feature Flags usecase](https://keptn.sh/docs/0.6.0/usecases/self-healing-with-keptn/dynatrace-unleash/). | +This example allows to demonstrate the [Self-healing with Feature Flags tutorials](https://tutorials.keptn.sh). You can find the source of the unleash service at https://github.com/keptn-sockshop/unleash-server ### Simplenodeservice -|Name | Version | Description | -------------- | ------------- | ------------ | -| **simplenode** | [0.9.x](https://github.com/keptn/examples/tree/release-0.9.0) | This example is used for some of the [Keptn tutorials](https://tutorials.keptn.sh) | -| **simplenode** | [0.8.x](https://github.com/keptn/examples/tree/release-0.8.4) | This example is used for some of the [Keptn tutorials](https://tutorials.keptn.sh) | -| **simplenode** | [0.7.x](https://github.com/keptn/examples/tree/release-0.7.3) | This example is used for some of the [Keptn tutorials](https://tutorials.keptn.sh) | -| **simplenode** | [0.6.x](https://github.com/keptn/examples/tree/release-0.6.2) | This example is used for some of the [Keptn tutorials](https://tutorials.keptn.sh) | +This example is used for some of the [Keptn tutorials](https://tutorials.keptn.sh). More information about this simple node.js based example application can be found here: [Simplenodeservice README](./simplenodeservice/README.md) diff --git a/gh-actions-scripts/post-changelog-actions.sh b/gh-actions-scripts/post-changelog-actions.sh new file mode 100755 index 0000000..6ed872b --- /dev/null +++ b/gh-actions-scripts/post-changelog-actions.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +echo "Removing sign-off messages from changelog..." +for file in {CHANGELOG,RELEASE-BODY}.md; do + if [ -f "$file" ]; then + echo "Replacing content in $file" + # Reference: https://stackoverflow.com/a/1252191 + sed -e ':a' -e 'N' -e '$!ba' -e 's/\nSigned-off-by: .* <.*@.*>\n/ /g' "$file" > tmp + mv tmp "$file" + else + echo "Not replacing anything since $file does not exist." + fi +done diff --git a/releasenotes/releasenotes_V0.7.2.md b/releasenotes/releasenotes_V0.7.2.md deleted file mode 100644 index e6d0e0d..0000000 --- a/releasenotes/releasenotes_V0.7.2.md +++ /dev/null @@ -1,5 +0,0 @@ -# Release Notes 0.7.2 - -## New Features: - -- Added install script for the Dynatrace OneAgent on OpenShift \ No newline at end of file diff --git a/releasenotes/releasenotes_V0.7.3.md b/releasenotes/releasenotes_V0.7.3.md deleted file mode 100644 index 9d4752e..0000000 --- a/releasenotes/releasenotes_V0.7.3.md +++ /dev/null @@ -1,5 +0,0 @@ -# Release Notes 0.7.3 - -## Fixed Issues: - -- Set URL of Dynatrace OneAgent Operator in OpenShift script to: `release-0.8` instead of `master` \ No newline at end of file diff --git a/releasenotes/releasenotes_V0.8.0-alpha.md b/releasenotes/releasenotes_V0.8.0-alpha.md deleted file mode 100644 index f46878c..0000000 --- a/releasenotes/releasenotes_V0.8.0-alpha.md +++ /dev/null @@ -1,12 +0,0 @@ -# Release Notes 0.8.0-alpha - -Note: Update of License file #151 - -## New Features - -- Update of Shipyard files according to new specification #143 - -## Fixed issues - -- Fixed SLI Config for Prometheus #152 - diff --git a/releasenotes/releasenotes_V0.8.0.md b/releasenotes/releasenotes_V0.8.0.md deleted file mode 100644 index 6d847a3..0000000 --- a/releasenotes/releasenotes_V0.8.0.md +++ /dev/null @@ -1,15 +0,0 @@ -# Release Notes 0.8.0 - -Note: Update of License file [#151](https://github.com/keptn/examples/issues/151) - -## New Features - -- Update of Shipyard files according to new specification [#143](https://github.com/keptn/examples/issues/143) -- Deleted obsolete installation scripts for Dynatrace OneAgent -- Updated Istio configuration scripts - -## Fixed issues - -- Fixed SLI Config for Prometheus [#152](https://github.com/keptn/examples/issues/152) - - diff --git a/releasenotes/releasenotes_V0.8.1.md b/releasenotes/releasenotes_V0.8.1.md deleted file mode 100644 index 304cd7d..0000000 --- a/releasenotes/releasenotes_V0.8.1.md +++ /dev/null @@ -1,3 +0,0 @@ -# Release Notes 0.8.1 - -This release has been created to keep the version of the examples in sync with the Keptn release version. \ No newline at end of file diff --git a/releasenotes/releasenotes_V0.8.2.md b/releasenotes/releasenotes_V0.8.2.md deleted file mode 100644 index 3bb0537..0000000 --- a/releasenotes/releasenotes_V0.8.2.md +++ /dev/null @@ -1,3 +0,0 @@ -# Release Notes 0.8.2 - -This release has been created to keep the version of the examples in sync with the Keptn release version. \ No newline at end of file diff --git a/releasenotes/releasenotes_V0.8.3.md b/releasenotes/releasenotes_V0.8.3.md deleted file mode 100644 index 8a82475..0000000 --- a/releasenotes/releasenotes_V0.8.3.md +++ /dev/null @@ -1,11 +0,0 @@ -# Release Notes 0.8.3 - -## New Features - -- Added SLO and shipyard files and for Dynatrace self healing example #165 -- Added time frame for evaluation of remediation action (part of [#4079](https://github.com/keptn/keptn/issues/4079)) - -## Fixed issues - -- Improve output of `configure-istio.sh` script #157 - diff --git a/releasenotes/releasenotes_V0.8.4.md b/releasenotes/releasenotes_V0.8.4.md deleted file mode 100644 index addc96b..0000000 --- a/releasenotes/releasenotes_V0.8.4.md +++ /dev/null @@ -1,5 +0,0 @@ -# Release Notes 0.8.4 - -## Fixed Issues: - -- Updated Istio Ingress API Version from `networking.k8s.io/v1beta1` to `networking.k8s.io/v1` #174 \ No newline at end of file diff --git a/releasenotes/releasenotes_V0.9.0.md b/releasenotes/releasenotes_V0.9.0.md deleted file mode 100644 index 22cf15e..0000000 --- a/releasenotes/releasenotes_V0.9.0.md +++ /dev/null @@ -1,3 +0,0 @@ -# Release Notes 0.9.0 - -This release has been created to keep the version of the examples in sync with the Keptn release version. diff --git a/releasenotes/releasenotes_develop.md b/releasenotes/releasenotes_develop.md deleted file mode 100644 index 00b5af3..0000000 --- a/releasenotes/releasenotes_develop.md +++ /dev/null @@ -1,7 +0,0 @@ -# Release Notes develop - -## New Features - -## Fixed Issues - -## Known Limitations \ No newline at end of file