-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
executable file
·85 lines (78 loc) · 1.77 KB
/
bootstrap.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
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
#!/bin/bash
#common libraries
commonLibs="yti-spring-security
yti-spring-migration"
#Component-list
components="yti-codelist-common-model
yti-docker-java-base
yti-config-server
yti-codelist-public-api-service
yti-codelist-content-intake-service
yti-codelist-ui
yti-terminology-termed-docker
yti-terminology-api
yti-terminology-ui
yti-fuseki
yti-datamodel-api
yti-datamodel-ui
yti-groupmanagement
yti-comments-api
yti-comments-ui
yti-messaging-api
yti-activemq
yti-postgres
"
#yti-fuseki = yti-datamodel-database
termedComponents="termed-api"
YTI_REPO="https://github.com/VRK-YTI/"
TERMED_REPO="https://github.com/THLfi/"
#clone given repository from git with given branch or master
clone_component_from_git () {
`git clone $1$2.git -b$3`
}
clone_and_publish_components (){
cd $1
tags=`git describe --tags $(git rev-list --tags --max-count=2)`
echo "tags=$tags"
for tag in $tags
do
echo "Get and compile tag $tag"
`git checkout $tag`
echo "publish component:$1"
echo "--------------------------"
./gradlew publishToMavenLocal
echo "DONE $1"
done
cd ..
}
#Main
#Where to fetch sources
BRANCH=master
if [ $# -eq 1 ]
then
echo "Active branch $1"
BRANCH=$1
fi
BUILD_BASE=$PWD/build.$BRANCH
echo Clone repositories
mkdir -p $BUILD_BASE
cd $BUILD_BASE
echo "Fetching YTI into the $BUILD_BASE"
echo "Get libraries"
for lib in $commonLibs
do
echo "Publishing $lib"
clone_component_from_git $YTI_REPO $lib $BRANCH
clone_and_publish_components $lib
done
echo "Get components"
for currentComponent in $components
do
clone_component_from_git $YTI_REPO $currentComponent $BRANCH
done
echo TERMED
for currentComponent in $termedComponents
do
clone_component_from_git $TERMED_REPO $currentComponent $BRANCH
done
cd ..