-
Notifications
You must be signed in to change notification settings - Fork 26
/
codefresh.yml
68 lines (58 loc) · 1.85 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
version: '1.0'
steps:
unit-tests:
image: codefresh/buildpacks:nodejs-5
working-directory : ${{initial-clone}}
commands:
- echo Installing NPM modules silent
- npm install
- gulp test
- echo $(date)
build-step:
#title: Build My Image #Display name for the step
type: build
image-name: containers101/cf-example-result
tag: ${{CF_BRANCH}}
build_arguments:
- OPTION_A=${{OPTION_A}}
- OPTION_B=${{OPTION_B}}
push-to-registry:
type: push
#candidate: the image from the build step
candidate: ${{build-step}}
tag: ${{CF_BRANCH}}
integration-tests-step:
type: composition
#location of the compostion on the filesystem of the cloned image
composition: './cf-compositions/voting-app-full.yml'
#run integration only when pushing to master
when:
branch:
only:
- master #can also be regex
composition-candidates:
#this will be the image that we will test
integ-test:
image: containers101/cf-example-tests:master
command: ./tests.sh
composition-variables:
- VOTING_OPTION_A=${{OPTION_A}}
- VOTING_OPTION_B=${{OPTION_B}}
launch-composition:
type: launch-composition
environment-name: 'Test composition after build'
composition: './cf-compositions/voting-app-full.yml'
composition-variables:
- VOTING_OPTION_A=${{OPTION_A}}
- VOTING_OPTION_B=${{OPTION_B}}
deploy to ecs:
image: codefresh/cf-deploy-ecs
commands:
- cfecs-update --image-name containers101/cf-example-result --image-tag ${{CF_BRANCH}} eu-west-1 vote-app result
environment:
- AWS_ACCESS_KEY_ID=${{AWS_ACCESS_KEY_ID}}
- AWS_SECRET_ACCESS_KEY=${{AWS_SECRET_ACCESS_KEY}}
when:
condition:
all:
pushCommit: 'includes(lower("${{CF_COMMIT_MESSAGE}}"), "[deploy]") == true'