@@ -17,38 +17,30 @@ steps:
1717 repo : ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}
1818 revision : ${{CF_BRANCH}}
1919
20- build_helper_image :
20+ prepare_env_vars : &deps
2121 stage : Prepare
22- title : build helper image
23- type : build
24- image_name : helper
25- tag : ${{CF_BRANCH_TAG_NORMALIZED}}
26- dockerfile :
27- content : |-
28- FROM golang:1.16.3-alpine3.13
29- RUN apk -U add --no-cache ca-certificates git make gcc g++ curl bash && update-ca-certificates
30- ENTRYPOINT [ "/bin/bash" ]
31- buildkit : true
32- disable_push : true
22+ title : prepare-env
23+ image : quay.io/roi_codefresh/golang-ci-helper:latest
24+ commands :
25+ - cf_export GO111MODULE=on
26+ - cf_export GOCACHE=/codefresh/volume/gocache # change gopath to codefresh shared volume
27+ - cf_export GOPATH=/codefresh/volume/gopath
28+ - cf_export PATH=$PATH:/codefresh/volume/gopath/bin
3329 when :
3430 steps :
3531 - name : main_clone
3632 on :
3733 - success
3834
39- prepare_env_vars : &deps
35+ download_modules :
36+ << : *deps
4037 stage : Prepare
41- title : prepare-env & download modules
42- image : ${{build_helper_image}}
38+ title : download modules
4339 commands :
44- - cf_export GO111MODULE=on
45- - cf_export GOCACHE=/codefresh/volume/gocache # change gopath to codefresh shared volume
46- - cf_export GOPATH=/codefresh/volume/gopath
47- - cf_export PATH=$PATH:/codefresh/volume/gopath/bin
4840 - go mod download -x
4941 when :
5042 steps :
51- - name : build_helper_image
43+ - name : prepare_env_vars
5244 on :
5345 - success
5446
6153 - make check-worktree
6254 when :
6355 steps :
64- - name : prepare_env_vars
56+ - name : download_modules
6557 on :
6658 - success
6759
7466 - make check-worktree
7567 when :
7668 steps :
77- - name : prepare_env_vars
69+ - name : download_modules
7870 on :
7971 - success
8072
0 commit comments