1
+ #! /bin/bash
1
2
# based on docs here: https://heigit.atlassian.net/wiki/spaces/OQT/pages/3474149/Releases
2
3
# requires local installation of `gh`, the github CLI: https://cli.github.com
3
4
@@ -9,14 +10,14 @@ export NEW_VERSION=1.8.1
9
10
10
11
11
12
# exit immediately if a command exits with a non-zero status
12
- set -ex
13
+ set -e
13
14
14
15
15
16
# get the directory of the current script
16
17
SCRIPT_DIR=" $( dirname " $0 " ) "
17
18
18
19
# import user prompt
19
- source " $SCRIPT_DIR /prompt_user_exit_or_continue .sh"
20
+ source " $SCRIPT_DIR /functions .sh"
20
21
21
22
22
23
prompt_user " 👉 did you adjust the values for old and new versions in the release script?"
@@ -26,7 +27,7 @@ prompt_user "👉 do you run this script in an active python env? if not run 'po
26
27
27
28
28
29
# change to main directory
29
- cd ..
30
+ cd $SCRIPT_DIR / ..
30
31
31
32
32
33
# get latest version of main and create new branch
@@ -56,14 +57,14 @@ export NEW="__version__ = \"$NEW_VERSION\""
56
57
57
58
58
59
# might not work like this on linux
59
- sed -i .bak " s/$OLD /$NEW /g" ohsome_quality_api/__init__.py
60
+ run_sed " s/$OLD /$NEW /g" ohsome_quality_api/__init__.py
60
61
rm -rf ohsome_quality_api/__init__.py.bak
61
62
echo " ✅ updated __init__.py to $NEW_VERSION "
62
63
63
64
64
65
# insert new sub-headline for new release
65
66
prompt_user " 👉 update CHANGELOG.md?"
66
- sed -i .bak " s/## Current Main/## Current Main \n\n## Release $NEW_VERSION /g" CHANGELOG.md
67
+ run_sed " s/## Current Main/## Current Main\n\n## Release $NEW_VERSION /g" CHANGELOG.md
67
68
rm -rf CHANGELOG.md.bak
68
69
echo " ✅ updated CHANGELOG.md"
69
70
@@ -108,4 +109,12 @@ echo "✅ created new github release and tag for version: $NEW_VERSION"
108
109
109
110
110
111
111
- echo " ⚠️ Please start the Jenkins tag build here: https://jenkins.heigit.org/job/OQAPI/view/tags/job/$NEW_VERSION /"
112
+ JENKINS_URL=" https://jenkins.heigit.org/job/OQAPI/view/tags/job/${NEW_VERSION} /"
113
+ echo " ⚠️ Please start the Jenkins tag build here: ${JENKINS_URL} "
114
+ if [[ " $OSTYPE " == " linux-gnu" * ]]; then
115
+ xdg-open " $JENKINS_URL "
116
+ elif [[ " $OSTYPE " == " darwin" * ]]; then
117
+ open " $JENKINS_URL "
118
+ else
119
+ printf " \nOS could not be detected. Please open report manually!\n"
120
+ fi
0 commit comments