From 7d0c50b203b2e3a4dce60d5c4ea714cd9b8fa1d9 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 6 Jun 2023 14:09:35 +0100 Subject: [PATCH 1/2] Fix release selfhost pipeline --- .github/workflows/release-selfhost.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-selfhost.yml b/.github/workflows/release-selfhost.yml index 1ace297ed9..7a56748dfb 100644 --- a/.github/workflows/release-selfhost.yml +++ b/.github/workflows/release-selfhost.yml @@ -1,7 +1,7 @@ name: Budibase Release Selfhost on: - workflow_dispatch: + workflow_dispatch: jobs: release: @@ -16,8 +16,8 @@ jobs: fi - uses: actions/checkout@v2 - with: - fetch_depth: 0 + with: + fetch-depth: 0 - name: Fail if tag is not in master run: | @@ -38,7 +38,7 @@ jobs: echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - name: Tag and release Docker images (Self Host) - run: | + run: | docker login -u $DOCKER_USER -p $DOCKER_PASSWORD release_tag=v${{ env.RELEASE_VERSION }} @@ -52,7 +52,7 @@ jobs: docker tag budibase/apps:$release_tag budibase/apps:$SELFHOST_TAG docker tag budibase/worker:$release_tag budibase/worker:$SELFHOST_TAG docker tag budibase/proxy:$release_tag budibase/proxy:$SELFHOST_TAG - + # Push images docker push budibase/apps:$SELFHOST_TAG docker push budibase/worker:$SELFHOST_TAG @@ -74,15 +74,15 @@ jobs: yarn yarn specs popd - - - name: Setup Helm + + - name: Setup Helm uses: azure/setup-helm@v1 id: helm-install # 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 - name: Build and release helm chart - run: | + run: | git config user.name "Budibase Helm Bot" git config user.email "<>" git reset --hard From 40e32d430df8b04f217ee83183aa12b5101da544 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 6 Jun 2023 14:11:37 +0100 Subject: [PATCH 2/2] Allow version --- .github/workflows/deploy-cloud.yaml | 49 ++++++++++++++++------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/.github/workflows/deploy-cloud.yaml b/.github/workflows/deploy-cloud.yaml index d8f1ee88f9..9f933746d6 100644 --- a/.github/workflows/deploy-cloud.yaml +++ b/.github/workflows/deploy-cloud.yaml @@ -1,45 +1,53 @@ name: Budibase Deploy Production on: - workflow_dispatch: + workflow_dispatch: + inputs: + version: + description: Budibase release version. For example - 1.0.0 + required: false jobs: release: runs-on: ubuntu-latest steps: - - name: Fail if not a tag - run: | - if [[ $GITHUB_REF != refs/tags/* ]]; then - echo "Workflow Dispatch can only be run on tags" - exit 1 - fi + # - name: Fail if not a tag + # run: | + # if [[ $GITHUB_REF != refs/tags/* ]]; then + # echo "Workflow Dispatch can only be run on tags" + # exit 1 + # fi - uses: actions/checkout@v2 - with: - fetch-depth: 0 + # with: + # fetch-depth: 0 - - name: Fail if tag is not in master - run: | - 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" - exit 1 - fi + # - name: Fail if tag is not in master + # run: | + # 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" + # exit 1 + # fi - name: Pull values.yaml from budibase-infra - run: | + run: | curl -H "Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}" \ -H 'Accept: application/vnd.github.v3.raw' \ -o values.production.yaml \ -L https://api.github.com/repos/budibase/budibase-infra/contents/kubernetes/values.yaml wc -l values.production.yaml - + - name: Get the latest budibase release version id: version - run: | - release_version=$(cat lerna.json | jq -r '.version') + run: | + 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 - + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: @@ -66,4 +74,3 @@ jobs: webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }} content: "Production Deployment Complete: ${{ env.RELEASE_VERSION }} deployed to Budibase Cloud." embed-title: ${{ env.RELEASE_VERSION }} -