Skip to content

Build and Bundle Jfrog Helm chart #7

Build and Bundle Jfrog Helm chart

Build and Bundle Jfrog Helm chart #7

name: Build and Bundle Jfrog Helm chart
on:
workflow_dispatch:
inputs:
jfrog_project:
description: 'Name of the jfrog project to deploy the chart to'
required: true
default: 'ecosystem'
chart_name:
description: 'Name of the chart to build'
required: true
default: 'aerospike-vector-search'
repo_name:
description: 'Name of the jfrog repo to deploy the chart to'
required: true
default: 'ecosystem-helm-dev-local'
chart_version:
description: 'Build number to use for the build metadata'
required: true
default: '0.7.0'
env:
JF_PROJECT: ${{ github.event.inputs.jfrog_project }}
JF_REPO: ${{ github.event.inputs.repo_name }}
CHART_VERSION: ${{ github.event.inputs.chart_version }}
CHART_NAME: ${{ github.event.inputs.chart_name }}
jobs:
build-chart:
runs-on: ubuntu-latest
steps:
- name: Checkout current repository
uses: actions/checkout@v3
# You can sign helm charts but not doing this for now
# - name: setup GPG
# uses: aerospike/shared-workflows/devops/setup-gpg@main
# with:
# gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
# gpg-public-key: ${{ secrets.GPG_PUBLIC_KEY }}
# gpg-key-pass: ${{ secrets.GPG_PASS }}
# gpg-key-name: "aerospike-inc"
- name: setup jfrog
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: https://aerospike.jfrog.io
JF_ACCESS_TOKEN: ${{ secrets.JF_ECO_CONTRIB_TOKEN }}
JF_PROJECT: ${{ github.event.inputs.jfrog_project }}
- name: "Deploy helm to JFrog"
run: |
helm package $CHART_NAME
jf rt u "${{env.CHART_NAME}}-${{env.CHART_VERSION}}.tgz" "${{env.JF_REPO}}/${{env.CHART_NAME}}/${{env.CHART_VERSION}}/" \
--build-name="${{env.CHART_NAME}}-helm" --build-number="${{env.CHART_VERSION}}" --project="${{env.JF_PROJECT}}"
jf rt build-collect-env "${{env.CHART_NAME}}-helm" "${{env.CHART_VERSION}}"
jf rt build-add-git "${{env.CHART_NAME}}-helm" "${{env.CHART_VERSION}}"
jf rt build-publish "${{env.CHART_NAME}}-helm" "${{env.CHART_VERSION}}" --project="${{env.JF_PROJECT}}"
- name: Create release bundle
run: |
echo '{
"name": "${{ env.CHART_NAME }}-helm",
"version": "${{ env.CHART_VERSION }}",
"files": [
{
"project": "${{ env.JF_PROJECT }}",
"build": "${{ env.CHART_NAME }}-helm/${{ env.CHART_VERSION }}"
}
]
}' > release-bundle-spec.json
cat release-bundle-spec.json
jf release-bundle-create "${{ env.CHART_NAME }}-release-bundle" "${{ env.CHART_VERSION }}" \
--spec release-bundle-spec.json --project="${{ env.JF_PROJECT }}" --signing-key="aerospike"