Skip to content

Commit 894c1e2

Browse files
committed
wip
1 parent c32eec0 commit 894c1e2

File tree

3 files changed

+41
-5
lines changed

3 files changed

+41
-5
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ bin-local: cli-local
5555
.PHONY: image
5656
image: cli-image
5757

58+
.PHONY: cur-version
59+
cur-version:
60+
@echo -n $(VERSION)
61+
5862
.PHONY: cli
5963
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
6064

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
[![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)
66
[![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)
97

108
## Introduction
119

build/ci.yml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,26 @@ steps:
2020
prepare_env_vars: &deps
2121
stage: Prepare
2222
title: prepare-env
23-
image: quay.io/roi_codefresh/golang-ci-helper:latest
23+
image: quay.io/codefresh/golang-ci-helper:latest
2424
commands:
2525
- cf_export GO111MODULE=on
2626
- cf_export GOCACHE=/codefresh/volume/gocache # change gopath to codefresh shared volume
2727
- cf_export GOPATH=/codefresh/volume/gopath
2828
- 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 $
2943
when:
3044
steps:
3145
- name: main_clone
@@ -40,7 +54,7 @@ steps:
4054
- go mod download -x
4155
when:
4256
steps:
43-
- name: prepare_env_vars
57+
- name: compare_versions
4458
on:
4559
- success
4660

@@ -104,7 +118,7 @@ steps:
104118
disable_push: true
105119
when:
106120
steps:
107-
- name: main_clone
121+
- name: compare_versions
108122
on:
109123
- success
110124

@@ -126,3 +140,23 @@ steps:
126140
push_quay_dev:
127141
title: push to quay
128142
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}}"

0 commit comments

Comments
 (0)