Skip to content

upload https://jihulab.com/api/v4/projects/85949/packages/helm/stable/charts/dt-platform-0.1.2.tgz #45

upload https://jihulab.com/api/v4/projects/85949/packages/helm/stable/charts/dt-platform-0.1.2.tgz

upload https://jihulab.com/api/v4/projects/85949/packages/helm/stable/charts/dt-platform-0.1.2.tgz #45

Workflow file for this run

name: CHART-UPLOAD
on:
workflow_dispatch:
inputs:
CHART_PACKAGE_NAME:
description: "The package name of helm chart, push to apecloud-cd upload-charts dir first (e.g. pyroscope-0.2.92.tgz)"
required: false
default: ''
CHART_PACKAGE_URL:
description: "The package url of helm chart"
required: false
default: ''
PROJECT_ID:
description: "The jihulab priject id to upload (e.g. kubeblocks/addons/tools/plugins)"
type: string
required: false
default: ''
run-name: upload ${{ inputs.CHART_PACKAGE_NAME }} ${{ inputs.CHART_PACKAGE_URL }}
env:
CR_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
JIHULAB_ACCESS_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }}
JIHULAB_ACCESS_USER: ${{ secrets.GITLAB_ACCESS_USER }}
CR_VERSION: 1.4.1
jobs:
upload-chart:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install cr
run: |
bash ${{ github.workspace }}/.github/utils/helm_package.sh --install-cr true
- name: copy helm chart
run: |
if [[ -n "${{ inputs.CHART_PACKAGE_URL }}" ]]; then
PACKAGE_NAME=$(echo "${{ inputs.CHART_PACKAGE_URL }}" | rev | cut -d'/' -f1 | rev)
curl -L -O ${{ inputs.CHART_PACKAGE_URL }}
mv $PACKAGE_NAME .cr-release-packages
elif [[ -n "${{ inputs.CHART_PACKAGE_NAME }}" ]]; then
cp upload-charts/${{ inputs.CHART_PACKAGE_NAME }} .cr-release-packages
else
echo "helm chart package or helm chart url not found"
exit 1
fi
- name: Checkout helm-charts Code
uses: actions/checkout@v3
with:
repository: apecloud/helm-charts
path: helm-charts
token: ${{ env.CR_TOKEN }}
- name: Upload Helm Charts to Jihulab
run: |
ls .cr-release-packages
cd .cr-release-packages
bash ${{ github.workspace }}/.github/utils/release_gitlab.sh \
--type 3 \
--asset-path ./ \
--charts-dir "${{ github.workspace }}/helm-charts/deploy" \
--access-token "${{ env.JIHULAB_ACCESS_TOKEN }}" \
--access-user "${{ env.JIHULAB_ACCESS_USER }}" \
--project-id "${{ env.PROJECT_ID }}"
- name: Fetch helm-charts History And Configure Git
run: |
cd helm-charts
git fetch --prune --unshallow
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Upload and Index Helm Charts
shell: bash
run: |
cd helm-charts
args=(--owner "apecloud" --repo "helm-charts")
bash ${{ github.workspace }}/.github/utils/helm_release.sh "${args[@]}"