Skip to content

Commit

Permalink
add include chart
Browse files Browse the repository at this point in the history
  • Loading branch information
robertlincecum committed Mar 7, 2024
1 parent baa00bf commit 9915847
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 30 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/build-deploy-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ on:
required: false
type: string
default: npm run build
include_chart:
required: false
type: boolean
default: true

secrets:
GH_PAT:
Expand Down Expand Up @@ -149,9 +153,11 @@ jobs:
run: ${{ inputs.rails }}

- name: Sync Chart.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml

- name: Sync values.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -i ".${{ env.CAMEL_CASE_REPO_NAME }}.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml

- name: Install Dependencies
Expand Down Expand Up @@ -396,9 +402,10 @@ jobs:
echo "VERSION=$VERSION_VALUE" >> $GITHUB_ENV
- name: Update Chart.yaml version
if: ${{ inputs.update_version }}
if: ${{ inputs.update_version && inputs.include_chart }}
run: yq eval -P -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml
- name: Update values.yaml version
if: ${{ inputs.update_version && inputs.include_chart }}
run: yq eval -P -i ".${{ env.CAMEL_CASE_REPO_NAME }}.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml

- name: Update package-lock.json
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/build-deploy-ts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ on:
required: false
type: string
default: npm run build
include_chart:
required: false
type: boolean
default: true

secrets:
GH_PAT:
Expand Down Expand Up @@ -148,9 +152,11 @@ jobs:
run: ${{ inputs.rails }}

- name: Sync Chart.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml

- name: Sync values.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -i ".${{ env.CAMEL_CASE_REPO_NAME }}.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml

- name: Install Dependencies
Expand Down Expand Up @@ -395,9 +401,10 @@ jobs:
echo "VERSION=$VERSION_VALUE" >> $GITHUB_ENV
- name: Update Chart.yaml version
if: ${{ inputs.update_version }}
if: ${{ inputs.update_version && inputs.include_chart }}
run: yq eval -P -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml
- name: Update values.yaml version
if: ${{ inputs.update_version && inputs.include_chart }}
run: yq eval -P -i ".${{ env.CAMEL_CASE_REPO_NAME }}.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml

- name: Update package-lock.json
Expand Down
40 changes: 25 additions & 15 deletions .github/workflows/cut-release-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ on:
include_chart:
required: false
type: boolean
default: false
default: true
needs_docker:
required: false
type: boolean
Expand Down Expand Up @@ -179,9 +179,11 @@ jobs:
echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV
- name: Update Chart.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -P -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml

- name: Update values.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -P -i ".${{ env.CAMEL_CASE_REPO_NAME }}.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml

- name: Update version environment variable
Expand Down Expand Up @@ -231,9 +233,11 @@ jobs:
run: npm i --package-lock-only --ignore-scripts

- name: Update Chart.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -P -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml

- name: Update values.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -P -i ".${{ env.CAMEL_CASE_REPO_NAME }}.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml

- uses: stefanzweifel/git-auto-commit-action@v4
Expand Down Expand Up @@ -312,9 +316,11 @@ jobs:
echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV
- name: Update Chart.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -P -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml

- name: Update values.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -P -i ".${{ env.CAMEL_CASE_REPO_NAME }}.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml

- name: Update version environment variable
Expand Down Expand Up @@ -364,9 +370,11 @@ jobs:
run: npm i --package-lock-only --ignore-scripts

- name: Update Chart.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -P -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml

- name: Update values.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -P -i ".${{ env.CAMEL_CASE_REPO_NAME }}.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml

- uses: stefanzweifel/git-auto-commit-action@v4
Expand Down Expand Up @@ -445,13 +453,13 @@ jobs:
echo "v$(semver -i patch $(sed 's/^v//' VERSION))" > VERSION
echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
- name: Update Chart.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -P -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml

- name: Update values.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -P -i ".${{ env.CAMEL_CASE_REPO_NAME }}.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml
## - name: Update Chart.yaml version
## if: ${{ inputs.include_chart }}
## run: yq eval -P -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml
##
## - name: Update values.yaml version
## if: ${{ inputs.include_chart }}
## run: yq eval -P -i ".${{ env.CAMEL_CASE_REPO_NAME }}.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml

- name: Update version environment variable
run: echo "VERSION=$(echo $VERSION | sed 's/\.[0-9]*$//')" >> $GITHUB_ENV
Expand Down Expand Up @@ -495,13 +503,13 @@ jobs:
echo "v$(semver -i minor $(cat VERSION | sed 's/^v//;s/-pre$//'))-pre" > VERSION
echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
- name: Update Chart.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -P -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml

- name: Update values.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -P -i ".${{ env.CAMEL_CASE_REPO_NAME }}.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml
## - name: Update Chart.yaml version
## if: ${{ inputs.include_chart }}
## run: yq eval -P -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml
##
## - name: Update values.yaml version
## if: ${{ inputs.include_chart }}
## run: yq eval -P -i ".${{ env.CAMEL_CASE_REPO_NAME }}.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml

- uses: stefanzweifel/git-auto-commit-action@v4
with:
Expand Down Expand Up @@ -540,6 +548,7 @@ jobs:
token_secret_name: ${{ inputs.token_secret_name }}
needs_docker: ${{ inputs.needs_docker }}
build_command: ${{ inputs.build_command }}
include_chart: ${{ inputs.include_chart }}



Expand Down Expand Up @@ -573,6 +582,7 @@ jobs:
token_secret_name: ${{ inputs.token_secret_name }}
needs_docker: ${{ inputs.needs_docker }}
build_command: ${{ inputs.build_command }}
include_chart: ${{ inputs.include_chart }}

deployReleaseCandidateGo:
uses: ./.github/workflows/build-deploy-go.yml
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/deploy-dev-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ on:
include_chart:
required: false
type: boolean
default: false
default: true
needs_docker:
required: false
type: boolean
Expand Down Expand Up @@ -140,6 +140,7 @@ jobs:
gcp_project_id: ${{ inputs.gcp_project_id }}
token_secret_name: ${{ inputs.token_secret_name }}
build_command: ${{ inputs.build_command }}
include_chart: ${{ inputs.include_chart }}

buildDeployDevJS:
needs: detect-language
Expand Down Expand Up @@ -168,6 +169,7 @@ jobs:
needs_docker: ${{ inputs.needs_docker }}
token_secret_name: ${{ inputs.token_secret_name }}
build_command: ${{ inputs.build_command }}
include_chart: ${{ inputs.include_chart }}

buildDeployDevGo:
needs: detect-language
Expand All @@ -191,7 +193,7 @@ jobs:
skip_deploy: ${{ inputs.skip_deploy }}
build_command: ${{ inputs.build_command }}
needs_docker: ${{ inputs.needs_docker }}
include_chart: ${{ inputs.include_chart }}
include_chart: false
rails: '[[ "$VERSION" =~ "pre" ]]'
tag: false
name_override: ${{ inputs.name_override }}
Expand Down
24 changes: 15 additions & 9 deletions .github/workflows/deploy-prod-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ on:
include_chart:
required: false
type: boolean
default: false
default: true
name_override:
required: false
type: string
Expand Down Expand Up @@ -168,9 +168,11 @@ jobs:
echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV
- name: Update Chart.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml

- name: Update values.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -i ".${{ env.CAMEL_CASE_REPO_NAME }}.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml

- uses: stefanzweifel/git-auto-commit-action@v4
Expand Down Expand Up @@ -244,9 +246,11 @@ jobs:
echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV
- name: Update Chart.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml

- name: Update values.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -i ".${{ env.CAMEL_CASE_REPO_NAME }}.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml

- uses: stefanzweifel/git-auto-commit-action@v4
Expand Down Expand Up @@ -316,13 +320,13 @@ jobs:
echo "v$(semver -i patch $(sed 's/^v//' VERSION))" > VERSION
echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
- name: Update Chart.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml

- name: Update values.yaml version
if: ${{ inputs.include_chart }}
run: yq eval -i ".${{ env.CAMEL_CASE_REPO_NAME }}.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml
## - name: Update Chart.yaml version
## if: ${{ inputs.include_chart }}
## run: yq eval -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml
##
## - name: Update values.yaml version
## if: ${{ inputs.include_chart }}
## run: yq eval -i ".${{ env.CAMEL_CASE_REPO_NAME }}.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml

- uses: stefanzweifel/git-auto-commit-action@v4
with:
Expand Down Expand Up @@ -358,6 +362,7 @@ jobs:
token_secret_name: ${{ inputs.token_secret_name }}
needs_docker: ${{ inputs.needs_docker }}
build_command: ${{ inputs.build_command }}
include_chart: ${{ inputs.include_chart }}

buildDeploySandboxTS:
needs: [createProdTagTS]
Expand Down Expand Up @@ -386,6 +391,7 @@ jobs:
token_secret_name: ${{ inputs.token_secret_name }}
needs_docker: ${{ inputs.needs_docker }}
build_command: ${{ inputs.build_command }}
include_chart: ${{ inputs.include_chart }}

buildDeployProdGo:
needs: [createProdTagGo]
Expand All @@ -410,7 +416,7 @@ jobs:
skip_deploy: ${{ inputs.skip_deploy }}
build_command: ${{ inputs.build_command }}
needs_docker: ${{ inputs.needs_docker }}
include_chart: ${{ inputs.include_chart }}
include_chart: false
name_override: ${{ inputs.name_override }}
gcp_project_id: ${{ inputs.gcp_project_id }}
token_secret_name: ${{ inputs.token_secret_name }}
6 changes: 4 additions & 2 deletions .github/workflows/deploy-sandbox-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ on:
include_chart:
required: false
type: boolean
default: false
default: true
update_version:
required: false
type: boolean
Expand Down Expand Up @@ -131,6 +131,7 @@ jobs:
token_secret_name: ${{ inputs.token_secret_name }}
needs_docker: ${{ inputs.needs_docker }}
build_command: ${{ inputs.build_command }}
include_chart: ${{ inputs.include_chart }}

buildDeploySandboxTS:
needs: detect-language
Expand Down Expand Up @@ -160,6 +161,7 @@ jobs:
token_secret_name: ${{ inputs.token_secret_name }}
needs_docker: ${{ inputs.needs_docker }}
build_command: ${{ inputs.build_command }}
include_chart: ${{ inputs.include_chart }}

buildDeploySandboxGo:
needs: detect-language
Expand All @@ -185,7 +187,7 @@ jobs:
skip_deploy: ${{ inputs.skip_deploy }}
build_command: ${{ inputs.build_command }}
needs_docker: ${{ inputs.needs_docker }}
include_chart: ${{ inputs.include_chart }}
include_chart: false
name_override: ${{ inputs.name_override }}
gcp_project_id: ${{ inputs.gcp_project_id }}
token_secret_name: ${{ inputs.token_secret_name }}

0 comments on commit 9915847

Please sign in to comment.