-
Notifications
You must be signed in to change notification settings - Fork 5
Fixes the release 400 error on smoke tests
#11
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
base: main
Are you sure you want to change the base?
Changes from 12 commits
77a4e51
5037334
b5289bc
d4cd8bb
6f10dca
b0d38d2
f63904b
1f910a0
6d32cf5
bf93679
4963477
700ac60
7251341
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,9 @@ inputs: | |
| description: 'The directory containing multiple yamls for a Replicated release.' | ||
| required: true | ||
| default: 'manifests' | ||
| version: | ||
| description: 'Provides version to use for the Replicated Release' | ||
| reqired: false | ||
| kubernetes-distribution: | ||
| description: 'Kubernetes distribution of the cluster to provision.' | ||
| required: true | ||
|
|
@@ -39,12 +42,59 @@ inputs: | |
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Extract Chart YAML | ||
| id: extract-chart-yaml | ||
| if: inputs.version == '' | ||
| shell: bash | ||
| run: | | ||
| tarball=$(find ${YAML_DIR} -name "${CHART_NAME}*.tgz") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this will break if the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, all the manipulation of the chart will break, I should make those conditional
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. made a few more things conditional |
||
| chart_yaml=$(tar -xzvf ${tarball} $(tar -tzf ${tarball} --exclude "*/charts/*" | grep Chart.yaml)) | ||
| echo "CHART_YAML=${chart_yaml}" >> $GITHUB_ENV | ||
| env: | ||
| YAML_DIR: ${{ inputs.yaml-dir }} | ||
| CHART_NAME: ${{ inputs.helm-chart-name }} | ||
| - name: Get Chart Version | ||
| id: get-chart-version | ||
| if: inputs.version == '' | ||
| uses: mikefarah/yq@master | ||
| with: | ||
| cmd: yq '.version' ${CHART_YAML} | ||
| - name: Define App Version | ||
| shell: bash | ||
| run: echo "APP_VERSION=0.0.1-${GITHUB_REF_NAME//[^a-zA-Z0-9]/}.${GITHUB_RUN_ID}${GITHUB_RUN_ATTEMPT}" >> $GITHUB_ENV | ||
| if: inputs.version == '' | ||
| run: echo "APP_VERSION=${CHART_VERSION}+${GITHUB_REF_NAME//[^a-zA-Z0-9]/}.${GITHUB_RUN_ID}${GITHUB_RUN_ATTEMPT}" >> $GITHUB_ENV | ||
| env: | ||
| CHART_VERSION: ${{ steps.get-chart-version.outputs.result }} | ||
crdant marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: Use Explicit Version | ||
| shell: bash | ||
| if: inputs.version != '' | ||
| run: echo "APP_VERSION=${VERSION}" >> $GITHUB_ENV | ||
| env: | ||
| VERSION: ${{ inputs.version }} | ||
| - name: Define Channel Name | ||
| shell: bash | ||
| run: echo "CHANNEL_NAME=${{ github.ref_name }}-${GITHUB_RUN_ID}${GITHUB_RUN_ATTEMPT}-${{ inputs.kubernetes-distribution }}-${{ inputs.kubernetes-version }}" >> $GITHUB_ENV | ||
| - name: Update Chart YAML | ||
| id: update-chart-yaml | ||
| if: inputs.version == '' | ||
| uses: mikefarah/yq@master | ||
| with: | ||
| cmd: yq -i '.version = "${{ env.APP_VERSION }}"' ${CHART_YAML} | ||
| - name: Update Chart Version | ||
| id: update-chart-version | ||
| shell: bash | ||
| if: inputs.installation-method == 'helm' && inputs.version == '' | ||
| run: | | ||
| # update the chart version to match the Replicated app version | ||
| tarball=$(find ${YAML_DIR} -name "${CHART_NAME}*.tgz") | ||
| mkdir -p /tmp/repack | ||
| tar -xf ${tarball} -C /tmp/repack | ||
| helm package --version "${{ env.APP_VERSION }}" /tmp/repack/${CHART_NAME}* | ||
| mv ${{ inputs.helm-chart-name }}-${{env.APP_VERSION }}.tgz $(dirname ${tarball}) | ||
| rm ${tarball} | ||
| env: | ||
| YAML_DIR: ${{ inputs.yaml-dir }} | ||
| CHART_NAME: ${{ inputs.helm-chart-name }} | ||
| - name: 'Create Release' | ||
| id: 'create-release' | ||
| uses: replicatedhq/compatibility-actions/create-release@v0 | ||
|
|
@@ -124,4 +174,4 @@ runs: | |
| with: | ||
| app-slug: ${{ inputs.app-slug }} | ||
| api-token: ${{ inputs.api-token }} | ||
| channel-slug: ${{ steps.create-release.outputs.channel-slug }} | ||
| channel-slug: ${{ steps.create-release.outputs.channel-slug }} | ||
Uh oh!
There was an error while loading. Please reload this page.