Skip to content

Instantly share code, notes, and snippets.

@luckylittle
Last active June 24, 2024 07:49
Show Gist options
  • Save luckylittle/6815a4599232581faf60d68b0f92076e to your computer and use it in GitHub Desktop.
Save luckylittle/6815a4599232581faf60d68b0f92076e to your computer and use it in GitHub Desktop.
Codefresh pipeline to publish Helm charts from a Github repo to JFrog Artifactory
version: '1.0'
##
## Project variables:
## JFROG_GLOBAL_CONFIG = <REDACTED>
## GLOBAL_GIT_PROVIDER = github
## HELM_IMAGE = <REDACTED>/codefresh-image:latest
## ARTIFACTORY_REPO_PATH = common-release-helm
##
## Pipeline variables:
## GIT_REPOSITORY = https://github.com/PF-POC/helm-repository
## SOURCE_REVISION = master
## GIT_WORKING_DIR = non-prod
## APP_PATH = charts
## APP_NAME = compliance-operator-full-stack
## CHART_VERSION = 1.0.30
stages:
- prepare
- execute
steps:
initial_clone:
title: "Cloning repository"
type: "git-clone"
git: ${{GLOBAL_GIT_PROVIDER}}'
stage: prepare
repo: ${{GIT_REPOSITORY}}
revision: ${{SOURCE_REVISION}}
execute_helm:
title: "Initate the Helm process"
stage: execute
image: ${{HELM_IMAGE}}
working_directory: ${{GIT_WORKING_DIR}}
commands:
- pwd
- jf config import ${{JFROG_GLOBAL_CONFIG}}
- helm dependency update ${{APP_PATH}}/${{APP_NAME}}
- helm lint ${{APP_PATH}}/${{APP_NAME}}
- helm package ${{APP_PATH}}/${{APP_NAME}} --version ${{CHART_VERSION}} -d ./${{APP_NAME}}
- jf rt upload ./${{APP_NAME}}/*.tgz ${{ARTIFACTORY_REPO_PATH}}
- echo "Pushed chart to Artifactory:" ${{ARTIFACTORY_REPO_PATH}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment