Skip to content

Commit

Permalink
Update .gitlab-ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mason committed Sep 6, 2024
1 parent b9af27e commit 0fd2f13
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
default:
tags:
- external
workflow:
rules:
- if: $CI_COMMIT_TAG

stages:
- package
Expand All @@ -9,26 +9,26 @@ stages:
variables:
CHART_NAME: "csghub"
CHART_PATH: "./charts/csghub"
PACKAGE_VERSION: "$CI_COMMIT_TAG"
HELM_REGISTRY: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/stable"

package_chart:
before_script:
- apt update && apt install -y curl git
- curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
- chmod 700 get_helm.sh
- ./get_helm.sh

package:
stage: package
image: alpine/helm:3.4.1 # 使用带有 Helm 的镜像
image: ubuntu:22.04
script:
- helm package $CHART_PATH -d ./
- helm repo add --username $CI_REGISTRY_USER --password $CI_REGISTRY_PASSWORD $CHART_NAME $HELM_REGISTRY
- helm plugin install https://github.com/chartmuseum/helm-push
- helm cm-push *.tgz $CHART_NAME
tags:
- external
artifacts:
paths:
- "*.tgz"
expire_in: 1 week

publish_chart:
stage: publish
image: alpine/helm:3.4.1
dependencies:
- package_chart
script:
- helm repo add --username $CI_REGISTRY_USER --password $CI_REGISTRY_PASSWORD $CHART_NAME $HELM_REGISTRY
- helm cm-push *.tgz $CHART_NAME
only:
- main

0 comments on commit 0fd2f13

Please sign in to comment.