From 6aa29bb7950c52b916897527b9a8d9959e3ea178 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 14:29:57 +0530 Subject: [PATCH 01/23] wip --- .github/workflows/build-branch.yml | 111 +++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 .github/workflows/build-branch.yml diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml new file mode 100644 index 00000000000..ca786353826 --- /dev/null +++ b/.github/workflows/build-branch.yml @@ -0,0 +1,111 @@ + +name: Docker Branch Build + +on: + workflow_dispatch + +env: + gh_branch: ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} + +jobs: + branch_build_and_push: + # if: github.ref_protected == true + name: Build and Push Web/Space/API/Proxy Docker Image + runs-on: ubuntu-20.04 + + steps: + - name: Check out the repo + uses: actions/checkout@v3.3.0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2.5.0 + + - name: Login to Docker Hub + uses: docker/login-action@v2.1.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + # - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release + # id: metaFrontend + # uses: docker/metadata-action@v4.3.0 + # with: + # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-$GITHUB_REF_NAME + # tags: | + # type=ref,event=tag + + # - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release + # id: metaBackend + # uses: docker/metadata-action@v4.3.0 + # with: + # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend-$GITHUB_REF_NAME + # tags: | + # type=ref,event=tag + + # - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release + # id: metaSpace + # uses: docker/metadata-action@v4.3.0 + # with: + # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-$GITHUB_REF_NAME + # tags: | + # type=ref,event=tag + + # - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release + # id: metaProxy + # uses: docker/metadata-action@v4.3.0 + # with: + # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy-$GITHUB_REF_NAME + # tags: | + # type=ref,event=tag + + # - name: Build and Push Frontend to Docker Container Registry + # uses: docker/build-push-action@v4.0.0 + # with: + # context: . + # file: ./web/Dockerfile.web + # platforms: linux/amd64 + # tags: ${{ steps.metaFrontend.outputs.tags }} + # push: true + # env: + # DOCKER_BUILDKIT: 1 + # DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + # DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + + # - name: Build and Push Backend to Docker Hub + # uses: docker/build-push-action@v4.0.0 + # with: + # context: ./apiserver + # file: ./apiserver/Dockerfile.api + # platforms: linux/amd64 + # push: true + # tags: ${{ steps.metaBackend.outputs.tags }} + # env: + # DOCKER_BUILDKIT: 1 + # DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + # DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + + # - name: Build and Push Plane-Deploy to Docker Hub + # uses: docker/build-push-action@v4.0.0 + # with: + # context: . + # file: ./space/Dockerfile.space + # platforms: linux/amd64 + # push: true + # tags: ${{ steps.metaSpace.outputs.tags }} + # env: + # DOCKER_BUILDKIT: 1 + # DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + # DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + + # - name: Build and Push Plane-Proxy to Docker Hub + # uses: docker/build-push-action@v4.0.0 + # with: + # context: ./nginx + # file: ./nginx/Dockerfile + # platforms: linux/amd64 + # push: true + # tags: ${{ steps.metaProxy.outputs.tags }} + # env: + # DOCKER_BUILDKIT: 1 + # DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + # DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} From 5467f3cd21df70abf7c67d74dae068812e1f9dec Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 14:35:37 +0530 Subject: [PATCH 02/23] wip --- .github/workflows/build-branch.yml | 38 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index ca786353826..84eb0a30207 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -26,13 +26,13 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - # - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release - # id: metaFrontend - # uses: docker/metadata-action@v4.3.0 - # with: - # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-$GITHUB_REF_NAME - # tags: | - # type=ref,event=tag + - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release + id: metaFrontend + uses: docker/metadata-action@v4.3.0 + with: + images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-$GITHUB_REF_NAME + tags: | + type=ref,event=tag # - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release # id: metaBackend @@ -58,18 +58,18 @@ jobs: # tags: | # type=ref,event=tag - # - name: Build and Push Frontend to Docker Container Registry - # uses: docker/build-push-action@v4.0.0 - # with: - # context: . - # file: ./web/Dockerfile.web - # platforms: linux/amd64 - # tags: ${{ steps.metaFrontend.outputs.tags }} - # push: true - # env: - # DOCKER_BUILDKIT: 1 - # DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - # DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and Push Frontend to Docker Container Registry + uses: docker/build-push-action@v4.0.0 + with: + context: . + file: ./web/Dockerfile.web + platforms: linux/amd64 + tags: ${{ steps.metaFrontend.outputs.tags }} + push: true + env: + DOCKER_BUILDKIT: 1 + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} # - name: Build and Push Backend to Docker Hub # uses: docker/build-push-action@v4.0.0 From 07eb244e3c9792c51b595732f111dd590add9bbb Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 15:25:55 +0530 Subject: [PATCH 03/23] testing --- .github/workflows/build-branch.yml | 11 ++++++----- .gitignore | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 84eb0a30207..ef1e1bae079 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -5,7 +5,8 @@ on: workflow_dispatch env: - gh_branch: ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} + gh_branch: develop + img_tag: ${GITHUB_RUN_ID} jobs: branch_build_and_push: @@ -30,7 +31,7 @@ jobs: id: metaFrontend uses: docker/metadata-action@v4.3.0 with: - images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-$GITHUB_REF_NAME + images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-$gh_branch tags: | type=ref,event=tag @@ -38,7 +39,7 @@ jobs: # id: metaBackend # uses: docker/metadata-action@v4.3.0 # with: - # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend-$GITHUB_REF_NAME + # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend-$gh_branch # tags: | # type=ref,event=tag @@ -46,7 +47,7 @@ jobs: # id: metaSpace # uses: docker/metadata-action@v4.3.0 # with: - # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-$GITHUB_REF_NAME + # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-$gh_branch # tags: | # type=ref,event=tag @@ -54,7 +55,7 @@ jobs: # id: metaProxy # uses: docker/metadata-action@v4.3.0 # with: - # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy-$GITHUB_REF_NAME + # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy-$gh_branch # tags: | # type=ref,event=tag diff --git a/.gitignore b/.gitignore index 1e99e102ad5..bcf9f12abf7 100644 --- a/.gitignore +++ b/.gitignore @@ -73,3 +73,4 @@ pnpm-lock.yaml pnpm-workspace.yaml .npmrc +.secrets From e6b338940df162af70c7eac86d8855add8f8978c Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 15:31:24 +0530 Subject: [PATCH 04/23] wip --- .github/workflows/build-branch.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index ef1e1bae079..87730b017e7 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -2,7 +2,11 @@ name: Docker Branch Build on: - workflow_dispatch + push: + branches-ignore: + - master +# on: +# workflow_dispatch env: gh_branch: develop From e9d2f585b750243241adca972fc06c5b6ddc64f3 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 15:33:14 +0530 Subject: [PATCH 05/23] wip --- .github/workflows/build-branch.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 87730b017e7..de6cc12b279 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -69,7 +69,8 @@ jobs: context: . file: ./web/Dockerfile.web platforms: linux/amd64 - tags: ${{ steps.metaFrontend.outputs.tags }} + tags: $img_tag + # tags: ${{ steps.metaFrontend.outputs.tags }} push: true env: DOCKER_BUILDKIT: 1 From 1c972c43da60af166f07cd7e8a82ceb54804bd83 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 15:34:23 +0530 Subject: [PATCH 06/23] wip --- .github/workflows/build-branch.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index de6cc12b279..9fc55a45214 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -35,7 +35,7 @@ jobs: id: metaFrontend uses: docker/metadata-action@v4.3.0 with: - images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-$gh_branch + images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ env.img_tag }} tags: | type=ref,event=tag @@ -43,7 +43,7 @@ jobs: # id: metaBackend # uses: docker/metadata-action@v4.3.0 # with: - # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend-$gh_branch + # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend-${{ env.img_tag }} # tags: | # type=ref,event=tag @@ -51,7 +51,7 @@ jobs: # id: metaSpace # uses: docker/metadata-action@v4.3.0 # with: - # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-$gh_branch + # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-${{ env.img_tag }} # tags: | # type=ref,event=tag @@ -59,7 +59,7 @@ jobs: # id: metaProxy # uses: docker/metadata-action@v4.3.0 # with: - # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy-$gh_branch + # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy-${{ env.img_tag }} # tags: | # type=ref,event=tag @@ -69,7 +69,7 @@ jobs: context: . file: ./web/Dockerfile.web platforms: linux/amd64 - tags: $img_tag + tags: ${{ env.img_tag }} # tags: ${{ steps.metaFrontend.outputs.tags }} push: true env: From c632793827033d648341861a85e1f159b1d3040a Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 15:36:12 +0530 Subject: [PATCH 07/23] wip --- .github/workflows/build-branch.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 9fc55a45214..7adb32c3b92 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -10,7 +10,7 @@ on: env: gh_branch: develop - img_tag: ${GITHUB_RUN_ID} + img_tag: ${{ github.run_id }} jobs: branch_build_and_push: @@ -35,7 +35,7 @@ jobs: id: metaFrontend uses: docker/metadata-action@v4.3.0 with: - images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ env.img_tag }} + images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ env.gh_branch }} tags: | type=ref,event=tag From 9db60a9a2fabe167f307dcf03ab16e8d36735b96 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 15:52:01 +0530 Subject: [PATCH 08/23] image push fix --- .github/workflows/build-branch.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 7adb32c3b92..0262f86f7b3 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -69,6 +69,7 @@ jobs: context: . file: ./web/Dockerfile.web platforms: linux/amd64 + target: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ env.gh_branch }} tags: ${{ env.img_tag }} # tags: ${{ steps.metaFrontend.outputs.tags }} push: true From a6948e0d4e7aa840cb15bb4db42b3ec4178d6ad0 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 15:53:05 +0530 Subject: [PATCH 09/23] wip --- .github/workflows/build-branch.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 0262f86f7b3..0d376b0da30 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -31,13 +31,13 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release - id: metaFrontend - uses: docker/metadata-action@v4.3.0 - with: - images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ env.gh_branch }} - tags: | - type=ref,event=tag + # - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release + # id: metaFrontend + # uses: docker/metadata-action@v4.3.0 + # with: + # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ env.gh_branch }} + # tags: | + # type=ref,event=tag # - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release # id: metaBackend From fc695e6f14955f521db0f68fcd80b02b28fe8f24 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 15:55:04 +0530 Subject: [PATCH 10/23] wip --- .github/workflows/build-branch.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 0d376b0da30..2586ae0caff 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -69,8 +69,7 @@ jobs: context: . file: ./web/Dockerfile.web platforms: linux/amd64 - target: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ env.gh_branch }} - tags: ${{ env.img_tag }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ env.gh_branch }}:${{ env.img_tag }} # tags: ${{ steps.metaFrontend.outputs.tags }} push: true env: From 12a878d89e06451eefcbc65503522e6a42596c04 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 16:33:18 +0530 Subject: [PATCH 11/23] dynamic branch name and tag --- .github/workflows/build-branch.yml | 148 ++++++++++++++--------------- 1 file changed, 69 insertions(+), 79 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 2586ae0caff..e3e5c0fd892 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -2,19 +2,14 @@ name: Docker Branch Build on: - push: - branches-ignore: - - master -# on: -# workflow_dispatch + workflow_dispatch env: - gh_branch: develop - img_tag: ${{ github.run_id }} + gh_branch: ${{ github.ref_name }} + img_tag: latest jobs: branch_build_and_push: - # if: github.ref_protected == true name: Build and Push Web/Space/API/Proxy Docker Image runs-on: ubuntu-20.04 @@ -31,37 +26,33 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - # - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release - # id: metaFrontend - # uses: docker/metadata-action@v4.3.0 - # with: - # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ env.gh_branch }} - # tags: | - # type=ref,event=tag - - # - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release - # id: metaBackend - # uses: docker/metadata-action@v4.3.0 - # with: - # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend-${{ env.img_tag }} - # tags: | - # type=ref,event=tag - - # - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release - # id: metaSpace - # uses: docker/metadata-action@v4.3.0 - # with: - # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-${{ env.img_tag }} - # tags: | - # type=ref,event=tag - - # - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release - # id: metaProxy - # uses: docker/metadata-action@v4.3.0 - # with: - # images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy-${{ env.img_tag }} - # tags: | - # type=ref,event=tag + + - uses: ASzc/change-string-case-action@v2 + id: gh_branch_upper_lower + with: + string: ${{ env.gh_branch }} + + - uses: mad9000/actions-find-and-replace-string@2 + id: gh_branch_replace_slash + with: + source: ${{ steps.gh_branch_upper_lower.outputs.lowercase }} + find: '/' + replace: '-' + + - uses: mad9000/actions-find-and-replace-string@2 + id: gh_branch_replace_dot + with: + source: ${{ steps.gh_branch_replace_slash.outputs.value }} + find: '.' + replace: '' + + - uses: mad9000/actions-find-and-replace-string@2 + id: gh_branch_clean + with: + source: ${{ steps.gh_branch_replace_dot.outputs.value }} + find: '_' + replace: '' + - name: Build and Push Frontend to Docker Container Registry uses: docker/build-push-action@v4.0.0 @@ -69,49 +60,48 @@ jobs: context: . file: ./web/Dockerfile.web platforms: linux/amd64 - tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ env.gh_branch }}:${{ env.img_tag }} - # tags: ${{ steps.metaFrontend.outputs.tags }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ steps.gh_branch_clean.outputs.value }}:${{ env.img_tag }} + push: true + env: + DOCKER_BUILDKIT: 1 + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and Push Plane-Deploy to Docker Hub + uses: docker/build-push-action@v4.0.0 + with: + context: . + file: ./space/Dockerfile.space + platforms: linux/amd64 + tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-${{ steps.gh_branch_clean.outputs.value }}:${{ env.img_tag }} push: true env: DOCKER_BUILDKIT: 1 DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - # - name: Build and Push Backend to Docker Hub - # uses: docker/build-push-action@v4.0.0 - # with: - # context: ./apiserver - # file: ./apiserver/Dockerfile.api - # platforms: linux/amd64 - # push: true - # tags: ${{ steps.metaBackend.outputs.tags }} - # env: - # DOCKER_BUILDKIT: 1 - # DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - # DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - - # - name: Build and Push Plane-Deploy to Docker Hub - # uses: docker/build-push-action@v4.0.0 - # with: - # context: . - # file: ./space/Dockerfile.space - # platforms: linux/amd64 - # push: true - # tags: ${{ steps.metaSpace.outputs.tags }} - # env: - # DOCKER_BUILDKIT: 1 - # DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - # DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - - # - name: Build and Push Plane-Proxy to Docker Hub - # uses: docker/build-push-action@v4.0.0 - # with: - # context: ./nginx - # file: ./nginx/Dockerfile - # platforms: linux/amd64 - # push: true - # tags: ${{ steps.metaProxy.outputs.tags }} - # env: - # DOCKER_BUILDKIT: 1 - # DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - # DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and Push Backend to Docker Hub + uses: docker/build-push-action@v4.0.0 + with: + context: ./apiserver + file: ./apiserver/Dockerfile.api + platforms: linux/amd64 + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend-${{ steps.gh_branch_clean.outputs.value }}:${{ env.img_tag }} + env: + DOCKER_BUILDKIT: 1 + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and Push Plane-Proxy to Docker Hub + uses: docker/build-push-action@v4.0.0 + with: + context: ./nginx + file: ./nginx/Dockerfile + platforms: linux/amd64 + tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy-${{ steps.gh_branch_clean.outputs.value }}:${{ env.img_tag }} + push: true + env: + DOCKER_BUILDKIT: 1 + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} From dac04d1399e7b18b757da39e64a13669cea668cd Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 16:40:25 +0530 Subject: [PATCH 12/23] workflow_dispatch modified --- .github/workflows/build-branch.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index e3e5c0fd892..630ad423275 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -2,7 +2,14 @@ name: Docker Branch Build on: - workflow_dispatch + workflow_dispatch: + inputs: + logLevel: + description: 'Log level' + required: true + default: 'warning' + tags: + description: 'Dev/QA Builds' env: gh_branch: ${{ github.ref_name }} From 671193dafd2468c75b2ee9f1b9855e34b7bbcf9b Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 17:02:57 +0530 Subject: [PATCH 13/23] job splitting --- .github/workflows/build-branch.yml | 33 ++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 630ad423275..aa326b01a84 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -16,6 +16,7 @@ env: img_tag: latest jobs: + branch_build_and_push: name: Build and Push Web/Space/API/Proxy Docker Image runs-on: ubuntu-20.04 @@ -33,7 +34,6 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - uses: ASzc/change-string-case-action@v2 id: gh_branch_upper_lower with: @@ -59,34 +59,47 @@ jobs: source: ${{ steps.gh_branch_replace_dot.outputs.value }} find: '_' replace: '' + outputs: + gh_branch_name: ${{ steps.gh_branch_clean.outputs.value }} - + branch_build_push_frontend: + runs-on: ubuntu-20.04 + needs: [ branch_build_and_push ] + steps: - name: Build and Push Frontend to Docker Container Registry uses: docker/build-push-action@v4.0.0 with: context: . file: ./web/Dockerfile.web platforms: linux/amd64 - tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ steps.gh_branch_clean.outputs.value }}:${{ env.img_tag }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} push: true env: DOCKER_BUILDKIT: 1 DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and Push Plane-Deploy to Docker Hub + branch_build_push_space: + runs-on: ubuntu-20.04 + needs: [ branch_build_and_push ] + steps: + - name: Build and Push Space to Docker Hub uses: docker/build-push-action@v4.0.0 with: context: . file: ./space/Dockerfile.space platforms: linux/amd64 - tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-${{ steps.gh_branch_clean.outputs.value }}:${{ env.img_tag }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} push: true env: DOCKER_BUILDKIT: 1 DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + branch_build_push_backend: + runs-on: ubuntu-20.04 + needs: [ branch_build_and_push ] + steps: - name: Build and Push Backend to Docker Hub uses: docker/build-push-action@v4.0.0 with: @@ -94,21 +107,25 @@ jobs: file: ./apiserver/Dockerfile.api platforms: linux/amd64 push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend-${{ steps.gh_branch_clean.outputs.value }}:${{ env.img_tag }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} env: DOCKER_BUILDKIT: 1 DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + branch_build_push_proxy: + runs-on: ubuntu-20.04 + needs: [ branch_build_and_push ] + steps: - name: Build and Push Plane-Proxy to Docker Hub uses: docker/build-push-action@v4.0.0 with: context: ./nginx file: ./nginx/Dockerfile platforms: linux/amd64 - tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy-${{ steps.gh_branch_clean.outputs.value }}:${{ env.img_tag }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} push: true env: DOCKER_BUILDKIT: 1 DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file From eef26d44c6b94d1d71f931471bd0747d14c541cc Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 17:15:21 +0530 Subject: [PATCH 14/23] file sharing --- .github/workflows/build-branch.yml | 34 +++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index aa326b01a84..846878b2d1a 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -16,7 +16,6 @@ env: img_tag: latest jobs: - branch_build_and_push: name: Build and Push Web/Space/API/Proxy Docker Image runs-on: ubuntu-20.04 @@ -59,6 +58,11 @@ jobs: source: ${{ steps.gh_branch_replace_dot.outputs.value }} find: '_' replace: '' + - name: Upload math result for job 1 + uses: actions/upload-artifact@v3 + with: + name: src + path: ./ outputs: gh_branch_name: ${{ steps.gh_branch_clean.outputs.value }} @@ -66,10 +70,15 @@ jobs: runs-on: ubuntu-20.04 needs: [ branch_build_and_push ] steps: + - name: src-frontend + uses: actions/download-artifact@v3 + with: + name: src + - name: Build and Push Frontend to Docker Container Registry uses: docker/build-push-action@v4.0.0 with: - context: . + context: src/ file: ./web/Dockerfile.web platforms: linux/amd64 tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} @@ -83,10 +92,15 @@ jobs: runs-on: ubuntu-20.04 needs: [ branch_build_and_push ] steps: + - name: src-space + uses: actions/download-artifact@v3 + with: + name: src + - name: Build and Push Space to Docker Hub uses: docker/build-push-action@v4.0.0 with: - context: . + context: src/ file: ./space/Dockerfile.space platforms: linux/amd64 tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} @@ -100,10 +114,15 @@ jobs: runs-on: ubuntu-20.04 needs: [ branch_build_and_push ] steps: + - name: src-backend + uses: actions/download-artifact@v3 + with: + name: src + - name: Build and Push Backend to Docker Hub uses: docker/build-push-action@v4.0.0 with: - context: ./apiserver + context: src/apiserver file: ./apiserver/Dockerfile.api platforms: linux/amd64 push: true @@ -117,10 +136,15 @@ jobs: runs-on: ubuntu-20.04 needs: [ branch_build_and_push ] steps: + - name: src-proxy + uses: actions/download-artifact@v3 + with: + name: src + - name: Build and Push Plane-Proxy to Docker Hub uses: docker/build-push-action@v4.0.0 with: - context: ./nginx + context: src/nginx file: ./nginx/Dockerfile platforms: linux/amd64 tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} From a5cbad655e9dc2160122556e9925cf6f3ec226c3 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 17:17:59 +0530 Subject: [PATCH 15/23] wip --- .github/workflows/build-branch.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 846878b2d1a..eaff28ae109 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -17,7 +17,7 @@ env: jobs: branch_build_and_push: - name: Build and Push Web/Space/API/Proxy Docker Image + name: Build-Push Web/Space/API/Proxy Docker Image runs-on: ubuntu-20.04 steps: @@ -58,7 +58,7 @@ jobs: source: ${{ steps.gh_branch_replace_dot.outputs.value }} find: '_' replace: '' - - name: Upload math result for job 1 + - name: upload-src uses: actions/upload-artifact@v3 with: name: src @@ -140,7 +140,7 @@ jobs: uses: actions/download-artifact@v3 with: name: src - + - name: Build and Push Plane-Proxy to Docker Hub uses: docker/build-push-action@v4.0.0 with: From 7f6c8e8c045068c9124d809d28f313a6b21cb1bf Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 17:24:41 +0530 Subject: [PATCH 16/23] checking --- .github/workflows/build-branch.yml | 179 +++++++++++++++++------------ 1 file changed, 104 insertions(+), 75 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index eaff28ae109..93f4f18b6de 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -24,15 +24,6 @@ jobs: - name: Check out the repo uses: actions/checkout@v3.3.0 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2.5.0 - - - name: Login to Docker Hub - uses: docker/login-action@v2.1.0 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - uses: ASzc/change-string-case-action@v2 id: gh_branch_upper_lower with: @@ -58,84 +49,122 @@ jobs: source: ${{ steps.gh_branch_replace_dot.outputs.value }} find: '_' replace: '' - - name: upload-src + # - name: upload-backend + # uses: actions/upload-artifact@v3 + # with: + # name: src + # path: ./apiserver + - name: upload-proxy uses: actions/upload-artifact@v3 with: name: src - path: ./ + path: ./nginx outputs: gh_branch_name: ${{ steps.gh_branch_clean.outputs.value }} - branch_build_push_frontend: - runs-on: ubuntu-20.04 - needs: [ branch_build_and_push ] - steps: - - name: src-frontend - uses: actions/download-artifact@v3 - with: - name: src - - - name: Build and Push Frontend to Docker Container Registry - uses: docker/build-push-action@v4.0.0 - with: - context: src/ - file: ./web/Dockerfile.web - platforms: linux/amd64 - tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} - push: true - env: - DOCKER_BUILDKIT: 1 - DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - - branch_build_push_space: - runs-on: ubuntu-20.04 - needs: [ branch_build_and_push ] - steps: - - name: src-space - uses: actions/download-artifact@v3 - with: - name: src - - - name: Build and Push Space to Docker Hub - uses: docker/build-push-action@v4.0.0 - with: - context: src/ - file: ./space/Dockerfile.space - platforms: linux/amd64 - tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} - push: true - env: - DOCKER_BUILDKIT: 1 - DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + # branch_build_push_frontend: + # runs-on: ubuntu-20.04 + # needs: [ branch_build_and_push ] + # steps: + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v2.5.0 + + # - name: Login to Docker Hub + # uses: docker/login-action@v2.1.0 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} + # - name: src-frontend + # uses: actions/download-artifact@v3 + # with: + # name: src + + # - name: Build and Push Frontend to Docker Container Registry + # uses: docker/build-push-action@v4.0.0 + # with: + # context: src/ + # file: ./web/Dockerfile.web + # platforms: linux/amd64 + # tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} + # push: true + # env: + # DOCKER_BUILDKIT: 1 + # DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + # DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + + # branch_build_push_space: + # runs-on: ubuntu-20.04 + # needs: [ branch_build_and_push ] + # steps: + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v2.5.0 + + # - name: Login to Docker Hub + # uses: docker/login-action@v2.1.0 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} + # - name: src-space + # uses: actions/download-artifact@v3 + # with: + # name: src + + # - name: Build and Push Space to Docker Hub + # uses: docker/build-push-action@v4.0.0 + # with: + # context: src/ + # file: ./space/Dockerfile.space + # platforms: linux/amd64 + # tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} + # push: true + # env: + # DOCKER_BUILDKIT: 1 + # DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + # DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + + # branch_build_push_backend: + # runs-on: ubuntu-20.04 + # needs: [ branch_build_and_push ] + # steps: + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v2.5.0 + + # - name: Login to Docker Hub + # uses: docker/login-action@v2.1.0 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} + # - name: src-backend + # uses: actions/download-artifact@v3 + # with: + # name: src + + # - name: Build and Push Backend to Docker Hub + # uses: docker/build-push-action@v4.0.0 + # with: + # context: src/apiserver + # file: ./apiserver/Dockerfile.api + # platforms: linux/amd64 + # push: true + # tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} + # env: + # DOCKER_BUILDKIT: 1 + # DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + # DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - branch_build_push_backend: + branch_build_push_proxy: runs-on: ubuntu-20.04 needs: [ branch_build_and_push ] steps: - - name: src-backend - uses: actions/download-artifact@v3 - with: - name: src + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2.5.0 - - name: Build and Push Backend to Docker Hub - uses: docker/build-push-action@v4.0.0 + - name: Login to Docker Hub + uses: docker/login-action@v2.1.0 with: - context: src/apiserver - file: ./apiserver/Dockerfile.api - platforms: linux/amd64 - push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} - env: - DOCKER_BUILDKIT: 1 - DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - branch_build_push_proxy: - runs-on: ubuntu-20.04 - needs: [ branch_build_and_push ] - steps: - name: src-proxy uses: actions/download-artifact@v3 with: @@ -144,7 +173,7 @@ jobs: - name: Build and Push Plane-Proxy to Docker Hub uses: docker/build-push-action@v4.0.0 with: - context: src/nginx + context: . file: ./nginx/Dockerfile platforms: linux/amd64 tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} From ad2885ae6aa81e56488ab1580aaee2c7c52c6419 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 17:26:28 +0530 Subject: [PATCH 17/23] wip --- .github/workflows/build-branch.yml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 93f4f18b6de..88366dfebc6 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -169,16 +169,19 @@ jobs: uses: actions/download-artifact@v3 with: name: src - - - name: Build and Push Plane-Proxy to Docker Hub - uses: docker/build-push-action@v4.0.0 - with: - context: . - file: ./nginx/Dockerfile - platforms: linux/amd64 - tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} - push: true - env: - DOCKER_BUILDKIT: 1 - DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file + + - name: Display structure of downloaded files + run: ls -R + + # - name: Build and Push Plane-Proxy to Docker Hub + # uses: docker/build-push-action@v4.0.0 + # with: + # context: . + # file: ./nginx/Dockerfile + # platforms: linux/amd64 + # tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} + # push: true + # env: + # DOCKER_BUILDKIT: 1 + # DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + # DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file From b9b9dc4e79caeeb7657568fe81ece564e49eeee3 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 17:27:56 +0530 Subject: [PATCH 18/23] wip --- .github/workflows/build-branch.yml | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 88366dfebc6..bae71da91fa 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -170,18 +170,15 @@ jobs: with: name: src - - name: Display structure of downloaded files - run: ls -R - - # - name: Build and Push Plane-Proxy to Docker Hub - # uses: docker/build-push-action@v4.0.0 - # with: - # context: . - # file: ./nginx/Dockerfile - # platforms: linux/amd64 - # tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} - # push: true - # env: - # DOCKER_BUILDKIT: 1 - # DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - # DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file + - name: Build and Push Plane-Proxy to Docker Hub + uses: docker/build-push-action@v4.0.0 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64 + tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} + push: true + env: + DOCKER_BUILDKIT: 1 + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file From 0f6bcc9d6a3141bda61fca39415d77bc2ff06823 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 17:30:02 +0530 Subject: [PATCH 19/23] wip --- .github/workflows/build-branch.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index bae71da91fa..60ee0b593ad 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -49,16 +49,16 @@ jobs: source: ${{ steps.gh_branch_replace_dot.outputs.value }} find: '_' replace: '' - # - name: upload-backend - # uses: actions/upload-artifact@v3 - # with: - # name: src - # path: ./apiserver - name: upload-proxy uses: actions/upload-artifact@v3 with: name: src path: ./nginx + - name: upload-backend + uses: actions/upload-artifact@v3 + with: + name: src + path: ./apiserver outputs: gh_branch_name: ${{ steps.gh_branch_clean.outputs.value }} @@ -159,11 +159,11 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2.5.0 - - name: Login to Docker Hub - uses: docker/login-action@v2.1.0 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + # - name: Login to Docker Hub + # uses: docker/login-action@v2.1.0 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} - name: src-proxy uses: actions/download-artifact@v3 From 6d70291ed3c707253d010d71cfb3a6e204d42391 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 17:37:48 +0530 Subject: [PATCH 20/23] wip --- .github/workflows/build-branch.yml | 81 ++++++++++++++++-------------- 1 file changed, 43 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 60ee0b593ad..da8044407f7 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -49,16 +49,21 @@ jobs: source: ${{ steps.gh_branch_replace_dot.outputs.value }} find: '_' replace: '' - - name: upload-proxy + - name: Uploading Proxy Source uses: actions/upload-artifact@v3 with: - name: src + name: proxy-src-code path: ./nginx - - name: upload-backend + - name: Uploading Backend Source uses: actions/upload-artifact@v3 with: - name: src + name: backend-src-code path: ./apiserver + - name: Uploading Web Source + uses: actions/upload-artifact@v3 + with: + name: web-src-code + path: ./ outputs: gh_branch_name: ${{ steps.gh_branch_clean.outputs.value }} @@ -122,35 +127,35 @@ jobs: # DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} # DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - # branch_build_push_backend: - # runs-on: ubuntu-20.04 - # needs: [ branch_build_and_push ] - # steps: - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v2.5.0 + branch_build_push_backend: + runs-on: ubuntu-20.04 + needs: [ branch_build_and_push ] + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2.5.0 - # - name: Login to Docker Hub - # uses: docker/login-action@v2.1.0 - # with: - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_TOKEN }} - # - name: src-backend - # uses: actions/download-artifact@v3 - # with: - # name: src + - name: Login to Docker Hub + uses: docker/login-action@v2.1.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Downloading Backend Source Code + uses: actions/download-artifact@v3 + with: + name: backend-src-code - # - name: Build and Push Backend to Docker Hub - # uses: docker/build-push-action@v4.0.0 - # with: - # context: src/apiserver - # file: ./apiserver/Dockerfile.api - # platforms: linux/amd64 - # push: true - # tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} - # env: - # DOCKER_BUILDKIT: 1 - # DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - # DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and Push Backend to Docker Hub + uses: docker/build-push-action@v4.0.0 + with: + context: . + file: ./Dockerfile.api + platforms: linux/amd64 + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} + env: + DOCKER_BUILDKIT: 1 + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} branch_build_push_proxy: runs-on: ubuntu-20.04 @@ -159,16 +164,16 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2.5.0 - # - name: Login to Docker Hub - # uses: docker/login-action@v2.1.0 - # with: - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to Docker Hub + uses: docker/login-action@v2.1.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: src-proxy + - name: Downloading Proxy Source Code uses: actions/download-artifact@v3 with: - name: src + name: proxy-src-code - name: Build and Push Plane-Proxy to Docker Hub uses: docker/build-push-action@v4.0.0 From cc9704fe288582661e6308d82b198f7c18a8ba24 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 17:43:14 +0530 Subject: [PATCH 21/23] build fixes --- .github/workflows/build-branch.yml | 123 +++++++++++++++-------------- 1 file changed, 63 insertions(+), 60 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index da8044407f7..b57cfde6488 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -63,69 +63,72 @@ jobs: uses: actions/upload-artifact@v3 with: name: web-src-code - path: ./ + path: | + ./ + !./apiserver + !./nginx outputs: gh_branch_name: ${{ steps.gh_branch_clean.outputs.value }} - # branch_build_push_frontend: - # runs-on: ubuntu-20.04 - # needs: [ branch_build_and_push ] - # steps: - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v2.5.0 - - # - name: Login to Docker Hub - # uses: docker/login-action@v2.1.0 - # with: - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_TOKEN }} - # - name: src-frontend - # uses: actions/download-artifact@v3 - # with: - # name: src - - # - name: Build and Push Frontend to Docker Container Registry - # uses: docker/build-push-action@v4.0.0 - # with: - # context: src/ - # file: ./web/Dockerfile.web - # platforms: linux/amd64 - # tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} - # push: true - # env: - # DOCKER_BUILDKIT: 1 - # DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - # DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - - # branch_build_push_space: - # runs-on: ubuntu-20.04 - # needs: [ branch_build_and_push ] - # steps: - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v2.5.0 - - # - name: Login to Docker Hub - # uses: docker/login-action@v2.1.0 - # with: - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_TOKEN }} - # - name: src-space - # uses: actions/download-artifact@v3 - # with: - # name: src - - # - name: Build and Push Space to Docker Hub - # uses: docker/build-push-action@v4.0.0 - # with: - # context: src/ - # file: ./space/Dockerfile.space - # platforms: linux/amd64 - # tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} - # push: true - # env: - # DOCKER_BUILDKIT: 1 - # DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - # DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + branch_build_push_frontend: + runs-on: ubuntu-20.04 + needs: [ branch_build_and_push ] + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2.5.0 + + - name: Login to Docker Hub + uses: docker/login-action@v2.1.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Downloading Web Source Code + uses: actions/download-artifact@v3 + with: + name: web-src-code + + - name: Build and Push Frontend to Docker Container Registry + uses: docker/build-push-action@v4.0.0 + with: + context: . + file: ./web/Dockerfile.web + platforms: linux/amd64 + tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} + push: true + env: + DOCKER_BUILDKIT: 1 + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + + branch_build_push_space: + runs-on: ubuntu-20.04 + needs: [ branch_build_and_push ] + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2.5.0 + + - name: Login to Docker Hub + uses: docker/login-action@v2.1.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Downloading Web Source Code + uses: actions/download-artifact@v3 + with: + name: web-src-code + + - name: Build and Push Space to Docker Hub + uses: docker/build-push-action@v4.0.0 + with: + context: . + file: ./space/Dockerfile.space + platforms: linux/amd64 + tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} + push: true + env: + DOCKER_BUILDKIT: 1 + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} branch_build_push_backend: runs-on: ubuntu-20.04 From 414813fb80f9d0aee5692acc53084b7585032895 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 17:53:06 +0530 Subject: [PATCH 22/23] code upload download fixes --- .github/workflows/build-branch.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index b57cfde6488..9139b39323e 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -67,6 +67,19 @@ jobs: ./ !./apiserver !./nginx + !./deploy + !./space + + - name: Uploading Space Source + uses: actions/upload-artifact@v3 + with: + name: space-src-code + path: | + ./ + !./apiserver + !./nginx + !./deploy + !./web outputs: gh_branch_name: ${{ steps.gh_branch_clean.outputs.value }} @@ -112,10 +125,10 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Downloading Web Source Code + - name: Downloading Space Source Code uses: actions/download-artifact@v3 with: - name: web-src-code + name: space-src-code - name: Build and Push Space to Docker Hub uses: docker/build-push-action@v4.0.0 From 9cc5aa9975c33f75d4966edf33fd89492bbfcf58 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 6 Nov 2023 18:04:16 +0530 Subject: [PATCH 23/23] image name change --- .github/workflows/build-branch.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 9139b39323e..26b8addd23b 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -106,7 +106,7 @@ jobs: context: . file: ./web/Dockerfile.web platforms: linux/amd64 - tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend-private:${{ needs.branch_build_and_push.outputs.gh_branch_name }} push: true env: DOCKER_BUILDKIT: 1 @@ -136,7 +136,7 @@ jobs: context: . file: ./space/Dockerfile.space platforms: linux/amd64 - tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space-private:${{ needs.branch_build_and_push.outputs.gh_branch_name }} push: true env: DOCKER_BUILDKIT: 1 @@ -167,7 +167,7 @@ jobs: file: ./Dockerfile.api platforms: linux/amd64 push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend-private:${{ needs.branch_build_and_push.outputs.gh_branch_name }} env: DOCKER_BUILDKIT: 1 DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} @@ -197,7 +197,7 @@ jobs: context: . file: ./Dockerfile platforms: linux/amd64 - tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy-${{ needs.branch_build_and_push.outputs.gh_branch_name }}:${{ env.img_tag }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy-private:${{ needs.branch_build_and_push.outputs.gh_branch_name }} push: true env: DOCKER_BUILDKIT: 1