-
Notifications
You must be signed in to change notification settings - Fork 2
/
codefresh.yml
39 lines (35 loc) · 1.56 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
version: '1.0'
steps:
perform_tests:
image: golang:latest
working_directory: ${{main_clone}}
description: Performing unit tests...
commands:
# Need to have the source in the correct GOPATH folder - let's do that
- mkdir -p /go/src/github.com/${{CF_REPO_OWNER}}
- ln -s /codefresh/volume/${{CF_REPO_NAME}} /go/src/github.com/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}
# Install pre-requisites and execute tests
- cd /go/src/github.com/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}} && go get
- cd /go/src/github.com/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}} && go test
build_artifact:
image: golang:latest
working_directory: ${{main_clone}}
description: Building artifact...
commands:
# Need to have the source in the correct GOPATH folder - let's do that
- mkdir -p /go/src/github.com/${{CF_REPO_OWNER}}
- ln -s /codefresh/volume/${{CF_REPO_NAME}} /go/src/github.com/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}
# Install pre-requisites and execute tests
- cd /go/src/github.com/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}} && go get
- cd /go/src/github.com/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}} && env CGO_ENABLED=0 go build -o entrypoint/entrypoint -a -ldflags '-s' .
build_image:
type: build
description: Building the image...
working_directory: ${{main_clone}}/entrypoint
image_name: ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}
tag: '${{CF_BRANCH}}'
push_to_registry:
title: Pushing to Docker Registry (with credentials)
type: push
candidate: '${{build_image}}'
tag: '${{CF_BRANCH}}'