1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-10-30 23:57:50 +02:00

Allow to trigger release manually (#1359)

This commit is contained in:
Florian Wilhelm
2020-04-03 16:26:53 +02:00
committed by GitHub
parent 00b80f0247
commit f482f439b0
4 changed files with 29 additions and 0 deletions

View File

@@ -1,6 +1,8 @@
name: Create new Release
on:
repository_dispatch:
types: perform-release
schedule:
- cron: '0 9 * * 1'

View File

@@ -8,6 +8,7 @@
1. [Logging](#logging)
1. [Error handling](#error-handling)
1. [Debugging](#debugging)
1. [Release](#release)
## Getting started
@@ -197,3 +198,11 @@ Modify the `launch.json` located in folder `.vscode` of your project root to poi
```
Finally set your breakpoints and use the `Launch` button in the VS code UI to start debugging.
## Release
Releases are performed using [Project "Piper" Action](https://github.com/SAP/project-piper-action).
We release on schedule (once a week) and on demand.
To perform a release, the respective action must be invoked for which a convenience script is available in `contrib/perform-release.sh`.
It requires a personal access token for GitHub with `repo` scope.
Example usage `PIPER_RELEASE_TOKEN=THIS_IS_MY_TOKEN contrib/perform-release.sh`.

18
contrib/perform-release.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/sh -e
# Manually trigger a release of project "Piper".
# Usually we do release on a schedule, but sometimes you might need to trigger a release.
# Invoke this script with PIPER_RELEASE_TOKEN set to your personal access token for GitHub with 'repo' scope.
# This script is based on https://goobar.io/2019/12/07/manually-trigger-a-github-actions-workflow/
if [ -z "$PIPER_RELEASE_TOKEN" ]
then
echo "Required variable PIPER_RELEASE_TOKEN is not set, please set a personal access token for GitHub with 'repo' scope."
exit 1
fi
curl -H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${PIPER_RELEASE_TOKEN}" \
--request POST \
--data '{"event_type": "perform-release"}' \
https://api.github.com/repos/SAP/jenkins-library/dispatches