This repository has been archived by the owner on May 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
140 lines (133 loc) · 6.3 KB
/
.travis.yml
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
language: java
jdk: openjdk10
cache:
directories:
- "$HOME/.m2"
services:
- docker
jobs:
include:
###########################################################################
- stage: "Maven Install (Unit & Integration Tests) & Docker Build & Push"
script:
- set -e
- curl -O https://raw.githubusercontent.com/linksmart/ci-scripts/master/java/ci-preparation.sh
- . ./ci-preparation.sh
- mvn clean -B install -B
- if [ "$TRAVIS_BRANCH" = "release" ] ; then export DISTRO="pre-release"; else export DISTRO="experimental"; fi
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build --force-rm -f gpl-artifacts/Dockerfile-local -t linksmart/dpa:${DISTRO} .
- docker push linksmart/dpa:${DISTRO}
- docker build --force-rm -f Dockerfile-local -t linksmart/dpa:wso2-${DISTRO} .
- docker push linksmart/dpa:wso2-${DISTRO}
- docker build --force-rm -f gpl-artifacts/Dockerfile-local --build-arg extensions=eu.linksmart.services.event.ceml.core.CEML -t linksmart/la:${DISTRO} .
- docker push linksmart/la:${DISTRO}
- docker build --force-rm -f Dockerfile-local --build-arg extensions=eu.linksmart.services.event.ceml.core.CEML -t linksmart/la:wso2-${DISTRO} .
- docker push linksmart/la:wso2-${DISTRO}
install: true
name: "Building"
#########################
- stage: "System Tests"
script:
- set -e
- git clone https://github.com/linksmart/dpa-tutorials.git
- |
if [ "$TRAVIS_BRANCH" != "release" ]; then
docker-compose -f dpa-tutorials/docker-compose.yml -f dpa-tutorials/docker-compose.tutorial.yml -f dpa-tutorials/testing/docker-compose-testing.yml up -d
else
docker-compose -f dpa-tutorials/docker-compose.yml -f dpa-tutorials/docker-compose.tutorial.yml up -d
fi
- cd dpa-tutorials/testing/
- curl -O https://raw.githubusercontent.com/linksmart/ci-scripts/master/java/ci-preparation.sh
- . ./ci-preparation.sh skipHeadRealocation
- mvn test
name: "DPA ST "
git:
depth: false
install: true
- stage: "System Tests"
if: branch != release
script:
- set -e
- cd test/la-basic-it/
- docker-compose -f docker-compose.yml up -d
- curl -O https://raw.githubusercontent.com/linksmart/ci-scripts/master/java/ci-preparation.sh
- . ./ci-preparation.sh skipHeadRealocation
- mvn test
install: true
name: "LA ST"
##############################
- stage: "Deploy Artifacts"
if: branch != release
script:
- curl -O https://raw.githubusercontent.com/linksmart/ci-scripts/master/java/ci-preparation.sh
- . ./ci-preparation.sh skipHeadRealocation
- mvn -Dskip=test deploy -B #-Dlinksmart.commons.version=${LS_COMMONS_VERSION}-SNAPSHOT -Dskip=test -Dls.se.agents.version=${VERSION}-SNAPSHOT
name: "Snapshot Artifacts"
install: true
- stage: "Deploy Artifacts"
if: branch = release
script:
- set -e
- curl -O https://raw.githubusercontent.com/linksmart/ci-scripts/master/java/ci-preparation.sh
- . ./ci-preparation.sh
- . ./maven-release.sh
name: "Release Artifacts"
install: true
- stage: "Deploy Artifacts"
script:
- set -e
- if [ "$TRAVIS_BRANCH" = "release" ] ; then export DISTRO="pre-release"; else export DISTRO="experimental"; fi
- if [ "$TRAVIS_BRANCH" = "release" ] ; then export DISTRO_RELEASE="latest"; else export DISTRO_RELEASE="snapshot"; fi
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker pull linksmart/dpa:${DISTRO}
- docker pull linksmart/la:${DISTRO}
- docker pull linksmart/dpa:wso2-${DISTRO}
- docker pull linksmart/la:wso2-${DISTRO}
- docker tag linksmart/dpa:${DISTRO} linksmart/dpa:${DISTRO_RELEASE}
- docker tag linksmart/la:${DISTRO} linksmart/la:${DISTRO_RELEASE}
- docker tag linksmart/dpa:wso2-${DISTRO} linksmart/dpa:wso2-${DISTRO_RELEASE}
- docker tag linksmart/la:wso2-${DISTRO} linksmart/la:wso2-${DISTRO_RELEASE}
- docker push linksmart/dpa:${DISTRO_RELEASE}
- docker push linksmart/la:${DISTRO_RELEASE}
- docker push linksmart/dpa:wso2-${DISTRO_RELEASE}
- docker push linksmart/la:wso2-${DISTRO_RELEASE}
git:
depth: false
install: true
name: "Docker Push Images"
- stage: "Deploy Artifacts"
if: branch != release
script:
- set -e
- curl -O https://raw.githubusercontent.com/linksmart/ci-scripts/master/java/ci-preparation.sh
- . ./ci-preparation.sh
- mvn javadoc:javadoc #-Dls.se.agents.version=${VERSION}-SNAPSHOT
name: "Javadoc Deploy"
install: true
- stage: "Deploy Artifacts"
if: branch = release
script:
- set -e
- curl -O https://raw.githubusercontent.com/linksmart/ci-scripts/master/java/ci-preparation.sh
- . ./ci-preparation.sh
- mvn site
name: "Javadoc Deploy"
install: true
- stage: "Deploy Artifacts"
script:
- set -e
- curl -O https://raw.githubusercontent.com/linksmart/ci-scripts/master/git-realocate-head.sh
- . ./git-realocate-head.sh
- docker-compose -f test/openAPI/docker-compose.yml up -d
- export URL="http://localhost:8319/v2/api-docs?group=LinkSmart%20(R)%20IoT%20Data-Processing%20Agent" FILE=api-docs.json
- echo "" > ${FILE}
- echo 'calling endpoint ${URL} storeging in ${FILE} ...';
- curl -f --stderr err "${URL}" | jq '.' > ${FILE};
- cat err;
- until [ -s ${FILE} ]; do sleep 1; echo 'calling endpoint ${URL} storeging in ${FILE} ...'; curl -f --stderr err "${URL}" | jq '.' > ${FILE}; cat err; done;
- git add ${FILE}
- "git diff-index --quiet HEAD || git commit -m '[skip travis] AUTOMATIC COMMIT: updating Open API'"
- "git push https://${GH_TOKEN}@github.com/linksmart/data-processing-agent.git --all"
name: "OpenAPI GIT Push"
install: true