forked from semaphoreci-demos/semaphore-demo-java-spring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsemaphore.yml
60 lines (60 loc) · 1.48 KB
/
semaphore.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
version: v1.0
name: Java Spring example CI pipeline on Semaphore
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
blocks:
- name: Build
task:
env_vars:
- name: MAVEN_OPTS
value: '-Dmaven.repo.local=.m2'
jobs:
- name: Build
commands:
- checkout
- cache restore
- 'mvn -q package jmeter:configure -Dmaven.test.skip=true'
- cache store
- name: Test
task:
env_vars:
- name: MAVEN_OPTS
value: '-Dmaven.repo.local=.m2'
prologue:
commands:
- checkout
- cache restore
- mvn -q test-compile -Dmaven.test.skip=true
jobs:
- name: Unit tests
commands:
- mvn test
- name: Integration tests
commands:
- mvn test -Pintegration-testing
- name: Performance tests
task:
env_vars:
- name: MAVEN_OPTS
value: '-Dmaven.repo.local=.m2'
prologue:
commands:
- checkout
- cache restore
jobs:
- name: Benchmark
commands:
- java -version
- java -jar target/spring-pipeline-demo.jar > /dev/null &
- sleep 20
- 'mvn -q jmeter:jmeter'
- 'mvn jmeter:results'
promotions:
- name: Dockerize
pipeline_file: docker-build.yml
auto_promote_on:
- result: passed
auto_promote:
when: branch = 'master' AND result = 'passed'