Skip to content

Commit 785c12d

Browse files
committed
Add script to zip release
This script exists on master. However getting those changes could be difficult... OHM-929
1 parent b2184d7 commit 785c12d

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

packaging/build-release-zip.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
if (( $# < 1)); then
6+
echo "OpenHIM release build: Builds a specific tagged release ready for deployment";
7+
echo "Usage: $0 TAG";
8+
exit 0;
9+
fi
10+
11+
tag=$1;
12+
shift;
13+
14+
echo "NB!"
15+
echo "To create the tagged build, various git interactions need to take place. "
16+
echo "This will create a temporary branch as well as remove any changes you have havent yet committed"
17+
read -p "Do you wish to proceed? [Y/y]" -n 1 -r
18+
19+
echo ""
20+
21+
if [[ $REPLY =~ ^[Yy]$ ]]; then
22+
cd ../
23+
24+
echo "Git: setup branch/tag"
25+
git checkout -- .
26+
git checkout master
27+
git pull origin master
28+
git fetch --tags
29+
git checkout tags/$tag -b "build-release-$tag"
30+
31+
echo "npm: clean and build package"
32+
rm -rf node_modules
33+
npm install
34+
npm run build
35+
36+
echo "zip: build release version: $tag"
37+
zip \
38+
-i 'lib/*' 'config/*' 'node_modules/*' 'docs/*' 'resources/*' 'CHANGELOG.md' 'LICENSE' 'package.json' 'package-lock.json' 'README.md' \
39+
-r packaging/build.openhim-core.$tag.zip .
40+
41+
echo "Git cleanup"
42+
git checkout -- .
43+
git checkout master
44+
git branch -D "build-release-$tag"
45+
46+
echo "New OpenHIM Core build zipped";
47+
fi

0 commit comments

Comments
 (0)