From ff96a50beeb62bcfc2d94d72b67482f240633c96 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Fri, 23 Dec 2022 11:03:18 +0530 Subject: [PATCH 01/60] Integrate Uffizzi --- .github/workflows/uffizzi-build.yml | 98 +++++++++++++++++++++++++++ .github/workflows/uffizzi-preview.yml | 88 ++++++++++++++++++++++++ docker-compose.uffizzi.yml | 70 +++++++++++++++++++ nginx-uffizzi/html/index.html | 20 ++++++ nginx-uffizzi/nginx.conf | 33 +++++++++ 5 files changed, 309 insertions(+) create mode 100644 .github/workflows/uffizzi-build.yml create mode 100644 .github/workflows/uffizzi-preview.yml create mode 100644 docker-compose.uffizzi.yml create mode 100644 nginx-uffizzi/html/index.html create mode 100644 nginx-uffizzi/nginx.conf diff --git a/.github/workflows/uffizzi-build.yml b/.github/workflows/uffizzi-build.yml new file mode 100644 index 0000000000..6d9b161dcd --- /dev/null +++ b/.github/workflows/uffizzi-build.yml @@ -0,0 +1,98 @@ +name: Build PR Image +on: + pull_request: + types: [opened, synchronize, reopened, closed, review_requested] + +jobs: + build-parse-dashboard: + name: Build and push `Parse-Dashboard` + runs-on: ubuntu-latest + outputs: + tags: ${{ steps.meta.outputs.tags }} + if: ${{ github.event.action != 'closed' }} + steps: + - name: Checkout git repo + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Generate UUID image name + id: uuid + run: echo "UUID_WORKER=$(uuidgen)" >> $GITHUB_ENV + + - name: Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: registry.uffizzi.com/${{ env.UUID_WORKER }} + tags: | + type=raw,value=60d + + - name: Build and Push Image to registry.uffizzi.com - Uffizzi's ephemeral Registry + uses: docker/build-push-action@v3 + with: + context: ./ + file: Dockerfile + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + push: true + cache-from: type=gha + cache-to: type=gha, mode=max + + render-compose-file: + name: Render Docker Compose File + # Pass output of this workflow to another triggered by `workflow_run` event. + runs-on: ubuntu-latest + needs: + - build-parse-dashboard + outputs: + compose-file-cache-key: ${{ steps.hash.outputs.hash }} + steps: + - name: Checkout git repo + uses: actions/checkout@v3 + - name: Render Compose File + run: | + PARSE_DASHBOARD_IMAGE=${{ needs.build-parse-dashboard.outputs.tags }} + export PARSE_DASHBOARD_IMAGE + export UFFIZZI_URL=\$UFFIZZI_URL + # Render simple template from environment variables. + envsubst < docker-compose.uffizzi.yml > docker-compose.rendered.yml + cat docker-compose.rendered.yml + - name: Upload Rendered Compose File as Artifact + uses: actions/upload-artifact@v3 + with: + name: preview-spec + path: docker-compose.rendered.yml + retention-days: 2 + - name: Serialize PR Event to File + run: | + cat << EOF > event.json + ${{ toJSON(github.event) }} + + EOF + - name: Upload PR Event as Artifact + uses: actions/upload-artifact@v3 + with: + name: preview-spec + path: event.json + retention-days: 2 + + delete-preview: + name: Call for Preview Deletion + runs-on: ubuntu-latest + if: ${{ github.event.action == 'closed' }} + steps: + # If this PR is closing, we will not render a compose file nor pass it to the next workflow. + - name: Serialize PR Event to File + run: | + cat << EOF > event.json + ${{ toJSON(github.event) }} + + EOF + - name: Upload PR Event as Artifact + uses: actions/upload-artifact@v3 + with: + name: preview-spec + path: event.json + retention-days: 2 diff --git a/.github/workflows/uffizzi-preview.yml b/.github/workflows/uffizzi-preview.yml new file mode 100644 index 0000000000..f790974149 --- /dev/null +++ b/.github/workflows/uffizzi-preview.yml @@ -0,0 +1,88 @@ +name: Deploy Uffizzi Preview + +on: + workflow_run: + workflows: + - "Build PR Image" + types: + - completed + + +jobs: + cache-compose-file: + name: Cache Compose File + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + outputs: + compose-file-cache-key: ${{ env.HASH }} + pr-number: ${{ env.PR_NUMBER }} + steps: + - name: 'Download artifacts' + # Fetch output (zip archive) from the workflow run that triggered this workflow. + uses: actions/github-script@v6 + with: + script: | + let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: context.payload.workflow_run.id, + }); + let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { + return artifact.name == "preview-spec" + })[0]; + let download = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: 'zip', + }); + let fs = require('fs'); + fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/preview-spec.zip`, Buffer.from(download.data)); + + - name: 'Unzip artifact' + run: unzip preview-spec.zip + - name: Read Event into ENV + run: | + echo 'EVENT_JSON<> $GITHUB_ENV + cat event.json >> $GITHUB_ENV + echo 'EOF' >> $GITHUB_ENV + + - name: Hash Rendered Compose File + id: hash + # If the previous workflow was triggered by a PR close event, we will not have a compose file artifact. + if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} + run: echo "HASH=$(md5sum docker-compose.rendered.yml | awk '{ print $1 }')" >> $GITHUB_ENV + - name: Cache Rendered Compose File + if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} + uses: actions/cache@v3 + with: + path: docker-compose.rendered.yml + key: ${{ env.HASH }} + + - name: Read PR Number From Event Object + id: pr + run: echo "PR_NUMBER=${{ fromJSON(env.EVENT_JSON).number }}" >> $GITHUB_ENV + - name: DEBUG - Print Job Outputs + if: ${{ runner.debug }} + run: | + echo "PR number: ${{ env.PR_NUMBER }}" + echo "Compose file hash: ${{ env.HASH }}" + cat event.json + + deploy-uffizzi-preview: + name: Use Remote Workflow to Preview on Uffizzi + needs: + - cache-compose-file + if: ${{ github.event.workflow_run.conclusion == 'success' }} + uses: UffizziCloud/preview-action/.github/workflows/reusable.yaml@v2 + with: + # If this workflow was triggered by a PR close event, cache-key will be an empty string + # and this reusable workflow will delete the preview deployment. + compose-file-cache-key: ${{ needs.cache-compose-file.outputs.compose-file-cache-key }} + compose-file-cache-path: docker-compose.rendered.yml + server: https://app.uffizzi.com + pr-number: ${{ needs.cache-compose-file.outputs.pr-number }} + permissions: + contents: read + pull-requests: write + id-token: write diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml new file mode 100644 index 0000000000..a9873aa833 --- /dev/null +++ b/docker-compose.uffizzi.yml @@ -0,0 +1,70 @@ +version: '3' + +# uffizzi integration +x-uffizzi: + ingress: + service: nginx + port: 8081 + +services: + + postgres: + image: postgres + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=password + - POSTGRES_DB=postgres + ports: + - "5432:5432" + deploy: + resources: + limits: + memory: 1000M + volumes: + - postgres_data:/var/lib/postgresql + + parse: + image: parseplatform/parse-server:latest + environment: + - PARSE_SERVER_APPLICATION_ID=parse + - PARSE_SERVER_MASTER_KEY=parse@master123! + - PARSE_SERVER_DATABASE_URI=postgresql://postgres:password@localhost:5432/postgres + - PARSE_SERVER_MOUNT_PATH=/parse + - PORT=1337 + ports: + - '1337:1337' + deploy: + resources: + limits: + memory: 1000M + dashboard: + image: "${PARSE_DASHBOARD_IMAGE}" + ports: + - "4040:4040" + environment: + - PARSE_DASHBOARD_MASTER_KEY=parse@master123! + - PARSE_DASHBOARD_APP_ID=parse + - PARSE_DASHBOARD_APP_NAME=MyParseApp + - PARSE_DASHBOARD_USER_ID=admin + - PARSE_DASHBOARD_USER_PASSWORD=password + - MOUNT_PATH=/dashboard + - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 + entrypoint: /bin/sh + command: + - "-c" + - "PARSE_DASHBOARD_SERVER_URL=$$UFFIZZI_URL/parse node Parse-Dashboard/index.js" + #- PARSE_DASHBOARD_COOKIE_SESSION_SECRET=AB8849B6-D725-4A75-AA73-AB7103F0363F + deploy: + resources: + limits: + memory: 1000M + + nginx: + image: nginx:alpine + volumes: + - ./nginx-uffizzi:/etc/nginx + - ./nginx-uffizzi/html:/usr/share/nginx/html + +volumes: + postgres_data: + diff --git a/nginx-uffizzi/html/index.html b/nginx-uffizzi/html/index.html new file mode 100644 index 0000000000..bab4d11bbe --- /dev/null +++ b/nginx-uffizzi/html/index.html @@ -0,0 +1,20 @@ + + + + + + +Parse Dashboard Preview + + + + + +

Endpoints

+ + Click to Visit Parse Dashboard + + + + + \ No newline at end of file diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf new file mode 100644 index 0000000000..1e7fb30c97 --- /dev/null +++ b/nginx-uffizzi/nginx.conf @@ -0,0 +1,33 @@ +events { + worker_connections 1024; #default +} +http { + server { + listen 8081; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + location /dashboard { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://localhost:4040/dashboard/; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + } + + location /parse { + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + keepalive_requests 10; + keepalive_timeout 75s; + proxy_pass http://localhost:1337/parse/; + proxy_http_version 1.1; + } + } + } From 77d028bbc140aa7ca7ba7b11e6a6151032294702 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Mon, 16 Jan 2023 19:35:51 +0530 Subject: [PATCH 02/60] integrate uffizzi --- docker-compose.uffizzi.yml | 5 ++++- nginx-uffizzi/nginx.conf | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index a9873aa833..d67f403217 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -5,6 +5,10 @@ x-uffizzi: ingress: service: nginx port: 8081 + continuous_previews: + deploy_preview_when_pull_request_is_opened: true + delete_preview_when_pull_request_is_closed: true + share_to_github: true services: @@ -63,7 +67,6 @@ services: image: nginx:alpine volumes: - ./nginx-uffizzi:/etc/nginx - - ./nginx-uffizzi/html:/usr/share/nginx/html volumes: postgres_data: diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index 1e7fb30c97..afaf05258e 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -6,18 +6,18 @@ http { listen 8081; location / { - root /usr/share/nginx/html; - index index.html index.htm; + default_type text/html; + return 200 "Parse Dashboard\n"; } location /dashboard { - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-NginX-Proxy true; - proxy_pass http://localhost:4040/dashboard/; - proxy_ssl_session_reuse off; - proxy_set_header Host $http_host; - proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://localhost:4040/dashboard/; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; } location /parse { @@ -30,4 +30,4 @@ http { proxy_http_version 1.1; } } - } +} From c431f4ef32a31ec7f55b529ae68cb75bb6c2b25c Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Mon, 16 Jan 2023 19:56:43 +0530 Subject: [PATCH 03/60] integrate uffizzi --- nginx-uffizzi/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index afaf05258e..a4a94570b7 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -7,7 +7,7 @@ http { location / { default_type text/html; - return 200 "Parse Dashboard\n"; + return 200 "Parse Dashboard\n"; } location /dashboard { From dc39d340881e013a6f4f4df6aab24c67cc2d37ff Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Mon, 16 Jan 2023 20:10:28 +0530 Subject: [PATCH 04/60] integrate uffizzi --- nginx-uffizzi/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index a4a94570b7..9d3d1a9edc 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -7,7 +7,7 @@ http { location / { default_type text/html; - return 200 "Parse Dashboard\n"; + return 200 "

Visit /dashboard/ to log into parse-dashboard

\n"; } location /dashboard { From bc6b7464b2544a29795eb1ec629978c19db1df8d Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Mon, 16 Jan 2023 20:22:47 +0530 Subject: [PATCH 05/60] integrate uffizzi --- nginx-uffizzi/html/index.html | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 nginx-uffizzi/html/index.html diff --git a/nginx-uffizzi/html/index.html b/nginx-uffizzi/html/index.html deleted file mode 100644 index bab4d11bbe..0000000000 --- a/nginx-uffizzi/html/index.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - -Parse Dashboard Preview - - - - - -

Endpoints

- - Click to Visit Parse Dashboard - - - - - \ No newline at end of file From b164445a23df0e4cc487fa229874f3f43178329c Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Mon, 16 Jan 2023 20:35:36 +0530 Subject: [PATCH 06/60] integrate uffizzi --- docker-compose.uffizzi.yml | 2 +- nginx-uffizzi/nginx.conf | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index d67f403217..5e56259c19 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -51,7 +51,7 @@ services: - PARSE_DASHBOARD_APP_NAME=MyParseApp - PARSE_DASHBOARD_USER_ID=admin - PARSE_DASHBOARD_USER_PASSWORD=password - - MOUNT_PATH=/dashboard + - MOUNT_PATH=/ - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 entrypoint: /bin/sh command: diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index 9d3d1a9edc..da4e9e2e93 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -6,8 +6,15 @@ http { listen 8081; location / { - default_type text/html; - return 200 "

Visit /dashboard/ to log into parse-dashboard

\n"; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://localhost:4040/dashboard/; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + # default_type text/html; + # return 200 "

Visit /dashboard/ to log into parse-dashboard

\n"; } location /dashboard { From 6a695644619091410fcd4aba2954cf06813a93ca Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Mon, 16 Jan 2023 21:57:16 +0530 Subject: [PATCH 07/60] integrate uffizzi --- docker-compose.uffizzi.yml | 2 +- nginx-uffizzi/nginx.conf | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 5e56259c19..d67f403217 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -51,7 +51,7 @@ services: - PARSE_DASHBOARD_APP_NAME=MyParseApp - PARSE_DASHBOARD_USER_ID=admin - PARSE_DASHBOARD_USER_PASSWORD=password - - MOUNT_PATH=/ + - MOUNT_PATH=/dashboard - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 entrypoint: /bin/sh command: diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index da4e9e2e93..784ad32150 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -6,15 +6,12 @@ http { listen 8081; location / { - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-NginX-Proxy true; - proxy_pass http://localhost:4040/dashboard/; - proxy_ssl_session_reuse off; - proxy_set_header Host $http_host; - proxy_redirect off; - # default_type text/html; - # return 200 "

Visit /dashboard/ to log into parse-dashboard

\n"; + try_files $uri $uri/ /index.html; + } + + location = /index.html { + default_type text/html; + return 200 "

Visit /dashboard/ to log into parse-dashboard

\n"; } location /dashboard { From f3aa24be909539c5eb7ce63bcc80c4af8174e563 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Mon, 16 Jan 2023 22:43:53 +0530 Subject: [PATCH 08/60] integrate uffizzi --- .github/workflows/uffizzi-build.yml | 178 +++++++++++++------------- .github/workflows/uffizzi-preview.yml | 162 +++++++++++------------ nginx-uffizzi/nginx.conf | 4 - 3 files changed, 170 insertions(+), 174 deletions(-) diff --git a/.github/workflows/uffizzi-build.yml b/.github/workflows/uffizzi-build.yml index 6d9b161dcd..cec9fb1df0 100644 --- a/.github/workflows/uffizzi-build.yml +++ b/.github/workflows/uffizzi-build.yml @@ -1,98 +1,98 @@ -name: Build PR Image -on: - pull_request: - types: [opened, synchronize, reopened, closed, review_requested] +# name: Build PR Image +# on: +# pull_request: +# types: [opened, synchronize, reopened, closed, review_requested] -jobs: - build-parse-dashboard: - name: Build and push `Parse-Dashboard` - runs-on: ubuntu-latest - outputs: - tags: ${{ steps.meta.outputs.tags }} - if: ${{ github.event.action != 'closed' }} - steps: - - name: Checkout git repo - uses: actions/checkout@v3 +# jobs: +# build-parse-dashboard: +# name: Build and push `Parse-Dashboard` +# runs-on: ubuntu-latest +# outputs: +# tags: ${{ steps.meta.outputs.tags }} +# if: ${{ github.event.action != 'closed' }} +# steps: +# - name: Checkout git repo +# uses: actions/checkout@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v2 - - name: Generate UUID image name - id: uuid - run: echo "UUID_WORKER=$(uuidgen)" >> $GITHUB_ENV +# - name: Generate UUID image name +# id: uuid +# run: echo "UUID_WORKER=$(uuidgen)" >> $GITHUB_ENV - - name: Docker metadata - id: meta - uses: docker/metadata-action@v4 - with: - images: registry.uffizzi.com/${{ env.UUID_WORKER }} - tags: | - type=raw,value=60d +# - name: Docker metadata +# id: meta +# uses: docker/metadata-action@v4 +# with: +# images: registry.uffizzi.com/${{ env.UUID_WORKER }} +# tags: | +# type=raw,value=60d - - name: Build and Push Image to registry.uffizzi.com - Uffizzi's ephemeral Registry - uses: docker/build-push-action@v3 - with: - context: ./ - file: Dockerfile - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - push: true - cache-from: type=gha - cache-to: type=gha, mode=max +# - name: Build and Push Image to registry.uffizzi.com - Uffizzi's ephemeral Registry +# uses: docker/build-push-action@v3 +# with: +# context: ./ +# file: Dockerfile +# tags: ${{ steps.meta.outputs.tags }} +# labels: ${{ steps.meta.outputs.labels }} +# push: true +# cache-from: type=gha +# cache-to: type=gha, mode=max - render-compose-file: - name: Render Docker Compose File - # Pass output of this workflow to another triggered by `workflow_run` event. - runs-on: ubuntu-latest - needs: - - build-parse-dashboard - outputs: - compose-file-cache-key: ${{ steps.hash.outputs.hash }} - steps: - - name: Checkout git repo - uses: actions/checkout@v3 - - name: Render Compose File - run: | - PARSE_DASHBOARD_IMAGE=${{ needs.build-parse-dashboard.outputs.tags }} - export PARSE_DASHBOARD_IMAGE - export UFFIZZI_URL=\$UFFIZZI_URL - # Render simple template from environment variables. - envsubst < docker-compose.uffizzi.yml > docker-compose.rendered.yml - cat docker-compose.rendered.yml - - name: Upload Rendered Compose File as Artifact - uses: actions/upload-artifact@v3 - with: - name: preview-spec - path: docker-compose.rendered.yml - retention-days: 2 - - name: Serialize PR Event to File - run: | - cat << EOF > event.json - ${{ toJSON(github.event) }} +# render-compose-file: +# name: Render Docker Compose File +# # Pass output of this workflow to another triggered by `workflow_run` event. +# runs-on: ubuntu-latest +# needs: +# - build-parse-dashboard +# outputs: +# compose-file-cache-key: ${{ steps.hash.outputs.hash }} +# steps: +# - name: Checkout git repo +# uses: actions/checkout@v3 +# - name: Render Compose File +# run: | +# PARSE_DASHBOARD_IMAGE=${{ needs.build-parse-dashboard.outputs.tags }} +# export PARSE_DASHBOARD_IMAGE +# export UFFIZZI_URL=\$UFFIZZI_URL +# # Render simple template from environment variables. +# envsubst < docker-compose.uffizzi.yml > docker-compose.rendered.yml +# cat docker-compose.rendered.yml +# - name: Upload Rendered Compose File as Artifact +# uses: actions/upload-artifact@v3 +# with: +# name: preview-spec +# path: docker-compose.rendered.yml +# retention-days: 2 +# - name: Serialize PR Event to File +# run: | +# cat << EOF > event.json +# ${{ toJSON(github.event) }} - EOF - - name: Upload PR Event as Artifact - uses: actions/upload-artifact@v3 - with: - name: preview-spec - path: event.json - retention-days: 2 +# EOF +# - name: Upload PR Event as Artifact +# uses: actions/upload-artifact@v3 +# with: +# name: preview-spec +# path: event.json +# retention-days: 2 - delete-preview: - name: Call for Preview Deletion - runs-on: ubuntu-latest - if: ${{ github.event.action == 'closed' }} - steps: - # If this PR is closing, we will not render a compose file nor pass it to the next workflow. - - name: Serialize PR Event to File - run: | - cat << EOF > event.json - ${{ toJSON(github.event) }} +# delete-preview: +# name: Call for Preview Deletion +# runs-on: ubuntu-latest +# if: ${{ github.event.action == 'closed' }} +# steps: +# # If this PR is closing, we will not render a compose file nor pass it to the next workflow. +# - name: Serialize PR Event to File +# run: | +# cat << EOF > event.json +# ${{ toJSON(github.event) }} - EOF - - name: Upload PR Event as Artifact - uses: actions/upload-artifact@v3 - with: - name: preview-spec - path: event.json - retention-days: 2 +# EOF +# - name: Upload PR Event as Artifact +# uses: actions/upload-artifact@v3 +# with: +# name: preview-spec +# path: event.json +# retention-days: 2 diff --git a/.github/workflows/uffizzi-preview.yml b/.github/workflows/uffizzi-preview.yml index f790974149..3e8c9f5bbe 100644 --- a/.github/workflows/uffizzi-preview.yml +++ b/.github/workflows/uffizzi-preview.yml @@ -1,88 +1,88 @@ -name: Deploy Uffizzi Preview +# name: Deploy Uffizzi Preview -on: - workflow_run: - workflows: - - "Build PR Image" - types: - - completed +# on: +# workflow_run: +# workflows: +# - "Build PR Image" +# types: +# - completed -jobs: - cache-compose-file: - name: Cache Compose File - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} - outputs: - compose-file-cache-key: ${{ env.HASH }} - pr-number: ${{ env.PR_NUMBER }} - steps: - - name: 'Download artifacts' - # Fetch output (zip archive) from the workflow run that triggered this workflow. - uses: actions/github-script@v6 - with: - script: | - let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: context.payload.workflow_run.id, - }); - let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { - return artifact.name == "preview-spec" - })[0]; - let download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - let fs = require('fs'); - fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/preview-spec.zip`, Buffer.from(download.data)); +# jobs: +# cache-compose-file: +# name: Cache Compose File +# runs-on: ubuntu-latest +# if: ${{ github.event.workflow_run.conclusion == 'success' }} +# outputs: +# compose-file-cache-key: ${{ env.HASH }} +# pr-number: ${{ env.PR_NUMBER }} +# steps: +# - name: 'Download artifacts' +# # Fetch output (zip archive) from the workflow run that triggered this workflow. +# uses: actions/github-script@v6 +# with: +# script: | +# let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ +# owner: context.repo.owner, +# repo: context.repo.repo, +# run_id: context.payload.workflow_run.id, +# }); +# let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { +# return artifact.name == "preview-spec" +# })[0]; +# let download = await github.rest.actions.downloadArtifact({ +# owner: context.repo.owner, +# repo: context.repo.repo, +# artifact_id: matchArtifact.id, +# archive_format: 'zip', +# }); +# let fs = require('fs'); +# fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/preview-spec.zip`, Buffer.from(download.data)); - - name: 'Unzip artifact' - run: unzip preview-spec.zip - - name: Read Event into ENV - run: | - echo 'EVENT_JSON<> $GITHUB_ENV - cat event.json >> $GITHUB_ENV - echo 'EOF' >> $GITHUB_ENV +# - name: 'Unzip artifact' +# run: unzip preview-spec.zip +# - name: Read Event into ENV +# run: | +# echo 'EVENT_JSON<> $GITHUB_ENV +# cat event.json >> $GITHUB_ENV +# echo 'EOF' >> $GITHUB_ENV - - name: Hash Rendered Compose File - id: hash - # If the previous workflow was triggered by a PR close event, we will not have a compose file artifact. - if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} - run: echo "HASH=$(md5sum docker-compose.rendered.yml | awk '{ print $1 }')" >> $GITHUB_ENV - - name: Cache Rendered Compose File - if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} - uses: actions/cache@v3 - with: - path: docker-compose.rendered.yml - key: ${{ env.HASH }} +# - name: Hash Rendered Compose File +# id: hash +# # If the previous workflow was triggered by a PR close event, we will not have a compose file artifact. +# if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} +# run: echo "HASH=$(md5sum docker-compose.rendered.yml | awk '{ print $1 }')" >> $GITHUB_ENV +# - name: Cache Rendered Compose File +# if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} +# uses: actions/cache@v3 +# with: +# path: docker-compose.rendered.yml +# key: ${{ env.HASH }} - - name: Read PR Number From Event Object - id: pr - run: echo "PR_NUMBER=${{ fromJSON(env.EVENT_JSON).number }}" >> $GITHUB_ENV - - name: DEBUG - Print Job Outputs - if: ${{ runner.debug }} - run: | - echo "PR number: ${{ env.PR_NUMBER }}" - echo "Compose file hash: ${{ env.HASH }}" - cat event.json +# - name: Read PR Number From Event Object +# id: pr +# run: echo "PR_NUMBER=${{ fromJSON(env.EVENT_JSON).number }}" >> $GITHUB_ENV +# - name: DEBUG - Print Job Outputs +# if: ${{ runner.debug }} +# run: | +# echo "PR number: ${{ env.PR_NUMBER }}" +# echo "Compose file hash: ${{ env.HASH }}" +# cat event.json - deploy-uffizzi-preview: - name: Use Remote Workflow to Preview on Uffizzi - needs: - - cache-compose-file - if: ${{ github.event.workflow_run.conclusion == 'success' }} - uses: UffizziCloud/preview-action/.github/workflows/reusable.yaml@v2 - with: - # If this workflow was triggered by a PR close event, cache-key will be an empty string - # and this reusable workflow will delete the preview deployment. - compose-file-cache-key: ${{ needs.cache-compose-file.outputs.compose-file-cache-key }} - compose-file-cache-path: docker-compose.rendered.yml - server: https://app.uffizzi.com - pr-number: ${{ needs.cache-compose-file.outputs.pr-number }} - permissions: - contents: read - pull-requests: write - id-token: write +# deploy-uffizzi-preview: +# name: Use Remote Workflow to Preview on Uffizzi +# needs: +# - cache-compose-file +# if: ${{ github.event.workflow_run.conclusion == 'success' }} +# uses: UffizziCloud/preview-action/.github/workflows/reusable.yaml@v2 +# with: +# # If this workflow was triggered by a PR close event, cache-key will be an empty string +# # and this reusable workflow will delete the preview deployment. +# compose-file-cache-key: ${{ needs.cache-compose-file.outputs.compose-file-cache-key }} +# compose-file-cache-path: docker-compose.rendered.yml +# server: https://app.uffizzi.com +# pr-number: ${{ needs.cache-compose-file.outputs.pr-number }} +# permissions: +# contents: read +# pull-requests: write +# id-token: write diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index 784ad32150..9d3d1a9edc 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -6,10 +6,6 @@ http { listen 8081; location / { - try_files $uri $uri/ /index.html; - } - - location = /index.html { default_type text/html; return 200 "

Visit /dashboard/ to log into parse-dashboard

\n"; } From 1ef8edfdd3805355b6cb1a0a9089e30a1066605c Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Mon, 16 Jan 2023 22:52:32 +0530 Subject: [PATCH 09/60] integrate uffizzi --- docker-compose.uffizzi.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index d67f403217..b21c8e713f 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -11,7 +11,6 @@ x-uffizzi: share_to_github: true services: - postgres: image: postgres environment: From 38b8625a2c2a9b5f40ff5b04d58bff4497611a92 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Mon, 16 Jan 2023 23:01:06 +0530 Subject: [PATCH 10/60] integrate uffizzi --- .github/workflows/uffizzi-build.yml | 178 +++++++++++++------------- .github/workflows/uffizzi-preview.yml | 162 +++++++++++------------ docker-compose.uffizzi.yml | 8 +- nginx-uffizzi/nginx.conf | 1 + 4 files changed, 175 insertions(+), 174 deletions(-) diff --git a/.github/workflows/uffizzi-build.yml b/.github/workflows/uffizzi-build.yml index cec9fb1df0..6d9b161dcd 100644 --- a/.github/workflows/uffizzi-build.yml +++ b/.github/workflows/uffizzi-build.yml @@ -1,98 +1,98 @@ -# name: Build PR Image -# on: -# pull_request: -# types: [opened, synchronize, reopened, closed, review_requested] +name: Build PR Image +on: + pull_request: + types: [opened, synchronize, reopened, closed, review_requested] -# jobs: -# build-parse-dashboard: -# name: Build and push `Parse-Dashboard` -# runs-on: ubuntu-latest -# outputs: -# tags: ${{ steps.meta.outputs.tags }} -# if: ${{ github.event.action != 'closed' }} -# steps: -# - name: Checkout git repo -# uses: actions/checkout@v3 +jobs: + build-parse-dashboard: + name: Build and push `Parse-Dashboard` + runs-on: ubuntu-latest + outputs: + tags: ${{ steps.meta.outputs.tags }} + if: ${{ github.event.action != 'closed' }} + steps: + - name: Checkout git repo + uses: actions/checkout@v3 -# - name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 -# - name: Generate UUID image name -# id: uuid -# run: echo "UUID_WORKER=$(uuidgen)" >> $GITHUB_ENV + - name: Generate UUID image name + id: uuid + run: echo "UUID_WORKER=$(uuidgen)" >> $GITHUB_ENV -# - name: Docker metadata -# id: meta -# uses: docker/metadata-action@v4 -# with: -# images: registry.uffizzi.com/${{ env.UUID_WORKER }} -# tags: | -# type=raw,value=60d + - name: Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: registry.uffizzi.com/${{ env.UUID_WORKER }} + tags: | + type=raw,value=60d -# - name: Build and Push Image to registry.uffizzi.com - Uffizzi's ephemeral Registry -# uses: docker/build-push-action@v3 -# with: -# context: ./ -# file: Dockerfile -# tags: ${{ steps.meta.outputs.tags }} -# labels: ${{ steps.meta.outputs.labels }} -# push: true -# cache-from: type=gha -# cache-to: type=gha, mode=max + - name: Build and Push Image to registry.uffizzi.com - Uffizzi's ephemeral Registry + uses: docker/build-push-action@v3 + with: + context: ./ + file: Dockerfile + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + push: true + cache-from: type=gha + cache-to: type=gha, mode=max -# render-compose-file: -# name: Render Docker Compose File -# # Pass output of this workflow to another triggered by `workflow_run` event. -# runs-on: ubuntu-latest -# needs: -# - build-parse-dashboard -# outputs: -# compose-file-cache-key: ${{ steps.hash.outputs.hash }} -# steps: -# - name: Checkout git repo -# uses: actions/checkout@v3 -# - name: Render Compose File -# run: | -# PARSE_DASHBOARD_IMAGE=${{ needs.build-parse-dashboard.outputs.tags }} -# export PARSE_DASHBOARD_IMAGE -# export UFFIZZI_URL=\$UFFIZZI_URL -# # Render simple template from environment variables. -# envsubst < docker-compose.uffizzi.yml > docker-compose.rendered.yml -# cat docker-compose.rendered.yml -# - name: Upload Rendered Compose File as Artifact -# uses: actions/upload-artifact@v3 -# with: -# name: preview-spec -# path: docker-compose.rendered.yml -# retention-days: 2 -# - name: Serialize PR Event to File -# run: | -# cat << EOF > event.json -# ${{ toJSON(github.event) }} + render-compose-file: + name: Render Docker Compose File + # Pass output of this workflow to another triggered by `workflow_run` event. + runs-on: ubuntu-latest + needs: + - build-parse-dashboard + outputs: + compose-file-cache-key: ${{ steps.hash.outputs.hash }} + steps: + - name: Checkout git repo + uses: actions/checkout@v3 + - name: Render Compose File + run: | + PARSE_DASHBOARD_IMAGE=${{ needs.build-parse-dashboard.outputs.tags }} + export PARSE_DASHBOARD_IMAGE + export UFFIZZI_URL=\$UFFIZZI_URL + # Render simple template from environment variables. + envsubst < docker-compose.uffizzi.yml > docker-compose.rendered.yml + cat docker-compose.rendered.yml + - name: Upload Rendered Compose File as Artifact + uses: actions/upload-artifact@v3 + with: + name: preview-spec + path: docker-compose.rendered.yml + retention-days: 2 + - name: Serialize PR Event to File + run: | + cat << EOF > event.json + ${{ toJSON(github.event) }} -# EOF -# - name: Upload PR Event as Artifact -# uses: actions/upload-artifact@v3 -# with: -# name: preview-spec -# path: event.json -# retention-days: 2 + EOF + - name: Upload PR Event as Artifact + uses: actions/upload-artifact@v3 + with: + name: preview-spec + path: event.json + retention-days: 2 -# delete-preview: -# name: Call for Preview Deletion -# runs-on: ubuntu-latest -# if: ${{ github.event.action == 'closed' }} -# steps: -# # If this PR is closing, we will not render a compose file nor pass it to the next workflow. -# - name: Serialize PR Event to File -# run: | -# cat << EOF > event.json -# ${{ toJSON(github.event) }} + delete-preview: + name: Call for Preview Deletion + runs-on: ubuntu-latest + if: ${{ github.event.action == 'closed' }} + steps: + # If this PR is closing, we will not render a compose file nor pass it to the next workflow. + - name: Serialize PR Event to File + run: | + cat << EOF > event.json + ${{ toJSON(github.event) }} -# EOF -# - name: Upload PR Event as Artifact -# uses: actions/upload-artifact@v3 -# with: -# name: preview-spec -# path: event.json -# retention-days: 2 + EOF + - name: Upload PR Event as Artifact + uses: actions/upload-artifact@v3 + with: + name: preview-spec + path: event.json + retention-days: 2 diff --git a/.github/workflows/uffizzi-preview.yml b/.github/workflows/uffizzi-preview.yml index 3e8c9f5bbe..f790974149 100644 --- a/.github/workflows/uffizzi-preview.yml +++ b/.github/workflows/uffizzi-preview.yml @@ -1,88 +1,88 @@ -# name: Deploy Uffizzi Preview +name: Deploy Uffizzi Preview -# on: -# workflow_run: -# workflows: -# - "Build PR Image" -# types: -# - completed +on: + workflow_run: + workflows: + - "Build PR Image" + types: + - completed -# jobs: -# cache-compose-file: -# name: Cache Compose File -# runs-on: ubuntu-latest -# if: ${{ github.event.workflow_run.conclusion == 'success' }} -# outputs: -# compose-file-cache-key: ${{ env.HASH }} -# pr-number: ${{ env.PR_NUMBER }} -# steps: -# - name: 'Download artifacts' -# # Fetch output (zip archive) from the workflow run that triggered this workflow. -# uses: actions/github-script@v6 -# with: -# script: | -# let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ -# owner: context.repo.owner, -# repo: context.repo.repo, -# run_id: context.payload.workflow_run.id, -# }); -# let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { -# return artifact.name == "preview-spec" -# })[0]; -# let download = await github.rest.actions.downloadArtifact({ -# owner: context.repo.owner, -# repo: context.repo.repo, -# artifact_id: matchArtifact.id, -# archive_format: 'zip', -# }); -# let fs = require('fs'); -# fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/preview-spec.zip`, Buffer.from(download.data)); +jobs: + cache-compose-file: + name: Cache Compose File + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + outputs: + compose-file-cache-key: ${{ env.HASH }} + pr-number: ${{ env.PR_NUMBER }} + steps: + - name: 'Download artifacts' + # Fetch output (zip archive) from the workflow run that triggered this workflow. + uses: actions/github-script@v6 + with: + script: | + let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: context.payload.workflow_run.id, + }); + let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { + return artifact.name == "preview-spec" + })[0]; + let download = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: 'zip', + }); + let fs = require('fs'); + fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/preview-spec.zip`, Buffer.from(download.data)); -# - name: 'Unzip artifact' -# run: unzip preview-spec.zip -# - name: Read Event into ENV -# run: | -# echo 'EVENT_JSON<> $GITHUB_ENV -# cat event.json >> $GITHUB_ENV -# echo 'EOF' >> $GITHUB_ENV + - name: 'Unzip artifact' + run: unzip preview-spec.zip + - name: Read Event into ENV + run: | + echo 'EVENT_JSON<> $GITHUB_ENV + cat event.json >> $GITHUB_ENV + echo 'EOF' >> $GITHUB_ENV -# - name: Hash Rendered Compose File -# id: hash -# # If the previous workflow was triggered by a PR close event, we will not have a compose file artifact. -# if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} -# run: echo "HASH=$(md5sum docker-compose.rendered.yml | awk '{ print $1 }')" >> $GITHUB_ENV -# - name: Cache Rendered Compose File -# if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} -# uses: actions/cache@v3 -# with: -# path: docker-compose.rendered.yml -# key: ${{ env.HASH }} + - name: Hash Rendered Compose File + id: hash + # If the previous workflow was triggered by a PR close event, we will not have a compose file artifact. + if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} + run: echo "HASH=$(md5sum docker-compose.rendered.yml | awk '{ print $1 }')" >> $GITHUB_ENV + - name: Cache Rendered Compose File + if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} + uses: actions/cache@v3 + with: + path: docker-compose.rendered.yml + key: ${{ env.HASH }} -# - name: Read PR Number From Event Object -# id: pr -# run: echo "PR_NUMBER=${{ fromJSON(env.EVENT_JSON).number }}" >> $GITHUB_ENV -# - name: DEBUG - Print Job Outputs -# if: ${{ runner.debug }} -# run: | -# echo "PR number: ${{ env.PR_NUMBER }}" -# echo "Compose file hash: ${{ env.HASH }}" -# cat event.json + - name: Read PR Number From Event Object + id: pr + run: echo "PR_NUMBER=${{ fromJSON(env.EVENT_JSON).number }}" >> $GITHUB_ENV + - name: DEBUG - Print Job Outputs + if: ${{ runner.debug }} + run: | + echo "PR number: ${{ env.PR_NUMBER }}" + echo "Compose file hash: ${{ env.HASH }}" + cat event.json -# deploy-uffizzi-preview: -# name: Use Remote Workflow to Preview on Uffizzi -# needs: -# - cache-compose-file -# if: ${{ github.event.workflow_run.conclusion == 'success' }} -# uses: UffizziCloud/preview-action/.github/workflows/reusable.yaml@v2 -# with: -# # If this workflow was triggered by a PR close event, cache-key will be an empty string -# # and this reusable workflow will delete the preview deployment. -# compose-file-cache-key: ${{ needs.cache-compose-file.outputs.compose-file-cache-key }} -# compose-file-cache-path: docker-compose.rendered.yml -# server: https://app.uffizzi.com -# pr-number: ${{ needs.cache-compose-file.outputs.pr-number }} -# permissions: -# contents: read -# pull-requests: write -# id-token: write + deploy-uffizzi-preview: + name: Use Remote Workflow to Preview on Uffizzi + needs: + - cache-compose-file + if: ${{ github.event.workflow_run.conclusion == 'success' }} + uses: UffizziCloud/preview-action/.github/workflows/reusable.yaml@v2 + with: + # If this workflow was triggered by a PR close event, cache-key will be an empty string + # and this reusable workflow will delete the preview deployment. + compose-file-cache-key: ${{ needs.cache-compose-file.outputs.compose-file-cache-key }} + compose-file-cache-path: docker-compose.rendered.yml + server: https://app.uffizzi.com + pr-number: ${{ needs.cache-compose-file.outputs.pr-number }} + permissions: + contents: read + pull-requests: write + id-token: write diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index b21c8e713f..c9af930b91 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -5,10 +5,10 @@ x-uffizzi: ingress: service: nginx port: 8081 - continuous_previews: - deploy_preview_when_pull_request_is_opened: true - delete_preview_when_pull_request_is_closed: true - share_to_github: true + # continuous_previews: + # deploy_preview_when_pull_request_is_opened: true + # delete_preview_when_pull_request_is_closed: true + # share_to_github: true services: postgres: diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index 9d3d1a9edc..0adc5c00c9 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -6,6 +6,7 @@ http { listen 8081; location / { + expires -1; default_type text/html; return 200 "

Visit /dashboard/ to log into parse-dashboard

\n"; } From c5668734cd80dc9f78117ccaa7e10d18adeecb07 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Mon, 16 Jan 2023 23:22:35 +0530 Subject: [PATCH 11/60] integrate uffizzi --- nginx-uffizzi/nginx.conf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index 0adc5c00c9..b38842d20e 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -6,9 +6,8 @@ http { listen 8081; location / { - expires -1; default_type text/html; - return 200 "

Visit /dashboard/ to log into parse-dashboard

\n"; + return 200 "

Visit /dashboard/ to view the dashboard

\n"; } location /dashboard { From ded89bf054a0d44cb3b63698486ae90082f81f41 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Mon, 16 Jan 2023 23:39:32 +0530 Subject: [PATCH 12/60] integrate uffizzi --- docker-compose.uffizzi.yml | 7 ++----- nginx-uffizzi/html/index.html | 20 ++++++++++++++++++++ nginx-uffizzi/nginx.conf | 20 ++++++++++---------- 3 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 nginx-uffizzi/html/index.html diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index c9af930b91..be3297031d 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -5,12 +5,9 @@ x-uffizzi: ingress: service: nginx port: 8081 - # continuous_previews: - # deploy_preview_when_pull_request_is_opened: true - # delete_preview_when_pull_request_is_closed: true - # share_to_github: true services: + postgres: image: postgres environment: @@ -66,7 +63,7 @@ services: image: nginx:alpine volumes: - ./nginx-uffizzi:/etc/nginx + - ./nginx-uffizzi/html:/usr/share/nginx/html volumes: postgres_data: - diff --git a/nginx-uffizzi/html/index.html b/nginx-uffizzi/html/index.html new file mode 100644 index 0000000000..fc0330f934 --- /dev/null +++ b/nginx-uffizzi/html/index.html @@ -0,0 +1,20 @@ + + + + + + +Parse Dashboard Preview + + + + + +

Endpoints

+ + Click to Visit Parse Dashboard + + + + + diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index b38842d20e..1e7fb30c97 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -6,18 +6,18 @@ http { listen 8081; location / { - default_type text/html; - return 200 "

Visit /dashboard/ to view the dashboard

\n"; + root /usr/share/nginx/html; + index index.html index.htm; } location /dashboard { - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-NginX-Proxy true; - proxy_pass http://localhost:4040/dashboard/; - proxy_ssl_session_reuse off; - proxy_set_header Host $http_host; - proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://localhost:4040/dashboard/; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; } location /parse { @@ -30,4 +30,4 @@ http { proxy_http_version 1.1; } } -} + } From 603fc2bd3ae15befb5082998c7f5a1dcc794ba31 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Mon, 16 Jan 2023 23:58:07 +0530 Subject: [PATCH 13/60] integrate uffizzi --- nginx-uffizzi/nginx.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index 1e7fb30c97..4fd421abec 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -6,6 +6,7 @@ http { listen 8081; location / { + rewrite ^([^.]*[^/])$ $1/ permanent; root /usr/share/nginx/html; index index.html index.htm; } From c8fb17cb5b2c269b9457fa6b0914b750c24fea3e Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 00:07:32 +0530 Subject: [PATCH 14/60] integrate uffizzi --- nginx-uffizzi/nginx.conf | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index 4fd421abec..d1b404909e 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -6,19 +6,18 @@ http { listen 8081; location / { - rewrite ^([^.]*[^/])$ $1/ permanent; - root /usr/share/nginx/html; - index index.html index.htm; + default_type text/html; + return 200 "Click to Visit Parse Dashboard\n"; } location /dashboard { - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-NginX-Proxy true; - proxy_pass http://localhost:4040/dashboard/; - proxy_ssl_session_reuse off; - proxy_set_header Host $http_host; - proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://localhost:4040/dashboard/; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; } location /parse { @@ -31,4 +30,4 @@ http { proxy_http_version 1.1; } } - } +} From 761189ba774df543a8d79fe3750e9939284f44f8 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 00:21:35 +0530 Subject: [PATCH 15/60] integrate uffizzi --- docker-compose.uffizzi.yml | 2 +- nginx-uffizzi/html/index.html | 20 -------------------- 2 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 nginx-uffizzi/html/index.html diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index be3297031d..e3df421e51 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -63,7 +63,7 @@ services: image: nginx:alpine volumes: - ./nginx-uffizzi:/etc/nginx - - ./nginx-uffizzi/html:/usr/share/nginx/html + # - ./nginx-uffizzi/html:/usr/share/nginx/html volumes: postgres_data: diff --git a/nginx-uffizzi/html/index.html b/nginx-uffizzi/html/index.html deleted file mode 100644 index fc0330f934..0000000000 --- a/nginx-uffizzi/html/index.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - -Parse Dashboard Preview - - - - - -

Endpoints

- - Click to Visit Parse Dashboard - - - - - From 1f7de0a0c3e7d557b401161a797cc986b7cce8cf Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 00:41:56 +0530 Subject: [PATCH 16/60] integrate uffizzi --- nginx-uffizzi/nginx.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index d1b404909e..39f8d03ec2 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -6,6 +6,7 @@ http { listen 8081; location / { + rewrite ^([^.]*[^/])$ $1/ permanent; default_type text/html; return 200 "Click to Visit Parse Dashboard\n"; } From ab9ac48fd0035678f9d9bf5f325b478ce0b0b8ce Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 00:58:16 +0530 Subject: [PATCH 17/60] integrate uffizzi --- nginx-uffizzi/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index 39f8d03ec2..06a4740eed 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -8,7 +8,7 @@ http { location / { rewrite ^([^.]*[^/])$ $1/ permanent; default_type text/html; - return 200 "Click to Visit Parse Dashboard\n"; + return 200 "

Click to Visit Parse Dashboard

\n"; } location /dashboard { From c9396c367b5b295e13f6bd20bdd2d7766ab4c7a7 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 01:09:51 +0530 Subject: [PATCH 18/60] integrate uffizzi --- docker-compose.uffizzi.yml | 2 +- nginx-uffizzi/nginx.conf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index e3df421e51..be3297031d 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -63,7 +63,7 @@ services: image: nginx:alpine volumes: - ./nginx-uffizzi:/etc/nginx - # - ./nginx-uffizzi/html:/usr/share/nginx/html + - ./nginx-uffizzi/html:/usr/share/nginx/html volumes: postgres_data: diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index 06a4740eed..1608596d52 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -7,8 +7,8 @@ http { location / { rewrite ^([^.]*[^/])$ $1/ permanent; - default_type text/html; - return 200 "

Click to Visit Parse Dashboard

\n"; + root /usr/share/nginx/html; + index index.html index.htm; } location /dashboard { From 4293f4dac11b6cc8cf5894739f1bb6ef9982b4ea Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 01:30:15 +0530 Subject: [PATCH 19/60] integrate uffizzi --- nginx-uffizzi/nginx.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index 1608596d52..b98a5bf000 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -5,8 +5,9 @@ http { server { listen 8081; + rewrite ^([^.]*[^/])$ $1/ permanent; + location / { - rewrite ^([^.]*[^/])$ $1/ permanent; root /usr/share/nginx/html; index index.html index.htm; } From 2d21d49db3bc9a0fac2c0ab2d9c2631f107ac52d Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 01:42:53 +0530 Subject: [PATCH 20/60] integrate uffizzi --- .github/workflows/uffizzi-build.yml | 178 +++++++++++++------------- .github/workflows/uffizzi-preview.yml | 162 +++++++++++------------ docker-compose.uffizzi.yml | 4 + 3 files changed, 174 insertions(+), 170 deletions(-) diff --git a/.github/workflows/uffizzi-build.yml b/.github/workflows/uffizzi-build.yml index 6d9b161dcd..cec9fb1df0 100644 --- a/.github/workflows/uffizzi-build.yml +++ b/.github/workflows/uffizzi-build.yml @@ -1,98 +1,98 @@ -name: Build PR Image -on: - pull_request: - types: [opened, synchronize, reopened, closed, review_requested] +# name: Build PR Image +# on: +# pull_request: +# types: [opened, synchronize, reopened, closed, review_requested] -jobs: - build-parse-dashboard: - name: Build and push `Parse-Dashboard` - runs-on: ubuntu-latest - outputs: - tags: ${{ steps.meta.outputs.tags }} - if: ${{ github.event.action != 'closed' }} - steps: - - name: Checkout git repo - uses: actions/checkout@v3 +# jobs: +# build-parse-dashboard: +# name: Build and push `Parse-Dashboard` +# runs-on: ubuntu-latest +# outputs: +# tags: ${{ steps.meta.outputs.tags }} +# if: ${{ github.event.action != 'closed' }} +# steps: +# - name: Checkout git repo +# uses: actions/checkout@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v2 - - name: Generate UUID image name - id: uuid - run: echo "UUID_WORKER=$(uuidgen)" >> $GITHUB_ENV +# - name: Generate UUID image name +# id: uuid +# run: echo "UUID_WORKER=$(uuidgen)" >> $GITHUB_ENV - - name: Docker metadata - id: meta - uses: docker/metadata-action@v4 - with: - images: registry.uffizzi.com/${{ env.UUID_WORKER }} - tags: | - type=raw,value=60d +# - name: Docker metadata +# id: meta +# uses: docker/metadata-action@v4 +# with: +# images: registry.uffizzi.com/${{ env.UUID_WORKER }} +# tags: | +# type=raw,value=60d - - name: Build and Push Image to registry.uffizzi.com - Uffizzi's ephemeral Registry - uses: docker/build-push-action@v3 - with: - context: ./ - file: Dockerfile - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - push: true - cache-from: type=gha - cache-to: type=gha, mode=max +# - name: Build and Push Image to registry.uffizzi.com - Uffizzi's ephemeral Registry +# uses: docker/build-push-action@v3 +# with: +# context: ./ +# file: Dockerfile +# tags: ${{ steps.meta.outputs.tags }} +# labels: ${{ steps.meta.outputs.labels }} +# push: true +# cache-from: type=gha +# cache-to: type=gha, mode=max - render-compose-file: - name: Render Docker Compose File - # Pass output of this workflow to another triggered by `workflow_run` event. - runs-on: ubuntu-latest - needs: - - build-parse-dashboard - outputs: - compose-file-cache-key: ${{ steps.hash.outputs.hash }} - steps: - - name: Checkout git repo - uses: actions/checkout@v3 - - name: Render Compose File - run: | - PARSE_DASHBOARD_IMAGE=${{ needs.build-parse-dashboard.outputs.tags }} - export PARSE_DASHBOARD_IMAGE - export UFFIZZI_URL=\$UFFIZZI_URL - # Render simple template from environment variables. - envsubst < docker-compose.uffizzi.yml > docker-compose.rendered.yml - cat docker-compose.rendered.yml - - name: Upload Rendered Compose File as Artifact - uses: actions/upload-artifact@v3 - with: - name: preview-spec - path: docker-compose.rendered.yml - retention-days: 2 - - name: Serialize PR Event to File - run: | - cat << EOF > event.json - ${{ toJSON(github.event) }} +# render-compose-file: +# name: Render Docker Compose File +# # Pass output of this workflow to another triggered by `workflow_run` event. +# runs-on: ubuntu-latest +# needs: +# - build-parse-dashboard +# outputs: +# compose-file-cache-key: ${{ steps.hash.outputs.hash }} +# steps: +# - name: Checkout git repo +# uses: actions/checkout@v3 +# - name: Render Compose File +# run: | +# PARSE_DASHBOARD_IMAGE=${{ needs.build-parse-dashboard.outputs.tags }} +# export PARSE_DASHBOARD_IMAGE +# export UFFIZZI_URL=\$UFFIZZI_URL +# # Render simple template from environment variables. +# envsubst < docker-compose.uffizzi.yml > docker-compose.rendered.yml +# cat docker-compose.rendered.yml +# - name: Upload Rendered Compose File as Artifact +# uses: actions/upload-artifact@v3 +# with: +# name: preview-spec +# path: docker-compose.rendered.yml +# retention-days: 2 +# - name: Serialize PR Event to File +# run: | +# cat << EOF > event.json +# ${{ toJSON(github.event) }} - EOF - - name: Upload PR Event as Artifact - uses: actions/upload-artifact@v3 - with: - name: preview-spec - path: event.json - retention-days: 2 +# EOF +# - name: Upload PR Event as Artifact +# uses: actions/upload-artifact@v3 +# with: +# name: preview-spec +# path: event.json +# retention-days: 2 - delete-preview: - name: Call for Preview Deletion - runs-on: ubuntu-latest - if: ${{ github.event.action == 'closed' }} - steps: - # If this PR is closing, we will not render a compose file nor pass it to the next workflow. - - name: Serialize PR Event to File - run: | - cat << EOF > event.json - ${{ toJSON(github.event) }} +# delete-preview: +# name: Call for Preview Deletion +# runs-on: ubuntu-latest +# if: ${{ github.event.action == 'closed' }} +# steps: +# # If this PR is closing, we will not render a compose file nor pass it to the next workflow. +# - name: Serialize PR Event to File +# run: | +# cat << EOF > event.json +# ${{ toJSON(github.event) }} - EOF - - name: Upload PR Event as Artifact - uses: actions/upload-artifact@v3 - with: - name: preview-spec - path: event.json - retention-days: 2 +# EOF +# - name: Upload PR Event as Artifact +# uses: actions/upload-artifact@v3 +# with: +# name: preview-spec +# path: event.json +# retention-days: 2 diff --git a/.github/workflows/uffizzi-preview.yml b/.github/workflows/uffizzi-preview.yml index f790974149..3e8c9f5bbe 100644 --- a/.github/workflows/uffizzi-preview.yml +++ b/.github/workflows/uffizzi-preview.yml @@ -1,88 +1,88 @@ -name: Deploy Uffizzi Preview +# name: Deploy Uffizzi Preview -on: - workflow_run: - workflows: - - "Build PR Image" - types: - - completed +# on: +# workflow_run: +# workflows: +# - "Build PR Image" +# types: +# - completed -jobs: - cache-compose-file: - name: Cache Compose File - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} - outputs: - compose-file-cache-key: ${{ env.HASH }} - pr-number: ${{ env.PR_NUMBER }} - steps: - - name: 'Download artifacts' - # Fetch output (zip archive) from the workflow run that triggered this workflow. - uses: actions/github-script@v6 - with: - script: | - let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: context.payload.workflow_run.id, - }); - let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { - return artifact.name == "preview-spec" - })[0]; - let download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - let fs = require('fs'); - fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/preview-spec.zip`, Buffer.from(download.data)); +# jobs: +# cache-compose-file: +# name: Cache Compose File +# runs-on: ubuntu-latest +# if: ${{ github.event.workflow_run.conclusion == 'success' }} +# outputs: +# compose-file-cache-key: ${{ env.HASH }} +# pr-number: ${{ env.PR_NUMBER }} +# steps: +# - name: 'Download artifacts' +# # Fetch output (zip archive) from the workflow run that triggered this workflow. +# uses: actions/github-script@v6 +# with: +# script: | +# let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ +# owner: context.repo.owner, +# repo: context.repo.repo, +# run_id: context.payload.workflow_run.id, +# }); +# let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { +# return artifact.name == "preview-spec" +# })[0]; +# let download = await github.rest.actions.downloadArtifact({ +# owner: context.repo.owner, +# repo: context.repo.repo, +# artifact_id: matchArtifact.id, +# archive_format: 'zip', +# }); +# let fs = require('fs'); +# fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/preview-spec.zip`, Buffer.from(download.data)); - - name: 'Unzip artifact' - run: unzip preview-spec.zip - - name: Read Event into ENV - run: | - echo 'EVENT_JSON<> $GITHUB_ENV - cat event.json >> $GITHUB_ENV - echo 'EOF' >> $GITHUB_ENV +# - name: 'Unzip artifact' +# run: unzip preview-spec.zip +# - name: Read Event into ENV +# run: | +# echo 'EVENT_JSON<> $GITHUB_ENV +# cat event.json >> $GITHUB_ENV +# echo 'EOF' >> $GITHUB_ENV - - name: Hash Rendered Compose File - id: hash - # If the previous workflow was triggered by a PR close event, we will not have a compose file artifact. - if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} - run: echo "HASH=$(md5sum docker-compose.rendered.yml | awk '{ print $1 }')" >> $GITHUB_ENV - - name: Cache Rendered Compose File - if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} - uses: actions/cache@v3 - with: - path: docker-compose.rendered.yml - key: ${{ env.HASH }} +# - name: Hash Rendered Compose File +# id: hash +# # If the previous workflow was triggered by a PR close event, we will not have a compose file artifact. +# if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} +# run: echo "HASH=$(md5sum docker-compose.rendered.yml | awk '{ print $1 }')" >> $GITHUB_ENV +# - name: Cache Rendered Compose File +# if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} +# uses: actions/cache@v3 +# with: +# path: docker-compose.rendered.yml +# key: ${{ env.HASH }} - - name: Read PR Number From Event Object - id: pr - run: echo "PR_NUMBER=${{ fromJSON(env.EVENT_JSON).number }}" >> $GITHUB_ENV - - name: DEBUG - Print Job Outputs - if: ${{ runner.debug }} - run: | - echo "PR number: ${{ env.PR_NUMBER }}" - echo "Compose file hash: ${{ env.HASH }}" - cat event.json +# - name: Read PR Number From Event Object +# id: pr +# run: echo "PR_NUMBER=${{ fromJSON(env.EVENT_JSON).number }}" >> $GITHUB_ENV +# - name: DEBUG - Print Job Outputs +# if: ${{ runner.debug }} +# run: | +# echo "PR number: ${{ env.PR_NUMBER }}" +# echo "Compose file hash: ${{ env.HASH }}" +# cat event.json - deploy-uffizzi-preview: - name: Use Remote Workflow to Preview on Uffizzi - needs: - - cache-compose-file - if: ${{ github.event.workflow_run.conclusion == 'success' }} - uses: UffizziCloud/preview-action/.github/workflows/reusable.yaml@v2 - with: - # If this workflow was triggered by a PR close event, cache-key will be an empty string - # and this reusable workflow will delete the preview deployment. - compose-file-cache-key: ${{ needs.cache-compose-file.outputs.compose-file-cache-key }} - compose-file-cache-path: docker-compose.rendered.yml - server: https://app.uffizzi.com - pr-number: ${{ needs.cache-compose-file.outputs.pr-number }} - permissions: - contents: read - pull-requests: write - id-token: write +# deploy-uffizzi-preview: +# name: Use Remote Workflow to Preview on Uffizzi +# needs: +# - cache-compose-file +# if: ${{ github.event.workflow_run.conclusion == 'success' }} +# uses: UffizziCloud/preview-action/.github/workflows/reusable.yaml@v2 +# with: +# # If this workflow was triggered by a PR close event, cache-key will be an empty string +# # and this reusable workflow will delete the preview deployment. +# compose-file-cache-key: ${{ needs.cache-compose-file.outputs.compose-file-cache-key }} +# compose-file-cache-path: docker-compose.rendered.yml +# server: https://app.uffizzi.com +# pr-number: ${{ needs.cache-compose-file.outputs.pr-number }} +# permissions: +# contents: read +# pull-requests: write +# id-token: write diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index be3297031d..f6c574a8e3 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -5,6 +5,10 @@ x-uffizzi: ingress: service: nginx port: 8081 + continuous_previews: + deploy_preview_when_pull_request_is_opened: true + delete_preview_when_pull_request_is_closed: true + share_to_github: true services: From d02aaef6cdac86a840bd2e06e0aaac86b086aa5e Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 01:55:01 +0530 Subject: [PATCH 21/60] integrate uffizzi --- .github/workflows/uffizzi-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/uffizzi-build.yml b/.github/workflows/uffizzi-build.yml index cec9fb1df0..af454e2b0c 100644 --- a/.github/workflows/uffizzi-build.yml +++ b/.github/workflows/uffizzi-build.yml @@ -77,7 +77,6 @@ # name: preview-spec # path: event.json # retention-days: 2 - # delete-preview: # name: Call for Preview Deletion # runs-on: ubuntu-latest From 8265bd2a40abbabf296104e12e18e8c33d73c1d3 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 02:10:13 +0530 Subject: [PATCH 22/60] core port --- nginx-uffizzi/html/index.html | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 nginx-uffizzi/html/index.html diff --git a/nginx-uffizzi/html/index.html b/nginx-uffizzi/html/index.html new file mode 100644 index 0000000000..1f624f6a33 --- /dev/null +++ b/nginx-uffizzi/html/index.html @@ -0,0 +1,20 @@ + + + + + + +Parse Dashboard Preview + + + + + +

Endpoint:

+ + Click to Visit Parse Dashboard + + + + + From 5cf33b41580dc8a753994466aa6050d2b98f5cfb Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 02:57:16 +0530 Subject: [PATCH 23/60] core port --- .github/workflows/uffizzi-build.yml | 97 --------------------------- .github/workflows/uffizzi-preview.yml | 88 ------------------------ 2 files changed, 185 deletions(-) delete mode 100644 .github/workflows/uffizzi-build.yml delete mode 100644 .github/workflows/uffizzi-preview.yml diff --git a/.github/workflows/uffizzi-build.yml b/.github/workflows/uffizzi-build.yml deleted file mode 100644 index af454e2b0c..0000000000 --- a/.github/workflows/uffizzi-build.yml +++ /dev/null @@ -1,97 +0,0 @@ -# name: Build PR Image -# on: -# pull_request: -# types: [opened, synchronize, reopened, closed, review_requested] - -# jobs: -# build-parse-dashboard: -# name: Build and push `Parse-Dashboard` -# runs-on: ubuntu-latest -# outputs: -# tags: ${{ steps.meta.outputs.tags }} -# if: ${{ github.event.action != 'closed' }} -# steps: -# - name: Checkout git repo -# uses: actions/checkout@v3 - -# - name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v2 - -# - name: Generate UUID image name -# id: uuid -# run: echo "UUID_WORKER=$(uuidgen)" >> $GITHUB_ENV - -# - name: Docker metadata -# id: meta -# uses: docker/metadata-action@v4 -# with: -# images: registry.uffizzi.com/${{ env.UUID_WORKER }} -# tags: | -# type=raw,value=60d - -# - name: Build and Push Image to registry.uffizzi.com - Uffizzi's ephemeral Registry -# uses: docker/build-push-action@v3 -# with: -# context: ./ -# file: Dockerfile -# tags: ${{ steps.meta.outputs.tags }} -# labels: ${{ steps.meta.outputs.labels }} -# push: true -# cache-from: type=gha -# cache-to: type=gha, mode=max - -# render-compose-file: -# name: Render Docker Compose File -# # Pass output of this workflow to another triggered by `workflow_run` event. -# runs-on: ubuntu-latest -# needs: -# - build-parse-dashboard -# outputs: -# compose-file-cache-key: ${{ steps.hash.outputs.hash }} -# steps: -# - name: Checkout git repo -# uses: actions/checkout@v3 -# - name: Render Compose File -# run: | -# PARSE_DASHBOARD_IMAGE=${{ needs.build-parse-dashboard.outputs.tags }} -# export PARSE_DASHBOARD_IMAGE -# export UFFIZZI_URL=\$UFFIZZI_URL -# # Render simple template from environment variables. -# envsubst < docker-compose.uffizzi.yml > docker-compose.rendered.yml -# cat docker-compose.rendered.yml -# - name: Upload Rendered Compose File as Artifact -# uses: actions/upload-artifact@v3 -# with: -# name: preview-spec -# path: docker-compose.rendered.yml -# retention-days: 2 -# - name: Serialize PR Event to File -# run: | -# cat << EOF > event.json -# ${{ toJSON(github.event) }} - -# EOF -# - name: Upload PR Event as Artifact -# uses: actions/upload-artifact@v3 -# with: -# name: preview-spec -# path: event.json -# retention-days: 2 -# delete-preview: -# name: Call for Preview Deletion -# runs-on: ubuntu-latest -# if: ${{ github.event.action == 'closed' }} -# steps: -# # If this PR is closing, we will not render a compose file nor pass it to the next workflow. -# - name: Serialize PR Event to File -# run: | -# cat << EOF > event.json -# ${{ toJSON(github.event) }} - -# EOF -# - name: Upload PR Event as Artifact -# uses: actions/upload-artifact@v3 -# with: -# name: preview-spec -# path: event.json -# retention-days: 2 diff --git a/.github/workflows/uffizzi-preview.yml b/.github/workflows/uffizzi-preview.yml deleted file mode 100644 index 3e8c9f5bbe..0000000000 --- a/.github/workflows/uffizzi-preview.yml +++ /dev/null @@ -1,88 +0,0 @@ -# name: Deploy Uffizzi Preview - -# on: -# workflow_run: -# workflows: -# - "Build PR Image" -# types: -# - completed - - -# jobs: -# cache-compose-file: -# name: Cache Compose File -# runs-on: ubuntu-latest -# if: ${{ github.event.workflow_run.conclusion == 'success' }} -# outputs: -# compose-file-cache-key: ${{ env.HASH }} -# pr-number: ${{ env.PR_NUMBER }} -# steps: -# - name: 'Download artifacts' -# # Fetch output (zip archive) from the workflow run that triggered this workflow. -# uses: actions/github-script@v6 -# with: -# script: | -# let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ -# owner: context.repo.owner, -# repo: context.repo.repo, -# run_id: context.payload.workflow_run.id, -# }); -# let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { -# return artifact.name == "preview-spec" -# })[0]; -# let download = await github.rest.actions.downloadArtifact({ -# owner: context.repo.owner, -# repo: context.repo.repo, -# artifact_id: matchArtifact.id, -# archive_format: 'zip', -# }); -# let fs = require('fs'); -# fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/preview-spec.zip`, Buffer.from(download.data)); - -# - name: 'Unzip artifact' -# run: unzip preview-spec.zip -# - name: Read Event into ENV -# run: | -# echo 'EVENT_JSON<> $GITHUB_ENV -# cat event.json >> $GITHUB_ENV -# echo 'EOF' >> $GITHUB_ENV - -# - name: Hash Rendered Compose File -# id: hash -# # If the previous workflow was triggered by a PR close event, we will not have a compose file artifact. -# if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} -# run: echo "HASH=$(md5sum docker-compose.rendered.yml | awk '{ print $1 }')" >> $GITHUB_ENV -# - name: Cache Rendered Compose File -# if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} -# uses: actions/cache@v3 -# with: -# path: docker-compose.rendered.yml -# key: ${{ env.HASH }} - -# - name: Read PR Number From Event Object -# id: pr -# run: echo "PR_NUMBER=${{ fromJSON(env.EVENT_JSON).number }}" >> $GITHUB_ENV -# - name: DEBUG - Print Job Outputs -# if: ${{ runner.debug }} -# run: | -# echo "PR number: ${{ env.PR_NUMBER }}" -# echo "Compose file hash: ${{ env.HASH }}" -# cat event.json - -# deploy-uffizzi-preview: -# name: Use Remote Workflow to Preview on Uffizzi -# needs: -# - cache-compose-file -# if: ${{ github.event.workflow_run.conclusion == 'success' }} -# uses: UffizziCloud/preview-action/.github/workflows/reusable.yaml@v2 -# with: -# # If this workflow was triggered by a PR close event, cache-key will be an empty string -# # and this reusable workflow will delete the preview deployment. -# compose-file-cache-key: ${{ needs.cache-compose-file.outputs.compose-file-cache-key }} -# compose-file-cache-path: docker-compose.rendered.yml -# server: https://app.uffizzi.com -# pr-number: ${{ needs.cache-compose-file.outputs.pr-number }} -# permissions: -# contents: read -# pull-requests: write -# id-token: write From 282266f70aecb51f61b763a057f74f9fb1ecacb3 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 03:24:36 +0530 Subject: [PATCH 24/60] core port --- docker-compose.uffizzi.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index f6c574a8e3..37c35c983a 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -11,7 +11,6 @@ x-uffizzi: share_to_github: true services: - postgres: image: postgres environment: From 34352cb76b28fc2bcc2ab121de9e7e6907510483 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 03:59:47 +0530 Subject: [PATCH 25/60] integrate uffizzi --- docker-compose.uffizzi.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 37c35c983a..f6c574a8e3 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -11,6 +11,7 @@ x-uffizzi: share_to_github: true services: + postgres: image: postgres environment: From 7bf6d6f841d423a41fb9b691b5001c0759f6edf6 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 18:04:45 +0530 Subject: [PATCH 26/60] integrate uffizzi --- docker-compose.uffizzi.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index f6c574a8e3..13c23346f7 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -42,7 +42,9 @@ services: limits: memory: 1000M dashboard: - image: "${PARSE_DASHBOARD_IMAGE}" + build: + context: ./ + dockerfile: ./Dockerfile ports: - "4040:4040" environment: From 8e06a4e25ba3f8bf4debac486ab7eb903779a697 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 18:16:04 +0530 Subject: [PATCH 27/60] integrate uffizzi --- docker-compose.uffizzi.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 13c23346f7..6db5898774 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -41,6 +41,7 @@ services: resources: limits: memory: 1000M + dashboard: build: context: ./ From c47834b2975dc6218d3af10d904a087f16cc0236 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 20:02:55 +0530 Subject: [PATCH 28/60] integrate uffizzi --- docker-compose.uffizzi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 6db5898774..1548223f81 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -59,7 +59,7 @@ services: entrypoint: /bin/sh command: - "-c" - - "PARSE_DASHBOARD_SERVER_URL=$$UFFIZZI_URL/parse node Parse-Dashboard/index.js" + - "PARSE_DASHBOARD_SERVER_URL=$UFFIZZI_URL/parse node Parse-Dashboard/index.js" #- PARSE_DASHBOARD_COOKIE_SESSION_SECRET=AB8849B6-D725-4A75-AA73-AB7103F0363F deploy: resources: From d59f93ab85a0eab72febcb7a16c04a932488755c Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 20:15:22 +0530 Subject: [PATCH 29/60] integrate uffizzi --- docker-compose.uffizzi.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 1548223f81..1b0094fc26 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -59,6 +59,7 @@ services: entrypoint: /bin/sh command: - "-c" + - "echo $UFFIZZI_URL" - "PARSE_DASHBOARD_SERVER_URL=$UFFIZZI_URL/parse node Parse-Dashboard/index.js" #- PARSE_DASHBOARD_COOKIE_SESSION_SECRET=AB8849B6-D725-4A75-AA73-AB7103F0363F deploy: From 1356026991c90614a0d2676ee046140c161f1687 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 20:26:05 +0530 Subject: [PATCH 30/60] integrate uffizzi --- docker-compose.uffizzi.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 1b0094fc26..846afc3e61 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -59,8 +59,7 @@ services: entrypoint: /bin/sh command: - "-c" - - "echo $UFFIZZI_URL" - - "PARSE_DASHBOARD_SERVER_URL=$UFFIZZI_URL/parse node Parse-Dashboard/index.js" + - "echo $UFFIZZI_URL && PARSE_DASHBOARD_SERVER_URL=$UFFIZZI_URL/parse node Parse-Dashboard/index.js" #- PARSE_DASHBOARD_COOKIE_SESSION_SECRET=AB8849B6-D725-4A75-AA73-AB7103F0363F deploy: resources: From 119537bade7158df834e90a7487adec9ce71c9e3 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 20:37:30 +0530 Subject: [PATCH 31/60] integrate uffizzi --- docker-compose.uffizzi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 846afc3e61..a903fa803f 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -59,7 +59,7 @@ services: entrypoint: /bin/sh command: - "-c" - - "echo $UFFIZZI_URL && PARSE_DASHBOARD_SERVER_URL=$UFFIZZI_URL/parse node Parse-Dashboard/index.js" + - "echo $UFFIZZI_URL && PARSE_DASHBOARD_SERVER_URL=https://deployment-11340-parse-dashboard-581404562.app.uffizzi.com/parse node Parse-Dashboard/index.js" #- PARSE_DASHBOARD_COOKIE_SESSION_SECRET=AB8849B6-D725-4A75-AA73-AB7103F0363F deploy: resources: From 3a4d16260ee2a668415fd234aad343e596dbd4e1 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 20:41:12 +0530 Subject: [PATCH 32/60] integrate uffizzi --- docker-compose.uffizzi.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index a903fa803f..a6c5b3ed55 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -60,7 +60,6 @@ services: command: - "-c" - "echo $UFFIZZI_URL && PARSE_DASHBOARD_SERVER_URL=https://deployment-11340-parse-dashboard-581404562.app.uffizzi.com/parse node Parse-Dashboard/index.js" - #- PARSE_DASHBOARD_COOKIE_SESSION_SECRET=AB8849B6-D725-4A75-AA73-AB7103F0363F deploy: resources: limits: From cefa1df1d69b56f58f5a348c2913e658ef16b5fa Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 20:53:49 +0530 Subject: [PATCH 33/60] integrate uffizzi --- docker-compose.uffizzi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index a6c5b3ed55..46a63c8a89 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -59,7 +59,7 @@ services: entrypoint: /bin/sh command: - "-c" - - "echo $UFFIZZI_URL && PARSE_DASHBOARD_SERVER_URL=https://deployment-11340-parse-dashboard-581404562.app.uffizzi.com/parse node Parse-Dashboard/index.js" + - "PARSE_DASHBOARD_SERVER_URL=https://deployment-11340-parse-dashboard-581404562.app.uffizzi.com/parse node Parse-Dashboard/index.js" deploy: resources: limits: From d798eeae314442a8d09900cd24a7c054c0dd54da Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 20:54:23 +0530 Subject: [PATCH 34/60] integrate uffizzi --- docker-compose.uffizzi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 46a63c8a89..a59385540f 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -59,7 +59,7 @@ services: entrypoint: /bin/sh command: - "-c" - - "PARSE_DASHBOARD_SERVER_URL=https://deployment-11340-parse-dashboard-581404562.app.uffizzi.com/parse node Parse-Dashboard/index.js" + - "PARSE_DASHBOARD_SERVER_URL=$UFFIZZI_URL/parse node Parse-Dashboard/index.js" deploy: resources: limits: From d5ef9e988f4d359c5c0f22c2c6253dbfa5219a5c Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 21:17:54 +0530 Subject: [PATCH 35/60] integrate uffizzi --- docker-compose.uffizzi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index a59385540f..5fa1291cb3 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -44,7 +44,7 @@ services: dashboard: build: - context: ./ + context: . dockerfile: ./Dockerfile ports: - "4040:4040" From 10c65f4aa88711e2580f595893a9e6151f93c0d0 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 21:52:37 +0530 Subject: [PATCH 36/60] integrate uffizzi --- nginx-uffizzi/nginx.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index b98a5bf000..b01abbb98b 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -3,6 +3,7 @@ events { } http { server { + listen 8081; rewrite ^([^.]*[^/])$ $1/ permanent; From 4bbfb707de733240abe59a96b7216b96e53a915a Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 22:32:39 +0530 Subject: [PATCH 37/60] integrate uffizzi --- docker-compose.uffizzi.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 5fa1291cb3..2b4e6af6a0 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -3,8 +3,8 @@ version: '3' # uffizzi integration x-uffizzi: ingress: - service: nginx - port: 8081 + service: dashboard + port: 4040 continuous_previews: deploy_preview_when_pull_request_is_opened: true delete_preview_when_pull_request_is_closed: true @@ -59,7 +59,7 @@ services: entrypoint: /bin/sh command: - "-c" - - "PARSE_DASHBOARD_SERVER_URL=$UFFIZZI_URL/parse node Parse-Dashboard/index.js" + - "PARSE_DASHBOARD_SERVER_URL=http://localhost:1337/parse node Parse-Dashboard/index.js" deploy: resources: limits: From 91e72bf9a22c38645c4311a3d75eadc68517a9ad Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 22:48:44 +0530 Subject: [PATCH 38/60] integrate uffizzi --- docker-compose.uffizzi.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 2b4e6af6a0..b2790acfc0 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -54,7 +54,7 @@ services: - PARSE_DASHBOARD_APP_NAME=MyParseApp - PARSE_DASHBOARD_USER_ID=admin - PARSE_DASHBOARD_USER_PASSWORD=password - - MOUNT_PATH=/dashboard + - MOUNT_PATH=/ - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 entrypoint: /bin/sh command: @@ -65,11 +65,11 @@ services: limits: memory: 1000M - nginx: - image: nginx:alpine - volumes: - - ./nginx-uffizzi:/etc/nginx - - ./nginx-uffizzi/html:/usr/share/nginx/html + # nginx: + # image: nginx:alpine + # volumes: + # - ./nginx-uffizzi:/etc/nginx + # - ./nginx-uffizzi/html:/usr/share/nginx/html volumes: postgres_data: From 23f87af0c4f5b5c802972528165fa9351139e86a Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 23:16:38 +0530 Subject: [PATCH 39/60] integrate uffizzi --- docker-compose.uffizzi.yml | 6 ------ nginx-uffizzi/nginx.conf | 1 - 2 files changed, 7 deletions(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index b2790acfc0..b0ad1e33e9 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -65,11 +65,5 @@ services: limits: memory: 1000M - # nginx: - # image: nginx:alpine - # volumes: - # - ./nginx-uffizzi:/etc/nginx - # - ./nginx-uffizzi/html:/usr/share/nginx/html - volumes: postgres_data: diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index b01abbb98b..b98a5bf000 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -3,7 +3,6 @@ events { } http { server { - listen 8081; rewrite ^([^.]*[^/])$ $1/ permanent; From d1770fe8a6f09f7a7adb3507f98f20f103a3522e Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Tue, 17 Jan 2023 23:46:52 +0530 Subject: [PATCH 40/60] integrate uffizzi --- docker-compose.uffizzi.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index b0ad1e33e9..5fa1291cb3 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -3,8 +3,8 @@ version: '3' # uffizzi integration x-uffizzi: ingress: - service: dashboard - port: 4040 + service: nginx + port: 8081 continuous_previews: deploy_preview_when_pull_request_is_opened: true delete_preview_when_pull_request_is_closed: true @@ -54,16 +54,22 @@ services: - PARSE_DASHBOARD_APP_NAME=MyParseApp - PARSE_DASHBOARD_USER_ID=admin - PARSE_DASHBOARD_USER_PASSWORD=password - - MOUNT_PATH=/ + - MOUNT_PATH=/dashboard - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 entrypoint: /bin/sh command: - "-c" - - "PARSE_DASHBOARD_SERVER_URL=http://localhost:1337/parse node Parse-Dashboard/index.js" + - "PARSE_DASHBOARD_SERVER_URL=$UFFIZZI_URL/parse node Parse-Dashboard/index.js" deploy: resources: limits: memory: 1000M + nginx: + image: nginx:alpine + volumes: + - ./nginx-uffizzi:/etc/nginx + - ./nginx-uffizzi/html:/usr/share/nginx/html + volumes: postgres_data: From eb3a11a5b191616b7d655d74b05a12d7ff9ed209 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Wed, 18 Jan 2023 00:43:11 +0530 Subject: [PATCH 41/60] integrate uffizzi --- docker-compose.uffizzi.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 5fa1291cb3..89b0faa804 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -3,8 +3,8 @@ version: '3' # uffizzi integration x-uffizzi: ingress: - service: nginx - port: 8081 + service: portal + port: 4040 continuous_previews: deploy_preview_when_pull_request_is_opened: true delete_preview_when_pull_request_is_closed: true @@ -54,22 +54,22 @@ services: - PARSE_DASHBOARD_APP_NAME=MyParseApp - PARSE_DASHBOARD_USER_ID=admin - PARSE_DASHBOARD_USER_PASSWORD=password - - MOUNT_PATH=/dashboard + - MOUNT_PATH=/ - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 entrypoint: /bin/sh command: - "-c" - - "PARSE_DASHBOARD_SERVER_URL=$UFFIZZI_URL/parse node Parse-Dashboard/index.js" + - "PARSE_DASHBOARD_SERVER_URL=http://localhost:1337/parse node Parse-Dashboard/index.js" deploy: resources: limits: memory: 1000M - nginx: - image: nginx:alpine - volumes: - - ./nginx-uffizzi:/etc/nginx - - ./nginx-uffizzi/html:/usr/share/nginx/html + # nginx: + # image: nginx:alpine + # volumes: + # - ./nginx-uffizzi:/etc/nginx + # - ./nginx-uffizzi/html:/usr/share/nginx/html volumes: postgres_data: From 44d065419e62472edcbfed1926fcde869b61e1bb Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Wed, 18 Jan 2023 00:44:26 +0530 Subject: [PATCH 42/60] integrate uffizzi --- docker-compose.uffizzi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 89b0faa804..b2790acfc0 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -3,7 +3,7 @@ version: '3' # uffizzi integration x-uffizzi: ingress: - service: portal + service: dashboard port: 4040 continuous_previews: deploy_preview_when_pull_request_is_opened: true From e5591788d3484fd8ded02df167626e36297f8f0d Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Wed, 18 Jan 2023 01:01:35 +0530 Subject: [PATCH 43/60] integrate uffizzi --- docker-compose.uffizzi.yml | 16 ++++++++-------- nginx-uffizzi/nginx.conf | 15 ++++++++++----- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index b2790acfc0..13dc5292c9 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -3,8 +3,8 @@ version: '3' # uffizzi integration x-uffizzi: ingress: - service: dashboard - port: 4040 + service: nginx + port: 8081 continuous_previews: deploy_preview_when_pull_request_is_opened: true delete_preview_when_pull_request_is_closed: true @@ -59,17 +59,17 @@ services: entrypoint: /bin/sh command: - "-c" - - "PARSE_DASHBOARD_SERVER_URL=http://localhost:1337/parse node Parse-Dashboard/index.js" + - "PARSE_DASHBOARD_SERVER_URL=$UFFIZZI_URL/parse node Parse-Dashboard/index.js" deploy: resources: limits: memory: 1000M - # nginx: - # image: nginx:alpine - # volumes: - # - ./nginx-uffizzi:/etc/nginx - # - ./nginx-uffizzi/html:/usr/share/nginx/html + nginx: + image: nginx:alpine + volumes: + - ./nginx-uffizzi:/etc/nginx + - ./nginx-uffizzi/html:/usr/share/nginx/html volumes: postgres_data: diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index b98a5bf000..d6e5967aac 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -8,11 +8,6 @@ http { rewrite ^([^.]*[^/])$ $1/ permanent; location / { - root /usr/share/nginx/html; - index index.html index.htm; - } - - location /dashboard { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-NginX-Proxy true; @@ -22,6 +17,16 @@ http { proxy_redirect off; } + # location /dashboard { + # proxy_set_header X-Real-IP $remote_addr; + # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-NginX-Proxy true; + # proxy_pass http://localhost:4040/dashboard/; + # proxy_ssl_session_reuse off; + # proxy_set_header Host $http_host; + # proxy_redirect off; + # } + location /parse { proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; From 063bc3a8e617bb4f4450fcdd322af1818e83f5d1 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Wed, 18 Jan 2023 01:16:16 +0530 Subject: [PATCH 44/60] integrate uffizzi --- docker-compose.uffizzi.yml | 2 +- nginx-uffizzi/nginx.conf | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 13dc5292c9..5fa1291cb3 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -54,7 +54,7 @@ services: - PARSE_DASHBOARD_APP_NAME=MyParseApp - PARSE_DASHBOARD_USER_ID=admin - PARSE_DASHBOARD_USER_PASSWORD=password - - MOUNT_PATH=/ + - MOUNT_PATH=/dashboard - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 entrypoint: /bin/sh command: diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index d6e5967aac..b01abbb98b 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -3,11 +3,17 @@ events { } http { server { + listen 8081; rewrite ^([^.]*[^/])$ $1/ permanent; location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + location /dashboard { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-NginX-Proxy true; @@ -17,16 +23,6 @@ http { proxy_redirect off; } - # location /dashboard { - # proxy_set_header X-Real-IP $remote_addr; - # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-NginX-Proxy true; - # proxy_pass http://localhost:4040/dashboard/; - # proxy_ssl_session_reuse off; - # proxy_set_header Host $http_host; - # proxy_redirect off; - # } - location /parse { proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; From 453b70b1325b05b6e916ef98e8bcba5fb395e8ab Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Wed, 18 Jan 2023 01:41:39 +0530 Subject: [PATCH 45/60] integrate uffizzi --- docker-compose.uffizzi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 5fa1291cb3..7d2805a5ce 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -59,7 +59,7 @@ services: entrypoint: /bin/sh command: - "-c" - - "PARSE_DASHBOARD_SERVER_URL=$UFFIZZI_URL/parse node Parse-Dashboard/index.js" + - "PARSE_DASHBOARD_SERVER_URL=$$UFFIZZI_URL/parse node Parse-Dashboard/index.js" deploy: resources: limits: From dcc877e5660c4f8376298b1a2432b8e7bfb4810c Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Wed, 18 Jan 2023 01:54:10 +0530 Subject: [PATCH 46/60] integrate uffizzi --- docker-compose.uffizzi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 7d2805a5ce..a0f9cb1be8 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -59,7 +59,7 @@ services: entrypoint: /bin/sh command: - "-c" - - "PARSE_DASHBOARD_SERVER_URL=$$UFFIZZI_URL/parse node Parse-Dashboard/index.js" + - "PARSE_DASHBOARD_SERVER_URL=http://localhost:1337/parse node Parse-Dashboard/index.js" deploy: resources: limits: From c4cbeb10f7baea55c2563042544b2ab200db9c91 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Wed, 18 Jan 2023 02:18:57 +0530 Subject: [PATCH 47/60] integrate uffizzi --- docker-compose.uffizzi.yml | 2 +- nginx-uffizzi/nginx.conf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index a0f9cb1be8..5fa1291cb3 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -59,7 +59,7 @@ services: entrypoint: /bin/sh command: - "-c" - - "PARSE_DASHBOARD_SERVER_URL=http://localhost:1337/parse node Parse-Dashboard/index.js" + - "PARSE_DASHBOARD_SERVER_URL=$UFFIZZI_URL/parse node Parse-Dashboard/index.js" deploy: resources: limits: diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index b01abbb98b..6261deaff1 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -17,7 +17,7 @@ http { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-NginX-Proxy true; - proxy_pass http://localhost:4040/dashboard/; + proxy_pass http://0.0.0.0:4040/dashboard/; proxy_ssl_session_reuse off; proxy_set_header Host $http_host; proxy_redirect off; @@ -29,7 +29,7 @@ http { proxy_set_header X-Real-IP $remote_addr; keepalive_requests 10; keepalive_timeout 75s; - proxy_pass http://localhost:1337/parse/; + proxy_pass http://0.0.0.0:1337/parse/; proxy_http_version 1.1; } } From 713c47678a787a7adf81743ca06b248486760932 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Wed, 18 Jan 2023 02:37:52 +0530 Subject: [PATCH 48/60] integrate uffizzi --- nginx-uffizzi/nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index 6261deaff1..2ae4e3a704 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -17,7 +17,7 @@ http { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-NginX-Proxy true; - proxy_pass http://0.0.0.0:4040/dashboard/; + proxy_pass http://127.0.0.1:4040/dashboard/; proxy_ssl_session_reuse off; proxy_set_header Host $http_host; proxy_redirect off; @@ -29,7 +29,7 @@ http { proxy_set_header X-Real-IP $remote_addr; keepalive_requests 10; keepalive_timeout 75s; - proxy_pass http://0.0.0.0:1337/parse/; + proxy_pass http://127.0.0.1:1337/parse/; proxy_http_version 1.1; } } From 04e8cc7c5191b3659db46ecee62c248874595597 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Wed, 18 Jan 2023 12:21:33 +0530 Subject: [PATCH 49/60] test pr --- nginx-uffizzi/nginx.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index 2ae4e3a704..67c420dd41 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -1,6 +1,7 @@ events { worker_connections 1024; #default } + http { server { From 8dcc3238d4e7ca60705f80047a417599b5d53a48 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Wed, 18 Jan 2023 12:53:30 +0530 Subject: [PATCH 50/60] nginx expires --- nginx-uffizzi/nginx.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index 67c420dd41..13e01d783c 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -10,6 +10,7 @@ http { rewrite ^([^.]*[^/])$ $1/ permanent; location / { + expires -1; root /usr/share/nginx/html; index index.html index.htm; } From f3985d90c0f899c9872d73f82376a6075b6e69f0 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Wed, 18 Jan 2023 18:41:55 +0530 Subject: [PATCH 51/60] compose w CI config --- docker-compose.uffizzi.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 5fa1291cb3..d0e49f7c94 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -3,8 +3,8 @@ version: '3' # uffizzi integration x-uffizzi: ingress: - service: nginx - port: 8081 + service: dashboard + port: 4040 continuous_previews: deploy_preview_when_pull_request_is_opened: true delete_preview_when_pull_request_is_closed: true @@ -56,20 +56,21 @@ services: - PARSE_DASHBOARD_USER_PASSWORD=password - MOUNT_PATH=/dashboard - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 - entrypoint: /bin/sh - command: - - "-c" - - "PARSE_DASHBOARD_SERVER_URL=$UFFIZZI_URL/parse node Parse-Dashboard/index.js" + - PARSE_DASHBOARD_SERVER_URL=http://127.0.0.1:1337/parse + # entrypoint: /bin/sh + # command: + # - "-c" + # - "export PARSE_DASHBOARD_SERVER_URL=$$UFFIZZI_URL/parse node Parse-Dashboard/index.js" deploy: resources: limits: memory: 1000M - nginx: - image: nginx:alpine - volumes: - - ./nginx-uffizzi:/etc/nginx - - ./nginx-uffizzi/html:/usr/share/nginx/html + # nginx: + # image: nginx:alpine + # volumes: + # - ./nginx-uffizzi:/etc/nginx + # - ./nginx-uffizzi/html:/usr/share/nginx/html volumes: postgres_data: From 5eb3ab8ff8e4f4b880792b5e55e43d2d8854dc52 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Wed, 18 Jan 2023 19:10:58 +0530 Subject: [PATCH 52/60] compose w CI config --- docker-compose.uffizzi.yml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index d0e49f7c94..4db2fb7922 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -3,8 +3,8 @@ version: '3' # uffizzi integration x-uffizzi: ingress: - service: dashboard - port: 4040 + service: nginx + port: 8081 continuous_previews: deploy_preview_when_pull_request_is_opened: true delete_preview_when_pull_request_is_closed: true @@ -55,22 +55,23 @@ services: - PARSE_DASHBOARD_USER_ID=admin - PARSE_DASHBOARD_USER_PASSWORD=password - MOUNT_PATH=/dashboard - - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 - - PARSE_DASHBOARD_SERVER_URL=http://127.0.0.1:1337/parse - # entrypoint: /bin/sh - # command: - # - "-c" - # - "export PARSE_DASHBOARD_SERVER_URL=$$UFFIZZI_URL/parse node Parse-Dashboard/index.js" + # - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 + - TRUST_PROXY=1 + # - PARSE_DASHBOARD_SERVER_URL=http://127.0.0.1:1337/parse + entrypoint: /bin/sh + command: + - "-c" + - "export PARSE_DASHBOARD_SERVER_URL=$$UFFIZZI_URL/parse node Parse-Dashboard/index.js" deploy: resources: limits: memory: 1000M - # nginx: - # image: nginx:alpine - # volumes: - # - ./nginx-uffizzi:/etc/nginx - # - ./nginx-uffizzi/html:/usr/share/nginx/html + nginx: + image: nginx:alpine + volumes: + - ./nginx-uffizzi:/etc/nginx + - ./nginx-uffizzi/html:/usr/share/nginx/html volumes: postgres_data: From d79e4b838a93965e67e098ad0e42da1780cd0c3b Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Wed, 18 Jan 2023 19:35:34 +0530 Subject: [PATCH 53/60] compose w CI config --- docker-compose.uffizzi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 4db2fb7922..0b52386caf 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -61,7 +61,7 @@ services: entrypoint: /bin/sh command: - "-c" - - "export PARSE_DASHBOARD_SERVER_URL=$$UFFIZZI_URL/parse node Parse-Dashboard/index.js" + - "export PARSE_DASHBOARD_SERVER_URL=$$UFFIZZI_URL/parse && node Parse-Dashboard/index.js" deploy: resources: limits: From 27c894684557715a707d9678a34152fb56ec25f3 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Wed, 18 Jan 2023 20:00:25 +0530 Subject: [PATCH 54/60] compose w CI config --- docker-compose.uffizzi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 0b52386caf..60b88552e4 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -55,8 +55,8 @@ services: - PARSE_DASHBOARD_USER_ID=admin - PARSE_DASHBOARD_USER_PASSWORD=password - MOUNT_PATH=/dashboard - # - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 - - TRUST_PROXY=1 + - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 + # - TRUST_PROXY=1 # - PARSE_DASHBOARD_SERVER_URL=http://127.0.0.1:1337/parse entrypoint: /bin/sh command: From f44c78ba5e337f7fb8e3722cd629048a608424f0 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Wed, 18 Jan 2023 21:39:59 +0530 Subject: [PATCH 55/60] compose w CI config --- docker-compose.uffizzi.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index 60b88552e4..b6e5a2178e 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -11,7 +11,6 @@ x-uffizzi: share_to_github: true services: - postgres: image: postgres environment: From a675a222ca04d4a571eb45cae3802ba8da3f8007 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Wed, 18 Jan 2023 22:57:01 +0530 Subject: [PATCH 56/60] integrate --- docker-compose.uffizzi.yml | 7 +++---- nginx-uffizzi/nginx.conf | 14 +++++--------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml index b6e5a2178e..deca90a6fc 100644 --- a/docker-compose.uffizzi.yml +++ b/docker-compose.uffizzi.yml @@ -9,8 +9,8 @@ x-uffizzi: deploy_preview_when_pull_request_is_opened: true delete_preview_when_pull_request_is_closed: true share_to_github: true - services: + postgres: image: postgres environment: @@ -55,12 +55,11 @@ services: - PARSE_DASHBOARD_USER_PASSWORD=password - MOUNT_PATH=/dashboard - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 - # - TRUST_PROXY=1 - # - PARSE_DASHBOARD_SERVER_URL=http://127.0.0.1:1337/parse entrypoint: /bin/sh command: - "-c" - - "export PARSE_DASHBOARD_SERVER_URL=$$UFFIZZI_URL/parse && node Parse-Dashboard/index.js" + - "PARSE_DASHBOARD_SERVER_URL=$$UFFIZZI_URL/parse node Parse-Dashboard/index.js" + #- PARSE_DASHBOARD_COOKIE_SESSION_SECRET=AB8849B6-D725-4A75-AA73-AB7103F0363F deploy: resources: limits: diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index 13e01d783c..07a7789fe9 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -1,25 +1,21 @@ events { worker_connections 1024; #default } - http { - server { + server { listen 8081; - rewrite ^([^.]*[^/])$ $1/ permanent; - location / { - expires -1; - root /usr/share/nginx/html; - index index.html index.htm; + root /usr/share/nginx/html; + index index.html index.htm; } location /dashboard { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-NginX-Proxy true; - proxy_pass http://127.0.0.1:4040/dashboard/; + proxy_pass http://localhost:4040/dashboard/; proxy_ssl_session_reuse off; proxy_set_header Host $http_host; proxy_redirect off; @@ -31,7 +27,7 @@ http { proxy_set_header X-Real-IP $remote_addr; keepalive_requests 10; keepalive_timeout 75s; - proxy_pass http://127.0.0.1:1337/parse/; + proxy_pass http://localhost:1337/parse/; proxy_http_version 1.1; } } From bd47f9e3e08c1f6781971b0fef6b131c49b54751 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Thu, 19 Jan 2023 18:23:46 +0530 Subject: [PATCH 57/60] uffizzi --- nginx-uffizzi/nginx.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index 07a7789fe9..6ceab7c4e8 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -4,6 +4,7 @@ events { http { server { + listen 8081; location / { From 7ba97decb7970df352d4f6036c7e439b2f653cb0 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Thu, 19 Jan 2023 18:52:31 +0530 Subject: [PATCH 58/60] uffizzi --- nginx-uffizzi/nginx.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf index 6ceab7c4e8..137e462c42 100644 --- a/nginx-uffizzi/nginx.conf +++ b/nginx-uffizzi/nginx.conf @@ -1,6 +1,7 @@ events { worker_connections 1024; #default } + http { server { From 6cf32014b989b557cafc2564ff73e36816b2e067 Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi Date: Fri, 23 Dec 2022 11:03:18 +0530 Subject: [PATCH 59/60] Integrate Uffizzi --- docker-compose.uffizzi.yml | 75 +++++++++++++++++++++++++++++++++++ nginx-uffizzi/html/index.html | 20 ++++++++++ nginx-uffizzi/nginx.conf | 35 ++++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 docker-compose.uffizzi.yml create mode 100644 nginx-uffizzi/html/index.html create mode 100644 nginx-uffizzi/nginx.conf diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml new file mode 100644 index 0000000000..7d2805a5ce --- /dev/null +++ b/docker-compose.uffizzi.yml @@ -0,0 +1,75 @@ +version: '3' + +# uffizzi integration +x-uffizzi: + ingress: + service: nginx + port: 8081 + continuous_previews: + deploy_preview_when_pull_request_is_opened: true + delete_preview_when_pull_request_is_closed: true + share_to_github: true + +services: + + postgres: + image: postgres + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=password + - POSTGRES_DB=postgres + ports: + - "5432:5432" + deploy: + resources: + limits: + memory: 1000M + volumes: + - postgres_data:/var/lib/postgresql + + parse: + image: parseplatform/parse-server:latest + environment: + - PARSE_SERVER_APPLICATION_ID=parse + - PARSE_SERVER_MASTER_KEY=parse@master123! + - PARSE_SERVER_DATABASE_URI=postgresql://postgres:password@localhost:5432/postgres + - PARSE_SERVER_MOUNT_PATH=/parse + - PORT=1337 + ports: + - '1337:1337' + deploy: + resources: + limits: + memory: 1000M + + dashboard: + build: + context: . + dockerfile: ./Dockerfile + ports: + - "4040:4040" + environment: + - PARSE_DASHBOARD_MASTER_KEY=parse@master123! + - PARSE_DASHBOARD_APP_ID=parse + - PARSE_DASHBOARD_APP_NAME=MyParseApp + - PARSE_DASHBOARD_USER_ID=admin + - PARSE_DASHBOARD_USER_PASSWORD=password + - MOUNT_PATH=/dashboard + - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 + entrypoint: /bin/sh + command: + - "-c" + - "PARSE_DASHBOARD_SERVER_URL=$$UFFIZZI_URL/parse node Parse-Dashboard/index.js" + deploy: + resources: + limits: + memory: 1000M + + nginx: + image: nginx:alpine + volumes: + - ./nginx-uffizzi:/etc/nginx + - ./nginx-uffizzi/html:/usr/share/nginx/html + +volumes: + postgres_data: diff --git a/nginx-uffizzi/html/index.html b/nginx-uffizzi/html/index.html new file mode 100644 index 0000000000..1f624f6a33 --- /dev/null +++ b/nginx-uffizzi/html/index.html @@ -0,0 +1,20 @@ + + + + + + +Parse Dashboard Preview + + + + + +

Endpoint:

+ + Click to Visit Parse Dashboard + + + + + diff --git a/nginx-uffizzi/nginx.conf b/nginx-uffizzi/nginx.conf new file mode 100644 index 0000000000..6ceab7c4e8 --- /dev/null +++ b/nginx-uffizzi/nginx.conf @@ -0,0 +1,35 @@ +events { + worker_connections 1024; #default +} +http { + + server { + + listen 8081; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + location /dashboard { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://localhost:4040/dashboard/; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + } + + location /parse { + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + keepalive_requests 10; + keepalive_timeout 75s; + proxy_pass http://localhost:1337/parse/; + proxy_http_version 1.1; + } + } +} From e974022bee805106a683897f456c0c98a720fcbf Mon Sep 17 00:00:00 2001 From: Shruti Chaturvedi <66940685+ShrutiC-git@users.noreply.github.com> Date: Thu, 26 Jan 2023 20:43:04 +0530 Subject: [PATCH 60/60] Update index.html --- nginx-uffizzi/html/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/nginx-uffizzi/html/index.html b/nginx-uffizzi/html/index.html index 1f624f6a33..116a29ae7b 100644 --- a/nginx-uffizzi/html/index.html +++ b/nginx-uffizzi/html/index.html @@ -14,7 +14,6 @@

Endpoint:

Click to Visit Parse Dashboard -