-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path_updateBuildTools.sh
More file actions
executable file
·64 lines (52 loc) · 2.01 KB
/
Copy path_updateBuildTools.sh
File metadata and controls
executable file
·64 lines (52 loc) · 2.01 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
set -e
# Updates the tooling used to build the IGs:
#
# ./_updateBuildTools.sh -> update both
# ./_updateBuildTools.sh scripts -> only _build.sh / _build.bat
# ./_updateBuildTools.sh publisher -> only publisher.jar
#
# The build scripts are maintained by HL7 in
# https://github.com/HL7/ig-publisher-scripts. The copies in igs/base-<rx> are
# overwritten on every preprocessing run, so they are updated in ig-src, the
# source for the generated IGs. Run ./_preprocessMultiVersion.sh afterwards to
# propagate them to the generated IGs.
#
# The publisher.jar is placed in the parent directory of the generated IGs, so
# that all FHIR versions share a single copy.
cd "$(dirname "$0")"
scriptdlroot="https://raw.githubusercontent.com/HL7/ig-publisher-scripts/main"
publisher_dlurl="https://github.com/HL7/fhir-ig-publisher/releases/latest/download/publisher.jar"
publisher_jar="igs/publisher.jar"
update_scripts=false
update_publisher=false
case "${1:-all}" in
all) update_scripts=true ; update_publisher=true ;;
scripts) update_scripts=true ;;
publisher) update_publisher=true ;;
*)
echo "Usage: $0 [scripts|publisher]"
exit 1
;;
esac
if [ "$update_scripts" = true ]; then
for script in _build.sh _build.bat; do
echo "Downloading $script"
curl -fsSL "$scriptdlroot/$script" -o "ig-src/${script}.new"
mv "ig-src/${script}.new" "ig-src/$script"
done
chmod +x ig-src/_build.sh
echo "Build scripts updated in ig-src."
echo "Run ./_preprocessMultiVersion.sh to propagate them to the generated IGs."
fi
if [ "$update_publisher" = true ]; then
mkdir -p "$(dirname "$publisher_jar")"
echo "Downloading $publisher_jar (~200 MB)"
if ! curl -fL "$publisher_dlurl" -o "${publisher_jar}.new"; then
rm -f "${publisher_jar}.new"
echo "Downloading the IG Publisher failed. Aborting..."
exit 1
fi
mv "${publisher_jar}.new" "$publisher_jar"
echo "IG Publisher updated: $publisher_jar"
fi