forked from codefreshdemo/demochat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codefresh.yml
72 lines (65 loc) · 1.72 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
version: '1.0'
steps:
Clone:
title: Running docker image
type: git-clone
arguments:
repo: '${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}'
git: github
revision: '${{CF_REVISION}}'
build_dev_step:
type: build
dockerfile: Dockerfile.dev
image-name: demochatnode
tag: dev
print_env:
image: ${{build_dev_step}}
working_directory: /root/demochat
environment:
- TRIPLESEC_SECRET=${{TRIPLESEC_SECRET}}
- NEW_SECRET=${{NEW_SECRET}}
commands:
- npm run env
unit_tests:
image: ${{build_dev_step}}
working_directory: /root/demochat
commands:
- npm run test
build_step:
type: build
dockerfile: Dockerfile
image-name: demochat
tag: ${{CF_BRANCH}}
integration_step:
type: composition
working_directory: /root/demochat
composition:
version: '2'
services:
app:
image: ${{build_step}}
command: sh -c "sleep 10 && npm run start"
links:
- mongo
ports:
- 5000
depends_on:
- mongo
mongo:
image: mongo
composition-candidates:
main:
image: alpine:3.5
command: sh -c "for i in $$(seq 1 20); do wget -s -q http://app:5000/ && break || sleep 5; done && wget -s -q http://app:5000/" | echo 'works'
deploy_to_ecs:
image: codefresh/cf-deploy-ecs
fail_fast: false
commands:
- cfecs-update --image-name demochat --image-tag ${{CF_BRANCH}} eu-west-1 demochat-cluster demochat-webapp
environment:
- AWS_ACCESS_KEY_ID=${{AWS_ACCESS_KEY_ID}}
- AWS_SECRET_ACCESS_KEY=${{AWS_SECRET_ACCESS_KEY}}
when:
branch:
only:
- master