Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
roi-codefresh committed May 27, 2021
1 parent c8d035c commit 1f608d1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 44 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ $(GOBIN)/mockery:
@echo installing: mockery
@curl -L -o dist/mockery.tar.gz -- https://github.com/vektra/mockery/releases/download/v1.1.1/mockery_1.1.1_$(shell uname -s)_$(shell uname -m).tar.gz
@tar zxvf dist/mockery.tar.gz mockery
@rm dist/mockery.tar.gz
@chmod +x mockery
@mkdir -p $(GOBIN)
@mv mockery $(GOBIN)/mockery
Expand Down
37 changes: 15 additions & 22 deletions build/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,31 @@ steps:
repo: ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}
revision: ${{CF_BRANCH}}

build_helper_image:
prepare_env_vars: &deps
stage: Prepare
title: build helper image
type: build
image_name: helper
tag: ${{CF_BRANCH_TAG_NORMALIZED}}
dockerfile:
content: |-
FROM golang:1.16.3-alpine3.13
RUN apk -U add --no-cache ca-certificates git make gcc g++ curl bash && update-ca-certificates
ENTRYPOINT [ "/bin/bash" ]
buildkit: true
disable_push: true
title: prepare-env & download modules
image: quay.io/codefresh/golang-ci-helper:latest
commands:
- cf_export GO111MODULE=on
- cf_export GOCACHE=/codefresh/volume/gocache # change gopath to codefresh shared volume
- cf_export GOPATH=/codefresh/volume/gopath
- cf_export PATH=$PATH:/codefresh/volume/gopath/bin
when:
steps:
- name: main_clone
on:
- success

prepare_env_vars: &deps
download_modules:
<<: *deps
stage: Prepare
title: prepare-env & download modules
image: ${{build_helper_image}}
title: download modules
commands:
- cf_export GO111MODULE=on
- cf_export GOCACHE=/codefresh/volume/gocache # change gopath to codefresh shared volume
- cf_export GOPATH=/codefresh/volume/gopath
- cf_export PATH=$PATH:/codefresh/volume/gopath/bin
- go mod download -x
- make clean
when:
steps:
- name: build_helper_image
- name: prepare_env_vars
on:
- success

Expand All @@ -61,7 +54,7 @@ steps:
- make check-worktree
when:
steps:
- name: prepare_env_vars
- name: download_modules
on:
- success

Expand All @@ -74,7 +67,7 @@ steps:
- make check-worktree
when:
steps:
- name: prepare_env_vars
- name: download_modules
on:
- success

Expand Down
24 changes: 2 additions & 22 deletions build/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,10 @@ steps:
repo: ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}
revision: ${{CF_BRANCH}}

build_helper_image:
stage: Prepare
title: build tester image
type: build
image_name: helper
tag: ${{CF_BRANCH_TAG_NORMALIZED}}
dockerfile:
content: |-
FROM golang:1.16.3-alpine3.13
RUN apk -U add --no-cache ca-certificates git make gcc g++ curl bash openssl && update-ca-certificates
RUN curl -L https://github.com/cli/cli/releases/download/v1.9.2/gh_1.9.2_linux_amd64.tar.gz | tar zx && mv ./gh_1.9.2_linux_amd64/bin/gh /usr/local/bin
ENTRYPOINT [ "/bin/bash" ]
buildkit: true
disable_push: true
when:
steps:
- name: main_clone
on:
- success

check_version: &deps
stage: Prepare
title: check version
image: ${{build_helper_image}}
image: quay.io/codefresh/golang-ci-helper:latest
commands:
- cf_export GO111MODULE=on
- cf_export GOCACHE=/codefresh/volume/gocache # change gopath to codefresh shared volume
Expand All @@ -50,7 +30,7 @@ steps:
- (gh release view ${{CF_BRANCH}} --repo ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}) && (echo release with the same name already exists && exit 1) || echo no release with the name ${{CF_BRANCH}}, we can continue!
when:
steps:
- name: build_helper_image
- name: main_clone
on:
- success

Expand Down

0 comments on commit 1f608d1

Please sign in to comment.