Skip to content

Commit 36644d6

Browse files
Separate test and deploy stage in travis (#168)
* Separate test and deploy stage in travis. Explicitly skipping unneccesary steps in deploy stage * Add job for functionalTests
1 parent d62c734 commit 36644d6

File tree

1 file changed

+41
-10
lines changed

1 file changed

+41
-10
lines changed

.travis.yml

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,64 @@ jdk:
1111
env:
1212
- EI_BACKEND_PORT=8099 MONGODB_PORT=27017 RABBITMQ_AMQP_PORT=5672 RABBITMQ_WEB_PORT=15672 EIFFEL_ER_PORT=8084 JENKINS_PORT=8081 MAIL_SMTP_PORT=1025 MAIL_WEB_PORT=8025
1313

14+
15+
# Using default 'test' stage for our tests, and only running deploy stage
16+
# (after merge) on master branch
17+
stages:
18+
- test
19+
- name: deploy
20+
if: branch = master
21+
22+
1423
before_install:
15-
- chmod +x pom.xml
1624
- git clone --depth=50 --branch=master https://github.com/eiffel-community/eiffel-intelligence.git
1725
- cd eiffel-intelligence
1826
- docker-compose up -d
27+
28+
29+
install:
30+
- chmod +x pom.xml
1931
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
2032
- cd target
2133
- export EIFFEL_WAR=$(ls *.war)
2234
- java -Dspring.config.location=file:../../src/integrationtest/resources/integration-test.properties -Dserver.port=${EI_BACKEND_PORT} -jar ${EIFFEL_WAR} &
2335
- cd ../..
2436

25-
script:
26-
- "mvn verify -Dei.backendInstancesListJsonContent=\"[{ 'contextPath': '', 'port': '${EI_BACKEND_PORT}', 'name': 'EI-Backend-1', 'host': 'localhost', 'https': false, 'defaultBackend': true}]\" -B"
2737

2838
after_script:
2939
- cd eiffel-intelligence
3040
- docker-compose down
3141
- fuser -k ${EI_BACKEND_PORT}/tcp
3242

43+
44+
# Generate site documentation using mvn site plugin
3345
before_deploy:
3446
- rm -rf docs
3547
- mvn site -B
3648

37-
deploy:
38-
skip_cleanup: true
39-
provider: pages
40-
github-token: $GITHUB_TOKEN
41-
local_dir: docs/
42-
on:
43-
branch: master
49+
50+
# List of jobs to run, tied to specific stages
51+
jobs:
52+
include:
53+
- stage: test
54+
name: functionalTests
55+
before_install: skip
56+
install: skip
57+
script:
58+
- mvn test -B
59+
after_script: skip
60+
- stage: test
61+
name: integrationTests
62+
script:
63+
- "mvn verify -DskipUTs -Dei.backendInstancesListJsonContent=\"[{ 'contextPath': '', 'port': '${EI_BACKEND_PORT}', 'name': 'EI-Backend-1', 'host': 'localhost', 'https': false, 'defaultBackend': true}]\" -B"
64+
- stage: deploy
65+
name: deployGitHubPages
66+
before_install: skip # do not run again
67+
install: skip # do not run again
68+
script: skip # do not run default test scripts
69+
after_script: skip # do not run again
70+
deploy:
71+
provider: pages
72+
skip_cleanup: true
73+
github-token: $GITHUB_TOKEN
74+
local_dir: docs/

0 commit comments

Comments
 (0)