This repository has been archived by the owner on Feb 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
codefresh.yml
67 lines (60 loc) · 1.65 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
# Build a service with environment variables
version: '1.0'
steps:
init_variables:
title: Init variables
image: alpine
commands:
- cf_export BUILD_HARNESS_VERSION=0.7.0
- cf_export GIT_BRANCH=${{CF_BRANCH}}
build_image:
title: Build image
type: build
description: Build geodesic module
image-name: dev.cloudposse.co
dockerfile: Dockerfile
semver:
title: Export semantic version
image: cloudposse/build-harness:${{BUILD_HARNESS_VERSION}}
working_directory: ${{build_image}}
commands:
- make git/show
- make semver/show
- make semver/export >> ${{CF_VOLUME_PATH}}/env_vars_to_export
push_image_commit:
title: Push image with commit based semver tags
type: push
candidate: ${{build_image}}
tags:
- "${{SEMVERSION_COMMIT_SHORT}}"
- "${{SEMVERSION_COMMIT}}"
push_image_branch:
title: Push image with branch based semver tags
type: push
candidate: ${{build_image}}
tags:
- "${{SEMVERSION_BRANCH}}"
- "${{SEMVERSION_BRANCH_COMMIT_SHORT}}"
- "${{SEMVERSION_BRANCH_COMMIT}}"
when:
condition:
all:
executeForBranch: "'${{SEMVERSION_BRANCH}}' != ''"
push_image_tag:
title: Push image with tag based semver tags
type: push
candidate: ${{build_image}}
tag: "${{SEMVERSION_TAG}}"
when:
condition:
all:
executeForTag: "'${{SEMVERSION_TAG}}' != ''"
push_image_latest:
title: Push image with latest tag
type: push
candidate: ${{build_image}}
tag: latest
when:
condition:
all:
executeForMasterBranch: "'${{CF_BRANCH}}' == 'master'"