forked from todaywasawesome/color-coded
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codefresh.yml
143 lines (131 loc) · 4.15 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
version: "1.0"
stages:
- "clone"
- "build"
- staging
- production
steps:
clones:
type: parallel
stage: clone
steps:
clone:
title: "Cloning repository"
type: "git-clone"
repo: "${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}"
revision: "${{CF_BRANCH}}"
git: "github"
clone-gitops:
title: "Cloning App Gitops Config repository"
type: "git-clone"
repo: "${{CF_REPO_OWNER}}/csdp_applications"
revision: "main"
git: "github"
build:
title: "Building Docker image"
type: "build"
image_name: "${{CF_REPO_OWNER}}/color"
working_directory: "${{clone}}"
tag: "${{CF_SHORT_REVISION}}"
dockerfile: "Dockerfile"
registry: docker-lr
stage: "build"
# push_to_ecr:
# title: "Push image to ECR"
# type: push
# candidate: ${{build}}
# image_name: lrochette/color
# registry: ecr-lr
# tag: "${{CF_SHORT_REVISION}}"
# stage: "build"
ReportImageMetadataAll:
type: codefresh-report-image:1.0.10
working_directory: /code
stage: build
arguments:
CF_API_KEY: '${{CF_API_KEY}}'
CF_RUNTIME_NAME: csdp
CF_GITHUB_TOKEN: '${{GITHUB_TOKEN}}'
CF_GIT_PROVIDER: github
CF_GIT_REPO: '${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}'
CF_GIT_BRANCH: '${{CF_BRANCH}}'
CF_JIRA_INTEGRATION: jira-intg
CF_JIRA_MESSAGE: "${{CF_COMMIT_MESSAGE_ESCAPED}}"
CF_JIRA_PROJECT_PREFIX: FT
scale:
docker:
title: Report docker image to Codefresh CD
arguments:
CF_IMAGE: 'docker.io/${{CF_REPO_OWNER}}/color:${{CF_SHORT_REVISION}}'
CF_CONTAINER_REGISTRY_INTEGRATION: docker-intg
# ecr:
# title: Report ECR image to Codefresh CD
# arguments:
# CF_IMAGE: '835357571861.dkr.ecr.us-east-1.amazonaws.com/${{CF_REPO_OWNER}}/color:${{CF_SHORT_REVISION}}'
# CF_CONTAINER_REGISTRY_INTEGRATION: ecr-intg
# CF_ENRICHERS: 'jira,git'
test:
title: "Running test"
image: "ubuntu:latest" # The image in which command will be executed
working_directory: "${{clone}}"
commands:
- "ls"
stage: "build"
staging_approval:
title: Approve for Staging
type: pending-approval
stage: staging
timeout:
duration: 10
timeUnit: minutes
finalState: approved
update_staging_manifest:
description: update the image version for staging
image: mikefarah/yq:3.3.4
working_directory: '${{clone-gitops}}'
stage: staging
commands:
- yq w -i kustomize/color/overlays/dev/deployment.yaml 'spec.template.spec.containers[0].image' "lrochette/color:${{CF_SHORT_REVISION}}"
commit_and_push_staging:
title: Commit changes and push
type: git-commit:0.1.4
stage: staging
arguments:
repo: '${{CF_REPO_OWNER}}/csdp_applications'
git: github
working_directory: '/codefresh/volume/csdp_applications'
commit_message: "Update image to deploy in DEV to ${{CF_SHORT_REVISION}}"
git_user_name: lrochette
git_user_email: [email protected]
allow_empty: false
add:
- kustomize/color/overlays/dev/deployment.yaml
production_approval:
title: Approve for Production
type: pending-approval
stage: production
timeout:
duration: 30
timeUnit: minutes
finalState: denied
update_prod_manifest:
description: update the image version for production
image: mikefarah/yq:3.3.4
working_directory: '${{clone-gitops}}'
stage: production
commands:
- yq w -i kustomize/color/overlays/prod/rollout.yaml 'spec.template.spec.containers[0].image' "lrochette/color:${{CF_SHORT_REVISION}}"
commit_and_push_production:
title: Commit changes and push
type: git-commit:0.1.4
stage: production
arguments:
repo: '${{CF_REPO_OWNER}}/csdp_applications'
git: github
working_directory: '/codefresh/volume/csdp_applications'
commit_message: "Update image to deploy in production to ${{CF_SHORT_REVISION}}"
git_user_name: lrochette
git_user_email: [email protected]
allow_empty: false
add:
- kustomize/color/overlays/prod/rollout.yaml