forked from ben-tmp/demochat
-
Notifications
You must be signed in to change notification settings - Fork 183
/
codefresh.yml
67 lines (63 loc) · 1.67 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
version: '1.0'
steps:
build_step:
title: Build
type: build
dockerfile: Dockerfile
image_name: demochat
tag: '${{CF_BRANCH}}'
# unit_tests:
# title: Unit Tests
# image: ${{build_step}}
# fail_fast: false
# working-directory : /usr/src/app
# commands:
# - npm test
unit_test:
type: composition
working_directory: '${{main_clone}}'
composition:
version: '2'
services:
mongo:
image: 'mongo:latest'
ports:
- 27017
composition_candidates:
test:
image: '${{build_step}}'
command: npm test
push_to_registry:
title: Push To Registry
type: push
candidate: ${{build_step}}
tag: ${{CF_BRANCH}}
deploy_to_ecs:
title: Deploy Container to ECS
image: codefresh/cf-deploy-ecs
commands:
- >-
cfecs-update --image-name containers101/demochat --image-tag
${{CF_BRANCH}} eu-west-1 demochat-production demochat-service
environment:
- 'AWS_ACCESS_KEY_ID=${{AWS_ACCESS_KEY_ID}}'
- 'AWS_SECRET_ACCESS_KEY=${{AWS_SECRET_ACCESS_KEY}}'
when:
condition:
all:
deploy_to_ecs: '"${{DEPLOY_ECS}}" == "true"'
deploy_to_kubernetes:
image: codefresh/cf-deploy-kubernetes
tag: latest
working_directory: ${{main_clone}}
commands:
- /cf-deploy-kubernetes deployment.yml
environment:
- KUBERNETES_USER=${{KUBERNETES_USER}}
- KUBERNETES_PASSWORD=${{KUBERNETES_PASSWORD}}
- KUBERNETES_SERVER=${{KUBERNETES_SERVER}}
- DOCKER_IMAGE_TAG=${{CF_BRANCH}}
when:
condition:
all:
deploy_to_kubernetes: '"${{DEPLOY_KUBERNETES}}" == "true"'