forked from codefresh-io/terraform-provider-codefresh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codefresh.yml
73 lines (69 loc) · 1.69 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
version: "1.0"
stages:
- clone
- test
- release
steps:
main_clone:
title: "Cloning main repository..."
stage: clone
type: git-clone
repo: "${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}"
revision: "${{CF_REVISION}}"
git: cf_github
go_fmt:
title: "Formatting"
stage: test
image: goreleaser/goreleaser:v1.17.0
commands:
- go fmt
go_test:
title: "Run tests"
stage: test
image: goreleaser/goreleaser:v1.17.0
environment:
- TF_ACC="test"
commands:
- go test -v ./...
retry:
maxAttempts: 3
delay: 5
exponentialFactor: 2
prepare_env_vars:
title: "Preparing environment variables..."
stage: release
image: codefreshio/ci-helpers
environment:
- GPG_FINGERPRINT=${{GPG_FINGERPRINT}}
- SIGNINGKEY=${{SIGNINGKEY}}
commands:
- source /get-token/get-gh-token.sh
- cf_export GITHUB_TOKEN
- cf_export GPG_FINGERPRINT
- cf_export SIGNINGKEY
- cf_export GPG_PRIVATE
when:
condition:
all:
release: "'${{RELEASE}}' == 'true'"
release_binaries:
title: Create release in Github
image: goreleaser/goreleaser:v1.17.0
stage: release
environment:
- GPG_FINGERPRINT=${{GPG_FINGERPRINT}}
- SIGNINGKEY=${{SIGNINGKEY}}
- GPG_PRIVATE=${{GPG_PRIVATE}}
commands:
- apk update
- apk fetch gnupg
- apk add gnupg
- echo ${GPG_PRIVATE} | base64 -d > /tmp/private.key
- gpg --import /tmp/private.key
- git config user.signingkey ${GPG_FINGERPRINT}
- git clean -fdx
- goreleaser release --rm-dist
when:
condition:
all:
release: "'${{RELEASE}}' == 'true'"