forked from eiffel-community/eiffel-intelligence-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
78 lines (70 loc) · 3.26 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
sudo: required
dist: xenial
language: java
services:
- docker
# No output from git clone command
git:
quiet: true
# All environment variables must be in one line to trigger a single build.
env:
- EI_BACKEND_PORT=8099 JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
before_install:
- sudo apt-get update
- sudo apt-get install -y openjdk-8-jdk
- export PATH=$(echo "$PATH" | sed -e 's/:\/usr\/local\/lib\/jvm\/openjdk11\/bin//')
- export PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin:$PATH
- export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
- java -version
# Using default 'test' stage for our tests, and only running report_coverage
# (after merge) on master branch
stages:
- test
- name: report_coverage
if: branch = master AND type != pull_request
# List of jobs to run, tied to specific stages
jobs:
include:
- stage: test
name: functionalTests
before_install: skip
install: skip
script:
- sudo apt-get update
- sudo apt-get install -y openjdk-8-jdk
- export PATH=$(echo "$PATH" | sed -e 's/:\/usr\/local\/lib\/jvm\/openjdk11\/bin//')
- export PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin:$PATH
- echo $PATH
- export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
- java -version
- mvn test -B
- stage: test
name: integrationTests
before_script:
- source src/main/docker/env.bash
- docker-compose -f src/main/docker/docker-compose.yml up -d eiffel-er mongodb rabbitmq jenkins mail-server ldap ldap-seed ldap2 ldap2-seed
- echo 'Sleeping till Jenkins is up.'
- timeout 90 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' $HOST:$JENKINS_PORT/login)" != "200" ]]; do sleep 5; done' || false
- git clone --depth=50 --branch=master https://github.com/eiffel-community/eiffel-intelligence.git
- cd eiffel-intelligence
- chmod +x pom.xml
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
- export EIFFEL_WAR=$(ls target/*.war)
- java -Dspring.config.additional-location=file:../src/integrationtest/resources/integration-test.properties -Dserver.port=${EI_BACKEND_PORT} -jar ${EIFFEL_WAR} &
- cd ..
- echo 'Sleeping till EI is up.'
- timeout 30 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' $HOST:$EI_BACKEND_PORT/status)" != "200" ]]; do sleep 5; done' || false
script:
- "mvn verify -P integrationTest -DskipUTs -Dei.backend.instances.list.json.content=\"[{ 'contextPath': '', 'port': '${EI_BACKEND_PORT}', 'name': 'EI-Backend-1', 'host': 'localhost', 'https': false, 'defaultBackend': true}]\" -B"
after_script:
- docker-compose -f src/main/docker/docker-compose.yml down
- fuser -k ${EI_BACKEND_PORT}/tcp
- stage: report_coverage
name: report_coverage
before_install: skip
install: skip
# Generating test coverage report and publishing to Codacy
script:
- mvn cobertura:cobertura -B
- curl -Ls -o codacy-coverage-reporter-assembly.jar https://github.com/codacy/codacy-coverage-reporter/releases/download/6.0.2/codacy-coverage-reporter-6.0.2-assembly.jar
- java -jar codacy-coverage-reporter-assembly.jar report -l Java -r target/site/cobertura/coverage.xml