forked from containers101/demochat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fullpipeline.yml
111 lines (110 loc) · 2.99 KB
/
fullpipeline.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
version: '1.0'
steps:
BuildingDockerImage:
title: Building Docker Image
type: build
image_name: containers101/demochat
working_directory: ./
dockerfile: Dockerfile
tag: '${{CF_BRANCH_TAG_NORMALIZED}}'
RunningUnitTests:
title: Running Unit Tests
image: '${{BuildingDockerImage}}'
working_directory: IMAGE_WORK_DIR
commands:
- bash unit_test.sh
on_success:
metadata:
set:
- '${{BuildingDockerImage.imageId}}':
- CF_QUALITY: true
on_fail:
metadata:
set:
- '${{BuildingDockerImage.imageId}}':
- CF_QUALITY: false
RunningPerformanceTests:
title: Running Performance Tests
type: composition
composition:
version: '2'
services:
aut:
ports:
- 5000
image: 'containers101/demochat:master'
mongo:
image: mongo
composition_candidates:
cfintegration:
image: 'r.cfcr.io/razielt77_github/razielt/taurus:master'
command: bash runtests
environment:
- CF_VOLUME_PATH=${{CF_VOLUME_PATH}}
- TOKEN=${{TOKEN}}
volumes:
- '${{CF_VOLUME_NAME}}:/codefresh/volume'
add_flow_volume_to_composition: true
when:
condition:
all:
testresults: '"${{FAIL}}" == "0"'
on_success:
metadata:
set:
- '${{BuildingDockerImage.imageId}}':
- CF_QUALITY: true
- PerformanceReport: ${{PER_LINK}}
on_fail:
metadata:
set:
- '${{BuildingDockerImage.imageId}}':
- CF_QUALITY: false
add_jira_info:
title: Parsing jira Commit
image: r.cfcr.io/razielt77_github/containers101/annotator:master
command:
- bash script.sh
working_directory: IMAGE_WORK_DIR
environment:
- CF_COMMIT_MESSAGE = ${{CF_COMMIT_MESSAGE}}
- CF_VOLUME_PATH=${{CF_VOLUME_PATH}}
export:
title: "Exporting variables..."
image: alpine
commands:
- echo "Exporting variables..."
set_metadata:
title: "Setting metadata on image..."
image: alpine
commands:
- echo "Setting metadata on image..."
on_finish:
metadata:
set:
- '${{BuildingDockerImage.imageId}}':
- Jira: ${{JIRA_URL}}
- PerformanceReport: ${{PER_LINK}}
- PerformanceLatency: ${{PER_LATE}}
- UnitCoverage: ${{UNIT_COV}}
- Unit: ${{UNIT}}
rename_env:
title: Run and rename environment
type: launch-composition
composition: 'full-application'
environment_name: '${{CF_REPO_OWNER}}-${{CF_REPO_NAME}}-${{CF_COMMIT_AUTHOR}}'
when:
condition:
all:
testresults: '"${{FAIL}}" == "1"'
passfail:
title: failed
image: alpine
commands:
- echo "exit ${{FAIL}}"
- sh -c "exit ${{FAIL}}"
on_fail:
metadata:
set:
- '${{BuildingDockerImage.imageId}}':
- CF_QUALITY: false