Merge pull request #10800 from Budibase/pipeline-hotfixes

Pipeline hotfixes
This commit is contained in:
Adria Navarro 2023-06-06 15:13:02 +02:00 committed by GitHub
commit 1c6ff73c19
2 changed files with 36 additions and 29 deletions

View File

@ -1,45 +1,53 @@
name: Budibase Deploy Production name: Budibase Deploy Production
on: on:
workflow_dispatch: workflow_dispatch:
inputs:
version:
description: Budibase release version. For example - 1.0.0
required: false
jobs: jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Fail if not a tag # - name: Fail if not a tag
run: | # run: |
if [[ $GITHUB_REF != refs/tags/* ]]; then # if [[ $GITHUB_REF != refs/tags/* ]]; then
echo "Workflow Dispatch can only be run on tags" # echo "Workflow Dispatch can only be run on tags"
exit 1 # exit 1
fi # fi
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: # with:
fetch-depth: 0 # fetch-depth: 0
- name: Fail if tag is not in master # - name: Fail if tag is not in master
run: | # run: |
if ! git merge-base --is-ancestor ${{ github.sha }} origin/master; then # if ! git merge-base --is-ancestor ${{ github.sha }} origin/master; then
echo "Tag is not in master. This pipeline can only execute tags that are present on the master branch" # echo "Tag is not in master. This pipeline can only execute tags that are present on the master branch"
exit 1 # exit 1
fi # fi
- name: Pull values.yaml from budibase-infra - name: Pull values.yaml from budibase-infra
run: | run: |
curl -H "Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}" \ curl -H "Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}" \
-H 'Accept: application/vnd.github.v3.raw' \ -H 'Accept: application/vnd.github.v3.raw' \
-o values.production.yaml \ -o values.production.yaml \
-L https://api.github.com/repos/budibase/budibase-infra/contents/kubernetes/values.yaml -L https://api.github.com/repos/budibase/budibase-infra/contents/kubernetes/values.yaml
wc -l values.production.yaml wc -l values.production.yaml
- name: Get the latest budibase release version - name: Get the latest budibase release version
id: version id: version
run: | run: |
release_version=$(cat lerna.json | jq -r '.version') if [ -z "${{ github.event.inputs.version }}" ]; then
release_version=$(cat lerna.json | jq -r '.version')
else
release_version=${{ github.event.inputs.version }}
fi
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
- name: Configure AWS Credentials - name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1 uses: aws-actions/configure-aws-credentials@v1
with: with:
@ -66,4 +74,3 @@ jobs:
webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }} webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }}
content: "Production Deployment Complete: ${{ env.RELEASE_VERSION }} deployed to Budibase Cloud." content: "Production Deployment Complete: ${{ env.RELEASE_VERSION }} deployed to Budibase Cloud."
embed-title: ${{ env.RELEASE_VERSION }} embed-title: ${{ env.RELEASE_VERSION }}

View File

@ -1,7 +1,7 @@
name: Budibase Release Selfhost name: Budibase Release Selfhost
on: on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
release: release:
@ -16,8 +16,8 @@ jobs:
fi fi
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
fetch_depth: 0 fetch-depth: 0
- name: Fail if tag is not in master - name: Fail if tag is not in master
run: | run: |
@ -38,7 +38,7 @@ jobs:
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
- name: Tag and release Docker images (Self Host) - name: Tag and release Docker images (Self Host)
run: | run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
release_tag=v${{ env.RELEASE_VERSION }} release_tag=v${{ env.RELEASE_VERSION }}
@ -52,7 +52,7 @@ jobs:
docker tag budibase/apps:$release_tag budibase/apps:$SELFHOST_TAG docker tag budibase/apps:$release_tag budibase/apps:$SELFHOST_TAG
docker tag budibase/worker:$release_tag budibase/worker:$SELFHOST_TAG docker tag budibase/worker:$release_tag budibase/worker:$SELFHOST_TAG
docker tag budibase/proxy:$release_tag budibase/proxy:$SELFHOST_TAG docker tag budibase/proxy:$release_tag budibase/proxy:$SELFHOST_TAG
# Push images # Push images
docker push budibase/apps:$SELFHOST_TAG docker push budibase/apps:$SELFHOST_TAG
docker push budibase/worker:$SELFHOST_TAG docker push budibase/worker:$SELFHOST_TAG
@ -74,15 +74,15 @@ jobs:
yarn yarn
yarn specs yarn specs
popd popd
- name: Setup Helm - name: Setup Helm
uses: azure/setup-helm@v1 uses: azure/setup-helm@v1
id: helm-install id: helm-install
# due to helm repo index issue: https://github.com/helm/helm/issues/7363 # due to helm repo index issue: https://github.com/helm/helm/issues/7363
# we need to create new package in a different dir, merge the index and move the package back # we need to create new package in a different dir, merge the index and move the package back
- name: Build and release helm chart - name: Build and release helm chart
run: | run: |
git config user.name "Budibase Helm Bot" git config user.name "Budibase Helm Bot"
git config user.email "<>" git config user.email "<>"
git reset --hard git reset --hard