-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcodefresh.yaml
54 lines (53 loc) · 1.21 KB
/
codefresh.yaml
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
version: "1.0"
stages:
- "clone"
- "build"
- "test"
- "push"
steps:
main_clone:
type: "git-clone"
description: "Cloning main repository..."
repo: "octarinesec/validator"
revision: "${{CF_BRANCH}}"
stage: "clone"
ValidatorImage:
title: "Building Docker Image"
type: "build"
image_name: "octarinesec/validator"
tag: "${{CF_REVISION}}"
dockerfile: "Dockerfile"
stage: "build"
UnitTests:
title: "Running Unit Tests"
type: "freestyle"
image: ${{ValidatorImage}}
commands:
- pipenv run pytest
stage: "test"
push_master:
title: "Pushing image to Dockerhub"
type: "push"
image_name: "octarinesec/validator"
registry: "dockerhub"
candidate: "${{ValidatorImage}}"
when:
branch:
only:
- master
tags:
- "${{CF_REVISION}}"
stage: "push"
push_release:
title: "Pushing image to Dockerhub"
type: "push"
image_name: "octarinesec/validator"
registry: "dockerhub"
candidate: "${{ValidatorImage}}"
when:
condition:
all:
triggerByRelease: 'includes("${{CF_RELEASE_TAG}}", "{{CF_RELEASE_TAG}}") == false'
tags:
- "${{CF_RELEASE_TAG}}"
stage: "push"