forked from Informasjonsforvaltning/fdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtravisIntegration.sh
More file actions
executable file
·74 lines (55 loc) · 1.92 KB
/
travisIntegration.sh
File metadata and controls
executable file
·74 lines (55 loc) · 1.92 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
#!/usr/bin/env bash
set -e
SECONDS=0 # start timer
source ./buildGroupsEnv.sh
applications="${BUILD_APPS[@]}"
integrationtag=$(./citools/getIntegrationTag.sh)
echo "Checking if all applications (${BUILD_APPS[@]}) have images already integration-tested and tagged with $integrationtag"
#skip integration stage, if all already passed before
if ./citools/applicationsTagExistInDockerHub.sh "$applications" $integrationtag
then
echo "----------------------------------"
echo "Skipping integration tests"
echo "Integration images with tag $integrationtag are already in dockerhub for all applications ($applications)"
echo "----------------------------------"
echo "SECONDS"
echo $SECONDS
exit 0
fi
echo "SECONDS"
echo $SECONDS
echo "Get build tags for all build groups"
for i in "${!BUILD_APPS[@]}"; do
buildtag[$i]=$(./citools/getBuildTag.sh "${BUILD_APPS[$i]}")
done
echo "SECONDS"
echo $SECONDS
echo "Pull images of all build groups - exit with error when any build image is missing"
for i in "${!BUILD_APPS[@]}"; do
./citools/pullApplicationsByTag.sh "${BUILD_APPS[$i]}" "${buildtag[$i]}"
# tag the downloaded images as latest to allow docker-compose to use them
./citools/retagApplications.sh "${BUILD_APPS[$i]}" "${buildtag[$i]}" latest
done
echo "SECONDS"
echo $SECONDS
# TODO Run integration tests on the pulled images
docker-compose up -d
echo "SECONDS"
echo $SECONDS
# TODO find a better way to ensure that services are up and running
./waitForDocker.sh
echo "SECONDS"
echo $SECONDS
docker-compose run e2e npm run test:in_container
echo "SECONDS"
echo $SECONDS
if [ "$dockerUsername" ]
then
docker login --username ${dockerUsername} --password ${dockerPassword}
fi
echo "Integration tests passed, tag images with $integrationtag"
for i in "${!BUILD_APPS[@]}"; do
./citools/retagApplications.sh "${BUILD_APPS[$i]}" ${buildtag[$i]} $integrationtag push
done
echo "SECONDS"
echo $SECONDS