forked from otomato-gh/bringon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codefresh.yml
35 lines (35 loc) · 1.18 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
version: '1.0'
steps:
GetJiraID:
title: Get Jira ID
image: alpine:latest
commands:
- echo JIRAID=$(echo "${{CF_COMMIT_MESSAGE}}" |sed -e 's/\([A-Z]*-[0-9]*\).*/\1/') > ${{CF_VOLUME_PATH}}/env_vars_to_export
BuildingDockerImage:
title: Building Docker Image
type: build
image_name: otomato/bringon
working_directory: ./
dockerfile: Dockerfile
tag: '${{CF_SHORT_REVISION}}'
metadata: # Declare the metadata attribute
set: # Specify the set operation
- qa: pending
- commit_message: ${{CF_COMMIT_MESSAGE}}
- jira: ${{JIRAID}}
- exit_code: 0
- is_main:
evaluate: "'${{CF_BRANCH}}' == 'master'"
PushDockerImage:
type: push
candidate: ${{BuildingDockerImage}}
tag: ${{CF_SHORT_REVISION}}
UpdatingJira:
title: Update Jira Issue
image: otomato/jira-cli:alpine
commands:
- yes n | jira-cli update ${JIRAID} --comment 'New docker image otomato/bringon:${{CF_SHORT_REVISION}}. Build log is here ${{CF_BUILD_URL}}' --jira-url ${JIRA_URL} -u ${JIRA_USR} -p ${JIRA_PWD}
when:
condition:
all:
JiraIdFound: 'match("${JIRAID}", "[A-Z]+-[0-9]+", true)'