Skip to content

Commit

Permalink
fix - pipeline clone correct revision on release (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilia-medvedev-codefresh authored Jul 2, 2024
1 parent f69bf94 commit 684e555
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
41 changes: 21 additions & 20 deletions codefresh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,43 @@ version: "1.0"
mode: parallel
# Stages can help you organize your steps in stages
stages:
- "prepare"
- "clone"
- "build"
- "test"

steps:
clone:
title: "Cloning repository"
type: "git-clone"
repo: "codefresh-contrib/vcluster-prometheus-operator-plugin"
revision: "${{CF_BRANCH}}"
git: "codefresh-git-integration-contrib"
stage: "clone"

export_image_tag:
title: "Export image tag"
preapre_env:
title: "Prepare variables"
type: freestyle
stage: build
stage: prepare
image: alpine
commands:
- |
export isRelease="${{RELEASE}}"
if [[ "$isRelease" == "true" ]]; then
export IMAGE_TAG="${{CF_RELEASE_TAG}}"
export CLONE_REVISION="${{CF_RELEASE_TAG}}"
else
export IMAGE_TAG="${{CF_BRANCH_TAG_NORMALIZED_LOWER_CASE}}"
export CLONE_REVISION="${{CF_BRANCH}}"
fi
cf_export IMAGE_TAG
cf_export IMAGE_TAG CLONE_REVISION
clone:
title: "Cloning repository"
type: "git-clone"
repo: "codefresh-contrib/vcluster-prometheus-operator-plugin"
revision: "${{CLONE_REVISION}}"
git: "codefresh-git-integration-contrib"
stage: "clone"
when:
steps:
- name: preapre_env
on:
- success

build_v1:
title: "Build v1"
Expand All @@ -50,16 +58,13 @@ steps:
builder:
driver_opts: "image=moby/buildkit:v0.14.1"
cache_from:
- ghcr.io/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:v1-${{CF_BRANCH_TAG_NORMALIZED_LOWER_CASE}}
- ghcr.io/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:v1-${{IMAGE_TAG}}
- ghcr.io/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:v1-main
when:
steps:
- name: clone
on:
- success
- name: export_image_tag
on:
- success

build_v2:
title: "Build v2"
Expand All @@ -76,7 +81,7 @@ steps:
builder:
driver_opts: "image=moby/buildkit:v0.14.1"
cache_from:
- ghcr.io/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:v2-${{CF_BRANCH_TAG_NORMALIZED_LOWER_CASE}}
- ghcr.io/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:v2-${{IMAGE_TAG}}
- ghcr.io/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:v2-main
when:
steps:
Expand All @@ -86,10 +91,6 @@ steps:
- name: build_v1
on:
- success
- name: export_image_tag
on:
- success


create_clusters:
title: 'Create k3d clusters'
Expand Down
2 changes: 1 addition & 1 deletion v1/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# with the other vcluster values during vcluster create or helm install.
plugin:
prometheus-operator-resources:
image: ilmedcodefreh/vcluster-prom-operator-plugin
image: ilmedcodefreh/vcluster-prom-operator-plugin:v1-v0.1.0
imagePullPolicy: IfNotPresent
rbac:
role:
Expand Down
2 changes: 1 addition & 1 deletion v2/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# with the other vcluster values during vcluster create or helm install.
plugins:
prometheus-operator-resources:
image: ilmedcodefreh/vcluster-prom-operator-plugin
image: ilmedcodefreh/vcluster-prom-operator-plugin:v2-v0.1.0
imagePullPolicy: IfNotPresent
rbac:
role:
Expand Down

0 comments on commit 684e555

Please sign in to comment.