File tree Expand file tree Collapse file tree 3 files changed +41
-5
lines changed Expand file tree Collapse file tree 3 files changed +41
-5
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,10 @@ bin-local: cli-local
55
55
.PHONY : image
56
56
image : cli-image
57
57
58
+ .PHONY : cur-version
59
+ cur-version :
60
+ @echo -n $(VERSION )
61
+
58
62
.PHONY : cli
59
63
cli : $(OUT_DIR ) /$(CLI_NAME ) -linux-amd64.sha256 $(OUT_DIR ) /$(CLI_NAME ) -linux-arm64.sha256 $(OUT_DIR ) /$(CLI_NAME ) -linux-ppc64le.sha256 $(OUT_DIR ) /$(CLI_NAME ) -linux-s390x.sha256 $(OUT_DIR ) /$(CLI_NAME ) -darwin-amd64.sha256 $(OUT_DIR ) /$(CLI_NAME ) -windows-amd64.sha256
60
64
Original file line number Diff line number Diff line change 4
4
5
5
[ ![ Codefresh build status] ( https://g.codefresh.io/api/badges/pipeline/codefresh-inc/cli-v2%2Fci?type=cf-1&key=eyJhbGciOiJIUzI1NiJ9.NTY3MmQ4ZGViNjcyNGI2ZTM1OWFkZjYy.AN2wExsAsq7FseTbVxxWls8muNx_bBUnQWQVS8IgDTI )] ( https://g.codefresh.io/pipelines/edit/new/builds?id=60ae2ae330acb8f9c9bace7f&pipeline=ci&projects=cli-v2&projectId=60ae2a8498763b36c241d563 )
6
6
[ ![ codecov] ( https://codecov.io/gh/codefresh-io/cli-v2/branch/main/graph/badge.svg?token=IDyZNfRUfY )] ( https://codecov.io/gh/codefresh-io/cli-v2 )
7
- ![ GitHub release (latest by date)] ( https://img.shields.io/github/v/release/codefresh-io/cli-v2 )
8
- ![ GitHub all releases] ( https://img.shields.io/github/downloads/codefresh-io/cli-v2/total )
9
7
10
8
## Introduction
11
9
Original file line number Diff line number Diff line change @@ -20,12 +20,26 @@ steps:
20
20
prepare_env_vars : &deps
21
21
stage : Prepare
22
22
title : prepare-env
23
- image : quay.io/roi_codefresh /golang-ci-helper:latest
23
+ image : quay.io/codefresh /golang-ci-helper:latest
24
24
commands :
25
25
- cf_export GO111MODULE=on
26
26
- cf_export GOCACHE=/codefresh/volume/gocache # change gopath to codefresh shared volume
27
27
- cf_export GOPATH=/codefresh/volume/gopath
28
28
- cf_export PATH=$PATH:/codefresh/volume/gopath/bin
29
+ - cf_export LATEST_VERSION=$(curl --silent "https://api.github.com/repos/codefresh-io/cli-v2/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
30
+ - cf_export VERSION=$(make cur-version)
31
+ when :
32
+ steps :
33
+ - name : main_clone
34
+ on :
35
+ - success
36
+
37
+ compare_versions :
38
+ stage : Prepare
39
+ title : compare versions
40
+ image : alpine/semver
41
+ commands :
42
+ - semver -c -i $
29
43
when :
30
44
steps :
31
45
- name : main_clone
40
54
- go mod download -x
41
55
when :
42
56
steps :
43
- - name : prepare_env_vars
57
+ - name : compare_versions
44
58
on :
45
59
- success
46
60
@@ -104,7 +118,7 @@ steps:
104
118
disable_push : true
105
119
when :
106
120
steps :
107
- - name : main_clone
121
+ - name : compare_versions
108
122
on :
109
123
- success
110
124
@@ -126,3 +140,23 @@ steps:
126
140
push_quay_dev :
127
141
title : push to quay
128
142
registry : " ${{REGISTRY_INTEGRATION_QUAY}}"
143
+
144
+ push_prod :
145
+ stage : Release
146
+ title : promote image
147
+ type : push
148
+ candidate : ${{build}}
149
+ tags :
150
+ - latest
151
+ -
152
+ when :
153
+ steps :
154
+ - name : build
155
+ on :
156
+ - success
157
+ branch :
158
+ ignore : [ "main" ]
159
+ scale :
160
+ push_quay :
161
+ title : push to quay
162
+ registry : " ${{REGISTRY_INTEGRATION_QUAY}}"
You can’t perform that action at this time.
0 commit comments