-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall.sh
executable file
·31 lines (25 loc) · 955 Bytes
/
install.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
#!/bin/bash
usage () {
echo -e "Usage: install.sh [SERVER]\n"
echo -e "Installs the configuration to SERVER, where a server is the name of an OpenMRS SDK instance at path '~/openmrs/[SERVER]'\n"
echo -e "Also first installs the parent config if it is at ../openmrs-config-pihemr or ../config-pihemr.\n"
echo -e "Example: ./install.sh mirebalais\n"
}
mvn_install() {
mvn clean install
}
if [ $# -eq 0 ]; then
echo -e "Please provide the name of the server to install to as a command line argument.\n"
usage
exit 1
fi
# if there's a "config-pihemr" or "openmrs-config-pihemr" directory at the same level as this project,
# run the install for it
if [[ -d '../config-pihemr' ]]; then
(cd ../config-pihemr && mvn_install)
elif [[ -d '../openmrs-config-pihemr' ]]; then
(cd ../openmrs-config-pihemr && mvn_install)
else
echo "Unable to find PIH-EMR config, skipping building it"
fi
mvn clean compile -DserverId=$1