Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix - pipeline clone correct revision on release #3

Merged
merged 3 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading