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

Commit fe69ded

Browse files
committed
ci: Introduce release automation (#4587)
1 parent 91b933a commit fe69ded

18 files changed

+315
-111
lines changed

.github/pull_request_template.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!-- Please use this template for your pull request. -->
2+
<!-- Please use the sections that you need and delete other sections -->
3+
4+
## This PR
5+
<!-- add the description of the PR here -->
6+
7+
- adds this new feature
8+
9+
### Related Issues
10+
<!-- add here the GitHub issue that this PR resolves if applicable -->
11+
12+
Fixes #1234523
13+
14+
### Notes
15+
<!-- any additional notes for this PR -->
16+
17+
### Follow-up Tasks
18+
<!-- anything that is related to this PR but not done here should be noted under this section -->
19+
<!-- if there is a need for a new issue, please link it here -->
20+
21+
### How to test
22+
<!-- if applicable, add testing instructions under this section -->
23+

.github/semantic.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
titleOnly: true
2+
types:
3+
- feat # A new feature
4+
- fix # A bug fix
5+
- build # Changes that affect the build system or external dependencies
6+
- chore # Other changes that don't modify src or test files
7+
- ci # Changes to our CI configuration files and scripts
8+
- docs # Documentation only changes
9+
- perf # A code change that improves performance
10+
- refactor # A code change that neither fixes a bug nor adds a feature
11+
- revert # Reverts a previous commit
12+
- style # Changes that do not affect the meaning of the code
13+
- test # Adding missing tests or correcting existing tests

.github/workflows/pre-release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Pre-Release
2+
on:
3+
workflow_dispatch:
4+
env:
5+
NODE_VERSION: 14
6+
KEPTN_BOT_NAME: "Keptn Bot"
7+
KEPTN_BOT_EMAIL: "keptn-bot <86361500+keptn-bot@users.noreply.github.com>"
8+
RELEASE_NOTES_FILE: "RELEASE-BODY.md"
9+
PRERELEASE_KEYWORD: "next"
10+
defaults:
11+
run:
12+
shell: bash
13+
jobs:
14+
pre-release:
15+
name: Pre-Release
16+
runs-on: ubuntu-20.04
17+
steps:
18+
- name: Checkout repo
19+
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Set up Node.js
24+
uses: actions/setup-node@v2
25+
with:
26+
node-version: ${{ env.NODE_VERSION }}
27+
28+
- name: Configure Git
29+
env:
30+
KEPTN_BOT_NAME: ${{ env.KEPTN_BOT_NAME }}
31+
KEPTN_BOT_EMAIL: ${{ env.KEPTN_BOT_EMAIL }}
32+
run: |
33+
git config user.name "$KEPTN_BOT_NAME"
34+
git config user.email "$KEPTN_BOT_EMAIL"
35+
36+
- name: Prepare GitHub Release Notes
37+
run: |
38+
npx standard-version@^9.3.1 --prerelease "${{ env.PRERELEASE_KEYWORD }}" -i "${{ env.RELEASE_NOTES_FILE }}" --skip.commit --skip.tag --header ""
39+
40+
- name: Enhance Release Notes with Build Metadata
41+
run: |
42+
echo "#### Build Information" >> "${{ env.RELEASE_NOTES_FILE }}"
43+
echo "" >> "${{ env.RELEASE_NOTES_FILE }}"
44+
echo "**GitHub Actions Run:** $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> "${{ env.RELEASE_NOTES_FILE }}"
45+
46+
- name: Create pre-release package
47+
id: create-release-package
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.KEPTN_BOT_TOKEN }}
50+
run: |
51+
echo "🚀 Creating pre-release package now..."
52+
npx standard-version@^9.3.1 --prerelease "${{ env.PRERELEASE_KEYWORD }}" --skip.commit --skip.changelog
53+
54+
echo "::set-output name=tag-name::$(git describe --tags --abbrev=0)"
55+
echo "⚡️ Pushing changes to remote repository..."
56+
git push --follow-tags
57+
58+
- name: Create GitHub Release
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.KEPTN_BOT_TOKEN }}
61+
RELEASE_TAG: ${{ steps.create-release-package.outputs.tag-name }}
62+
run: |
63+
gh release create "$RELEASE_TAG" --prerelease --notes-file "${{ env.RELEASE_NOTES_FILE }}" --title "$RELEASE_TAG"

.github/workflows/release.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
env:
5+
NODE_VERSION: 14
6+
KEPTN_BOT_NAME: "Keptn Bot"
7+
KEPTN_BOT_EMAIL: "keptn-bot <86361500+keptn-bot@users.noreply.github.com>"
8+
RELEASE_NOTES_FILE: "RELEASE-BODY.md"
9+
defaults:
10+
run:
11+
shell: bash
12+
jobs:
13+
release:
14+
name: "Release"
15+
runs-on: ubuntu-20.04
16+
steps:
17+
- name: Checkout repo
18+
uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: ${{ env.NODE_VERSION }}
26+
27+
- name: Configure Git
28+
env:
29+
KEPTN_BOT_NAME: ${{ env.KEPTN_BOT_NAME }}
30+
KEPTN_BOT_EMAIL: ${{ env.KEPTN_BOT_EMAIL }}
31+
run: |
32+
git config user.name "$KEPTN_BOT_NAME"
33+
git config user.email "$KEPTN_BOT_EMAIL"
34+
35+
- name: Prepare GitHub Release Notes
36+
run: |
37+
# Delete pre-release tags to be able to generate a changelog from last 'real' release
38+
# This is a workaround for a known limitation of standard-version
39+
# Reference: https://github.com/conventional-changelog/standard-version/issues/203#issuecomment-872415140
40+
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
41+
42+
npx standard-version@^9.3.1 -i "${{ env.RELEASE_NOTES_FILE }}" --skip.commit --skip.tag --header ""
43+
44+
- name: Temporarily disable "include administrators" branch protection
45+
uses: benjefferies/branch-protection-bot@6d0ac2b2d9bfd39794b017f8241adb7da7f0ab98 # pin@1.0.7
46+
with:
47+
access_token: ${{ secrets.KEPTN_BOT_TOKEN }}
48+
branch: ${{ github.event.repository.default_branch }}
49+
enforce_admins: false
50+
51+
- name: Create release package
52+
id: create-release-package
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.KEPTN_BOT_TOKEN }}
55+
run: |
56+
echo "🚀 Creating release package now..."
57+
npx standard-version@^9.3.1
58+
59+
echo "::set-output name=tag-name::$(git describe --tags --abbrev=0)"
60+
61+
echo "Fetching previously deleted old tags..."
62+
git fetch origin --tags -f
63+
echo "⚡️ Pushing changes to remote repository..."
64+
git push --follow-tags
65+
66+
- name: Enable "include administrators" branch protection
67+
uses: benjefferies/branch-protection-bot@6d0ac2b2d9bfd39794b017f8241adb7da7f0ab98 # pin@1.0.7
68+
if: always() # Force to always run this step to ensure "include administrators" is always turned back on
69+
with:
70+
access_token: ${{ secrets.KEPTN_BOT_TOKEN }}
71+
branch: ${{ github.event.repository.default_branch }}
72+
enforce_admins: true
73+
74+
- name: Create GitHub Release
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.KEPTN_BOT_TOKEN }}
77+
RELEASE_TAG: ${{ steps.create-release-package.outputs.tag-name }}
78+
run: |
79+
gh release create "$RELEASE_TAG" --draft --notes-file "${{ env.RELEASE_NOTES_FILE }}" --title "$RELEASE_TAG"

.versionrc.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"preMajor": true,
3+
"scripts": {
4+
"postchangelog": "./gh-actions-scripts/post-changelog-actions.sh"
5+
},
6+
"types": [
7+
{
8+
"type": "feat",
9+
"section": "Features"
10+
},
11+
{
12+
"type": "fix",
13+
"section": "Bug Fixes"
14+
},
15+
{
16+
"type": "chore",
17+
"section": "Other"
18+
},
19+
{
20+
"type": "docs",
21+
"section": "Docs"
22+
},
23+
{
24+
"type": "perf",
25+
"section": "Performance"
26+
},
27+
{
28+
"type": "build",
29+
"hidden": true
30+
},
31+
{
32+
"type": "ci",
33+
"hidden": true
34+
},
35+
{
36+
"type": "refactor",
37+
"section": "Refactoring"
38+
},
39+
{
40+
"type": "revert",
41+
"hidden": true
42+
},
43+
{
44+
"type": "style",
45+
"hidden": true
46+
},
47+
{
48+
"type": "test",
49+
"hidden": true
50+
}
51+
]
52+
}

CHANGELOG.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Changelog
2+
3+
## [0.9.0](https://github.com/keptn/examples/compare/0.8.4...0.9.0)
4+
5+
This release has been created to keep the version of the examples in sync with the Keptn release version.
6+
7+
## [0.8.4](https://github.com/keptn/examples/compare/0.8.3...0.8.4)
8+
9+
### Bug Fixes
10+
11+
- Updated Istio Ingress API Version from `networking.k8s.io/v1beta1` to `networking.k8s.io/v1` #174
12+
13+
## [0.8.3](https://github.com/keptn/examples/compare/0.8.2...0.8.3)
14+
15+
### Features
16+
17+
- Added SLO and shipyard files and for Dynatrace self healing example #165
18+
- Added time frame for evaluation of remediation action (part of [#4079](https://github.com/keptn/keptn/issues/4079))
19+
20+
### Fixed issues
21+
22+
- Improve output of `configure-istio.sh` script #157
23+
24+
## [0.8.2](https://github.com/keptn/examples/compare/0.8.1...0.8.2)
25+
26+
This release has been created to keep the version of the examples in sync with the Keptn release version.
27+
28+
## [0.8.1](https://github.com/keptn/examples/compare/0.8.0...0.8.1)
29+
30+
This release has been created to keep the version of the examples in sync with the Keptn release version.
31+
32+
## [0.8.0](https://github.com/keptn/examples/compare/0.7.3...0.8.0)
33+
34+
Note: Update of License file [#151](https://github.com/keptn/examples/issues/151)
35+
36+
### Features
37+
38+
- Update of Shipyard files according to new specification [#143](https://github.com/keptn/examples/issues/143)
39+
- Deleted obsolete installation scripts for Dynatrace OneAgent
40+
- Updated Istio configuration scripts
41+
42+
### Fixed issues
43+
44+
- Fixed SLI Config for Prometheus [#152](https://github.com/keptn/examples/issues/152)
45+
46+
47+
## [0.7.3](https://github.com/keptn/examples/compare/0.7.2...0.7.3)
48+
49+
### Bug Fixes
50+
51+
- Set URL of Dynatrace OneAgent Operator in OpenShift script to: `release-0.8` instead of `master`
52+
53+
## 0.7.2
54+
55+
### Features
56+
57+
- Added install script for the Dynatrace OneAgent on OpenShift

README.md

Lines changed: 15 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,63 +10,36 @@ Maintained examples are updated with every [Keptn release](https://github.com/ke
1010

1111
### Carts
1212

13-
|Name | Version | Description |
14-
------------- | ------------- | ------------ |
15-
| **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). |
16-
| **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). |
17-
| **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). |
18-
| **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). |
19-
| **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). |
20-
| **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). |
21-
| **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. |
22-
| **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). |
23-
| **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). |
24-
| **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). |
25-
| **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). |
26-
| **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/). |
27-
| **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/). |
28-
| **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/). |
29-
| **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/). |
13+
This example allows to demonstrate the [Keptn tutorials](https://tutorials.keptn.sh).
3014

3115
You can find the source code of the carts microservice at https://github.com/keptn-sockshop/carts
3216

3317
#### Load Generator for Carts
3418

3519
The following commands will set up a basic load generator for the carts microservice that generates traffic in **all three stages**:
3620

37-
* Keptn 0.7.x, 0.8.x and 0.9.x:
38-
* Basic (Background traffic)
39-
```console
40-
kubectl apply -f https://raw.githubusercontent.com/keptn/examples/release-0.8.2/load-generation/cartsloadgen/deploy/cartsloadgen-base.yaml
41-
```
42-
* More traffic
43-
```console
44-
kubectl apply -f https://raw.githubusercontent.com/keptn/examples/release-0.8.2/load-generation/cartsloadgen/deploy/cartsloadgen-fast.yaml
45-
```
46-
* Faulty item in cart (generates cpu usage)
47-
```console
48-
kubectl apply -f https://raw.githubusercontent.com/keptn/examples/release-0.8.2/load-generation/cartsloadgen/deploy/cartsloadgen-faulty.yaml
49-
```
21+
* Basic (Background traffic)
22+
```console
23+
kubectl apply -f https://raw.githubusercontent.com/keptn/examples/master/load-generation/cartsloadgen/deploy/cartsloadgen-base.yaml
24+
```
25+
* More traffic
26+
```console
27+
kubectl apply -f https://raw.githubusercontent.com/keptn/examples/master/load-generation/cartsloadgen/deploy/cartsloadgen-fast.yaml
28+
```
29+
* Faulty item in cart (generates cpu usage)
30+
```console
31+
kubectl apply -f https://raw.githubusercontent.com/keptn/examples/master/load-generation/cartsloadgen/deploy/cartsloadgen-faulty.yaml
32+
```
5033

5134
### Unleash
5235

53-
|Name | Version | Description |
54-
------------- | ------------- | ------------ |
55-
| **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). |
56-
| **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). |
57-
| **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). |
58-
| **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/). |
36+
This example allows to demonstrate the [Self-healing with Feature Flags tutorials](https://tutorials.keptn.sh).
5937

6038
You can find the source of the unleash service at https://github.com/keptn-sockshop/unleash-server
6139

6240
### Simplenodeservice
6341

64-
|Name | Version | Description |
65-
------------- | ------------- | ------------ |
66-
| **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) |
67-
| **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) |
68-
| **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) |
69-
| **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) |
42+
This example is used for some of the [Keptn tutorials](https://tutorials.keptn.sh).
7043

7144
More information about this simple node.js based example application can be found here: [Simplenodeservice README](./simplenodeservice/README.md)
7245

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
echo "Removing sign-off messages from changelog..."
4+
for file in {CHANGELOG,RELEASE-BODY}.md; do
5+
if [ -f "$file" ]; then
6+
echo "Replacing content in $file"
7+
# Reference: https://stackoverflow.com/a/1252191
8+
sed -e ':a' -e 'N' -e '$!ba' -e 's/\nSigned-off-by: .* <.*@.*>\n/ /g' "$file" > tmp
9+
mv tmp "$file"
10+
else
11+
echo "Not replacing anything since $file does not exist."
12+
fi
13+
done

releasenotes/releasenotes_V0.7.2.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

releasenotes/releasenotes_V0.7.3.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)