forked from spinnaker/kork
-
Notifications
You must be signed in to change notification settings - Fork 1
/
autobump.sh
executable file
·37 lines (31 loc) · 969 Bytes
/
autobump.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
#
# wrapper script around running the merge or close auto bump PR
# gradle tasks (ensures publishing is enabled and simplifies the
# CLI for this specific use case).
#
# intended for use by a kork updater on their local dev environment
# after a kork release build has completed and the PRs are ready
# for merging (not intended as a CI type of script)
#
# to use, you will need github.token set in your
# ~/.gradle/gradle.properties file or GITHUB_TOKEN present as an
# environment variable
#
SCRIPT_DIR=`dirname $0`
GRADLE="$SCRIPT_DIR/gradlew -b $SCRIPT_DIR/build.gradle -PenablePublishing=true"
if [[ ! -z ${GITHUB_TOKEN} ]]; then
GRADLE="$GRADLE -Pgithub.token=$GITHUB_TOKEN"
fi
case $1 in
merge)
$GRADLE mergeAllAutoBumpPRs
;;
close)
$GRADLE closeAllAutoBumpPRs
;;
*)
echo "usage: $0 <merge|close>"
echo " merge - merge all mergeable kork autobump PRs"
echo " close - close all open kork autobump PRs"
esac