Use a pluggable branch
continuous-integration/drone/push Build is passing Details

This commit is contained in:
decentral1se 2021-06-03 22:02:25 +02:00
parent d9ede0ea0d
commit d0d9e11b0b
No known key found for this signature in database
GPG Key ID: 92DAD76BD9567B8A
2 changed files with 7 additions and 3 deletions

View File

@ -8,9 +8,13 @@ Use [`abra`](https://git.autonomic.zone/coop-cloud/abra) as a [Drone plugin](htt
### Required (no default)
- **deploy_key**: SSH private key part for running `git push` related commands
- **command**: The command to run (passed to `abra` executable)
### Optional
- **deploy_key**: SSH private key part for running `git push` related commands
- **recipe_branch** (default: `main`): The target branch to use for recipe release `git push` operations
## Example
```yaml

View File

@ -4,6 +4,7 @@ set -e
ABRA=/root/.local/bin/abra
PLUGIN_BRANCH=${PLUGIN_BRANCH:-main}
PLUGIN_HOST=${PLUGIN_HOST:-git.autonomic.zone}
PLUGIN_PORT=${PLUGIN_PORT:-2222}
@ -37,8 +38,7 @@ run_abra_cmd() {
git remote rm origin && \
git remote add origin "ssh://git@git.autonomic.zone:2222/coop-cloud/$recipe.git"
git checkout main && git push --set-upstream origin main > /dev/null 2>&1 || \
git checkout master && git push --set-upstream origin master > /dev/null 2>&1
git push --set-upstream origin "$PLUGIN_BRANCH"
fi
# shellcheck disable=SC2086