Skip to content

Commit 684e555

Browse files
fix - pipeline clone correct revision on release (#3)
1 parent f69bf94 commit 684e555

File tree

3 files changed

+23
-22
lines changed

3 files changed

+23
-22
lines changed

codefresh.yaml

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,43 @@ version: "1.0"
55
mode: parallel
66
# Stages can help you organize your steps in stages
77
stages:
8+
- "prepare"
89
- "clone"
910
- "build"
1011
- "test"
1112

1213
steps:
13-
clone:
14-
title: "Cloning repository"
15-
type: "git-clone"
16-
repo: "codefresh-contrib/vcluster-prometheus-operator-plugin"
17-
revision: "${{CF_BRANCH}}"
18-
git: "codefresh-git-integration-contrib"
19-
stage: "clone"
2014

21-
export_image_tag:
22-
title: "Export image tag"
15+
preapre_env:
16+
title: "Prepare variables"
2317
type: freestyle
24-
stage: build
18+
stage: prepare
2519
image: alpine
2620
commands:
2721
- |
2822
export isRelease="${{RELEASE}}"
2923
if [[ "$isRelease" == "true" ]]; then
3024
export IMAGE_TAG="${{CF_RELEASE_TAG}}"
25+
export CLONE_REVISION="${{CF_RELEASE_TAG}}"
3126
else
3227
export IMAGE_TAG="${{CF_BRANCH_TAG_NORMALIZED_LOWER_CASE}}"
28+
export CLONE_REVISION="${{CF_BRANCH}}"
3329
fi
3430
35-
cf_export IMAGE_TAG
31+
cf_export IMAGE_TAG CLONE_REVISION
3632
33+
clone:
34+
title: "Cloning repository"
35+
type: "git-clone"
36+
repo: "codefresh-contrib/vcluster-prometheus-operator-plugin"
37+
revision: "${{CLONE_REVISION}}"
38+
git: "codefresh-git-integration-contrib"
39+
stage: "clone"
40+
when:
41+
steps:
42+
- name: preapre_env
43+
on:
44+
- success
3745

3846
build_v1:
3947
title: "Build v1"
@@ -50,16 +58,13 @@ steps:
5058
builder:
5159
driver_opts: "image=moby/buildkit:v0.14.1"
5260
cache_from:
53-
- ghcr.io/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:v1-${{CF_BRANCH_TAG_NORMALIZED_LOWER_CASE}}
61+
- ghcr.io/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:v1-${{IMAGE_TAG}}
5462
- ghcr.io/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:v1-main
5563
when:
5664
steps:
5765
- name: clone
5866
on:
5967
- success
60-
- name: export_image_tag
61-
on:
62-
- success
6368

6469
build_v2:
6570
title: "Build v2"
@@ -76,7 +81,7 @@ steps:
7681
builder:
7782
driver_opts: "image=moby/buildkit:v0.14.1"
7883
cache_from:
79-
- ghcr.io/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:v2-${{CF_BRANCH_TAG_NORMALIZED_LOWER_CASE}}
84+
- ghcr.io/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:v2-${{IMAGE_TAG}}
8085
- ghcr.io/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:v2-main
8186
when:
8287
steps:
@@ -86,10 +91,6 @@ steps:
8691
- name: build_v1
8792
on:
8893
- success
89-
- name: export_image_tag
90-
on:
91-
- success
92-
9394

9495
create_clusters:
9596
title: 'Create k3d clusters'

v1/plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# with the other vcluster values during vcluster create or helm install.
33
plugin:
44
prometheus-operator-resources:
5-
image: ilmedcodefreh/vcluster-prom-operator-plugin
5+
image: ilmedcodefreh/vcluster-prom-operator-plugin:v1-v0.1.0
66
imagePullPolicy: IfNotPresent
77
rbac:
88
role:

v2/plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# with the other vcluster values during vcluster create or helm install.
33
plugins:
44
prometheus-operator-resources:
5-
image: ilmedcodefreh/vcluster-prom-operator-plugin
5+
image: ilmedcodefreh/vcluster-prom-operator-plugin:v2-v0.1.0
66
imagePullPolicy: IfNotPresent
77
rbac:
88
role:

0 commit comments

Comments
 (0)