-
Notifications
You must be signed in to change notification settings - Fork 0
/
project-migrator.sh
executable file
·42 lines (37 loc) · 1.18 KB
/
project-migrator.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
35
36
37
38
39
40
41
42
#!/bin/bash
if [ -z "$workDir" ]; then
workDir=$(mktemp -d -t projectConvertXXX)
fi
if [ -z "$engineUrl" ]; then
engineUrl="https://developer.axonivy.com/permalink/12.0.0/axonivy-engine.zip"
fi
downloadEngine(){
if ! [ -d "${workDir}/engine" ]; then
echo "Downloading engine from ${engineUrl}"
(cd "$workDir" && curl --progress-bar -L -O "${engineUrl}")
zipped=$(find "${workDir}" -maxdepth 1 -name "*.zip")
unzip -qq "${zipped}" -d "${workDir}/engine"
rm "${zipped}"
fi
}
raiseProject() {
gitDir=$(pwd)
gitName=$(basename ${gitDir})
echo "Searching projects in ${gitDir}"
projects=()
for ivyPref in $(find ${gitDir} -name "ch.ivyteam.ivy.designer.prefs"); do
project=$(dirname $(dirname $ivyPref))
if ! [ -f "${project}/pom.xml" ]; then
continue # prefs file not in natural project structure
fi
projects+=("${project}")
done
if [ ${#projects[@]} -gt 0 ]; then
echo "Collected projects: ${projects[@]}"
${workDir}/engine/bin/EngineConfigCli migrate-project ${projects[@]}
git add . #include new+moved files!
git commit -m "Raise project to ${convert_to_version}"
else
echo "No projects found in ${gitDir}"
fi
}