-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcodefresh.yml
67 lines (66 loc) · 1.77 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"
stages:
- "clone"
- "test"
- "release"
steps:
main_clone:
type: "git-clone"
stage: "clone"
description: "Cloning ${{CF_REPO_NAME}}..."
repo: "wattsight/${{CF_REPO_NAME}}"
revision: "${{CF_BRANCH}}"
testing:
type: parallel
stage: "test"
steps:
test_27:
title: "Test with Py2.7"
image: python:2.7-slim
working_directory: "${{main_clone}}"
commands:
- pip install -r requirements.txt
- pip install -r test-requirements.txt
- python -m pytest
test_38:
title: "Test with Py3.8"
image: python:3.8-slim
working_directory: "${{main_clone}}"
commands:
- pip install -r requirements.txt
- pip install -r test-requirements.txt
- python -m pytest
get_git_token:
title: Reading Github token
stage: "release"
image: codefresh/cli
commands:
- cf_export GITHUB_TOKEN=$(codefresh get context github --decrypt -o yaml | yq -y .spec.data.auth.password)
when:
condition:
any:
masterBranch: '"${{CF_BRANCH}}" == "master"'
masterPR: '"${{CF_PULL_REQUEST_TARGET}}" == "master"'
release_check:
title: "Check for release capability"
stage: "release"
image: python:3.8
working_directory: "${{main_clone}}"
commands:
- bash ./releases/release_package.sh test
when:
condition:
all:
masterPR: '"${{CF_PULL_REQUEST_TARGET}}" == "master"'
release:
title: "Release package"
stage: "release"
image: python:3.8
working_directory: "${{main_clone}}"
commands:
- bash ./releases/release_package.sh release
when:
branch:
only:
- master
# No CD triggering steps needed for library images