-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·95 lines (74 loc) · 3.29 KB
/
build.sh
File metadata and controls
executable file
·95 lines (74 loc) · 3.29 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env bash
set -e
#-----------------------------------------------------------------------------------------------------------------------
# Description: Build all TDS related repository modules and repository modules for componentes needed to run TDS,
# such as program management and ART. This script is intended to be run from the tds-build folder.
# This script assumes all required repositories are in sibling folders.
# See tds-clone.sh as a helper script to clone repositories.
#
# Pre-requisites: Maven 3
#
# Usage: ./build.sh
#-----------------------------------------------------------------------------------------------------------------------
REPO_LIST_FILE="clone-repos.txt"
POMS=(
"../repositories/SS_SharedBuild/pom.xml"
"../repositories/SS_SharedMultiJar/pom.xml"
"../repositories/SS_SharedCode/pom.xml"
"../repositories/SS_MonitoringAndAlertingClient/pom.xml"
"../repositories/SS_RestApiGenerator/pom.xml"
"../repositories/SS_ProgramManagementClient/pom.xml"
"../repositories/SS_SharedSecurity/pom.xml"
"../repositories/TDS_ItemRenderer/pom.xml"
"../repositories/TDS_ItemScoring/pom.xml"
"../repositories/TDS_TestDeliverySystemDataAccess/pom.xml"
"../repositories/TDS_ItemSelectionShell/pom.xml"
"../repositories/TDS_TestScoring/testscoring/pom.xml"
"../repositories/TDS_Student/pom.xml"
"../repositories/TDS_Proctor/proctor/pom.xml"
"../repositories/SS_ProgramManagement/pom.xml"
"../repositories/SS_TestSpecificationBank/pom.xml"
"../repositories/TDS_AdministrationAndRegistrationTools/pom.xml"
"../repositories/TDS_AdministrationAndRegistrationTools/AccValidation/pom.xml"
"../repositories/SS_Permissions/Permissions/pom.xml"
"../repositories/TDS_StudentReportProcessor/pom.xml"
"../repositories/TDS_CATsimulator/pom.xml"
"../repositories/TDS_TestDeliverySystemMaintenance/pom.xml"
"../repositories/TDS_Dictionary/pom.xml"
"../repositories/TDS_ContentUploader/ContentUploader/pom.xml"
# "../repositories/TestDeliverySystemRouter/pom.xml"
)
if [ "$1" = "--release" ]; then
printf "\nReplacing SNAPSHOT versions with release versions... \n"
find ../repositories -type f -name "pom.xml" -exec sed -i '' 's/-BUILD-SNAPSHOT//g' {} +
find ../repositories -type f -name "pom.xml" -exec sed -i '' 's/-SNAPSHOT//g' {} +
fi
printf "\nBuilding repository pom's... \n"
for pom_path in "${POMS[@]}"; do
printf "\nBuilding $pom_path"
mvn -q clean install -DskipTests -DXmx2048m -DXX:MaxPermSize=1024m -f $pom_path
done
if [ "$1" = "--release" ]; then
printf "\nRevert any changes that were made to the versions... \n"
if [ ! -f $REPO_LIST_FILE ]; then
printf "Repository list file %s does not exist. exiting.\n" "$REPO_LIST_FILE"
exit
fi
FILECONTENT=( `cat $REPO_LIST_FILE` )
if [ "${PWD##*/}" = "tds-build" ]; then
cd ..
fi
if [ -d "repositories" ]; then
printf "A repositories directory exists.\n"
else
printf "A repositories directory does not exist. Shutting down.\n"; exit
fi
cd repositories
for REPO_NAME in "${FILECONTENT[@]}"; do
cd $REPO_NAME
# revert the changes to the pom files for the versions that were made for he release build
git reset --hard
cd ..
done
fi
printf "\nDone \n"