-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathsetup.sh
executable file
·34 lines (29 loc) · 930 Bytes
/
setup.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
#!/bin/bash
# Clean up previous build artifacts
echo "Cleaning up previous build artifacts ..."
rm -rf openmrs-config-amrs
rm -rf frontend
# Build assets
echo "Building AMRS 3.x assets ..."
CWD=$(pwd)
npx --legacy-peer-deps openmrs@next build \
--build-config ./configuration/build-config.json \
--target ./frontend \
--page-title "AMRS" \
--support-offline false
# Assemble assets
echo "Assembling assets ..."
npx --legacy-peer-deps openmrs@next assemble \
--manifest \
--mode config \
--config ./configuration/build-config.json \
--target ./frontend
# Copy required files
echo "Copying required files ..."
cp "${CWD}/assets/logo.png" "${CWD}/frontend"
cp "${CWD}/assets/ampath-logo.png" "${CWD}/frontend"
cp "${CWD}/assets/favicon.ico" "${CWD}/frontend"
cp "${CWD}/configuration/config.json" "${CWD}/frontend"
mv "${CWD}/frontend/config.json" "${CWD}/frontend/config.json"
# Exit with success status
exit 0