-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcodefresh.yml
78 lines (69 loc) · 2.24 KB
/
codefresh.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
version: '1.0'
steps:
unit_test:
title: Unit Tests
# The image from which the executable container is created. It can be an explicit ID of a Docker image,
# or a variable that references a Build or Push step.
image: maven:latest
# One or more bash commands to execute your tests.
commands:
- mvn -version
build_image:
title: Building Image
type: build
#Important: rename this image to to a valid repository in your registry. For example: myUserName/vote
image_name: ncodefresh/java-spring-mvc-jdbc
#Dockerfile location should be relative to the working directory
dockerfile: Dockerfile
tag: ${{CF_BRANCH}}
push_to_registry:
title: Pushing to Docker Registry
type: push
#A candidate is the image that we want to push to registry
candidate: '${{build_image}}'
# You can push the image with whatever tag you want. In our example we use CF_BRANCH, which is a variable in
# the build process, accessible throughout the entire flow.
tag: '${{CF_BRANCH}}'
fail_fast: false
integration_test:
title: Integration tests
type: composition
composition: docker-compose.yml
composition-candidates:
main:
image: nhoag/curl
command: bash -c "sleep 20 && curl http://tomcat:8080/" | echo 'works'
launch_composition:
title: Launch composition
type: launch-composition
composition:
version: '2'
services:
database:
image: mysql:latest
ports:
- 3306
environment:
MYSQL_ROOT_PASSWORD: admin
MYSQL_USER: test
MYSQL_PASSWORD: admin
MYSQL_DATABASE: contactdb
tomcat:
image: ncodefresh/tomcat7:7.0.75
ports:
- 8080
links:
- app
volumes_from:
- app
app:
image: ${{build_image}}
volumes:
- wars:/opt/tomcat/webapps
links:
- database
volumes:
wars:
driver: local
environment_name: 'java-spring-mvc-jdbc'
entry_point: tomcat