diff --git a/.github/workflows/client-build.yml b/.github/workflows/client-build.yml index 85d7fa41d673..8e0568b65053 100644 --- a/.github/workflows/client-build.yml +++ b/.github/workflows/client-build.yml @@ -63,7 +63,7 @@ jobs: # Timestamp will be used to create cache key - id: timestamp - run: echo "::set-output name=timestamp::$(timestamp +'%Y-%m-%dT%H:%M:%S')" + run: echo "::set-output name=timestamp::$(date +'%Y-%m-%dT%H:%M:%S')" # In case this is second attempt try restoring status of the prior attempt from cache - name: Restore the previous run result diff --git a/.github/workflows/integration-tests-command.yml b/.github/workflows/integration-tests-command.yml index 9f4afcb3c029..fe08194be9bb 100644 --- a/.github/workflows/integration-tests-command.yml +++ b/.github/workflows/integration-tests-command.yml @@ -83,7 +83,7 @@ jobs: # Timestamp will be used to create cache key - id: timestamp - run: echo "::set-output name=timestamp::$(timestamp +'%Y-%m-%dT%H:%M:%S')" + run: echo "::set-output name=timestamp::$(date +'%Y-%m-%dT%H:%M:%S')" # In case this is second attempt try restoring status of the prior attempt from cache - name: Restore the previous run result @@ -477,7 +477,7 @@ jobs: # Timestamp will be used to create cache key - id: timestamp - run: echo "::set-output name=timestamp::$(timestamp +'%Y-%m-%dT%H:%M:%S')" + run: echo "::set-output name=timestamp::$(date +'%Y-%m-%dT%H:%M:%S')" # In case this is second attempt try restoring status of the prior attempt from cache - name: Restore the previous run result diff --git a/.github/workflows/perf-test.yml b/.github/workflows/perf-test.yml index 8adf4ffe040e..89af85bea541 100644 --- a/.github/workflows/perf-test.yml +++ b/.github/workflows/perf-test.yml @@ -60,7 +60,7 @@ jobs: # Timestamp will be used to create cache key - id: timestamp - run: echo "::set-output name=timestamp::$(timestamp +'%Y-%m-%dT%H:%M:%S')" + run: echo "::set-output name=timestamp::$(date +'%Y-%m-%dT%H:%M:%S')" # In case this is second attempt try restoring status of the prior attempt from cache - name: Restore the previous run result diff --git a/.github/workflows/rts-build.yml b/.github/workflows/rts-build.yml index 1cbaae86228a..028fd4376751 100644 --- a/.github/workflows/rts-build.yml +++ b/.github/workflows/rts-build.yml @@ -62,7 +62,7 @@ jobs: # Timestamp will be used to create cache key - id: timestamp - run: echo "::set-output name=timestamp::$(timestamp +'%Y-%m-%dT%H:%M:%S')" + run: echo "::set-output name=timestamp::$(date +'%Y-%m-%dT%H:%M:%S')" # In case this is second attempt try restoring status of the prior attempt from cache - name: Restore the previous run result @@ -129,7 +129,7 @@ jobs: if: steps.run_result.outputs.run_result != 'success' run: | echo 'export const VERSION = "${{ steps.vars.outputs.version }}"' > src/version.js - ./build.sh + yarn build # Restore the previous built bundle if present. If not push the newly built into the cache - name: Restore the previous bundle @@ -141,18 +141,18 @@ jobs: restore-keys: | ${{ github.run_id }}-${{ github.job }} + # Tar the bundles to speed up the upload & download process + - name: Tar the rts bundles + run: | + ls -al dist/node_modules/@shared/ast + tar -cvf rts-dist.tar dist + # Upload the build artifacts and dependencies so that it can be used by the test & deploy job in other workflows - name: Upload rts build bundle uses: actions/upload-artifact@v2 with: - name: rts-build - path: app/rts/dist/ - - - name: Upload RTS dependencies bundle - uses: actions/upload-artifact@v2 - with: - name: rts-build-deps - path: app/rts/node_modules/ + name: rts-dist + path: app/rts/rts-dist.tar # Set status = success - run: echo "::set-output name=run_result::success" > ~/run_result diff --git a/.github/workflows/server-build.yml b/.github/workflows/server-build.yml index 81e7088c567b..9904d32254af 100644 --- a/.github/workflows/server-build.yml +++ b/.github/workflows/server-build.yml @@ -69,7 +69,7 @@ jobs: # Timestamp will be used to create cache key - id: timestamp - run: echo "::set-output name=timestamp::$(timestamp +'%Y-%m-%dT%H:%M:%S')" + run: echo "::set-output name=timestamp::$(date +'%Y-%m-%dT%H:%M:%S')" # In case this is second attempt try restoring status of the prior attempt from cache - name: Restore the previous run result diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml index 4316161f9276..64cddad0da84 100644 --- a/.github/workflows/test-build-docker-image.yml +++ b/.github/workflows/test-build-docker-image.yml @@ -54,7 +54,7 @@ jobs: # Timestamp will be used to create cache key - id: timestamp - run: echo "::set-output name=timestamp::$(timestamp +'%Y-%m-%dT%H:%M:%S')" + run: echo "::set-output name=timestamp::$(date +'%Y-%m-%dT%H:%M:%S')" # In case this is second attempt try restoring status of the prior attempt from cache - name: Restore the previous run result @@ -203,7 +203,7 @@ jobs: # Timestamp will be used to create cache key - id: timestamp - run: echo "::set-output name=timestamp::$(timestamp +'%Y-%m-%dT%H:%M:%S')" + run: echo "::set-output name=timestamp::$(date +'%Y-%m-%dT%H:%M:%S')" # In case this is second attempt try restoring status of the prior attempt from cache - name: Restore the previous run result @@ -318,7 +318,7 @@ jobs: # Timestamp will be used to create cache key - id: timestamp - run: echo "::set-output name=timestamp::$(timestamp +'%Y-%m-%dT%H:%M:%S')" + run: echo "::set-output name=timestamp::$(date +'%Y-%m-%dT%H:%M:%S')" # In case this is second attempt try restoring status of the prior attempt from cache - name: Restore the previous run result @@ -366,8 +366,7 @@ jobs: if: steps.run_result.outputs.run_result != 'success' run: | echo 'export const VERSION = "${{ steps.vars.outputs.version }}"' > src/version.js - ./build.sh - ls -l dist + yarn build # Restore the previous built bundle if present. If not push the newly built into the cache - name: Restore the previous bundle @@ -379,28 +378,22 @@ jobs: restore-keys: | ${{ github.run_id }}-${{ github.job }} - # Restore the previous built bundle if present. If not push the newly built into the cache - - name: Restore the previous bundle - uses: actions/cache@v2 - with: - path: | - app/rts/node_modules/ - key: ${{ github.run_id }}-${{ github.job }}-${{ steps.timestamp.outputs.timestamp }} - restore-keys: | - ${{ github.run_id }}-${{ github.job }} + # Tar the bundles to speed up the upload & download process + - name: Tar the rts bundles + run: | + ls -al dist/node_modules/@shared/ast + tar -cvf rts-dist.tar dist # Upload the build artifact so that it can be used by the test & deploy job in the workflow - name: Upload server build bundle uses: actions/upload-artifact@v2 with: - name: rts-build - path: app/rts/dist/ + name: rts-dist + path: app/rts/rts-dist.tar + + # Set status = success + - run: echo "::set-output name=run_result::success" > ~/run_result - - name: Upload RTS dependencies bundle - uses: actions/upload-artifact@v2 - with: - name: rts-build-deps - path: app/rts/node_modules/ perf-test: needs: [buildClient, buildServer, buildRts] @@ -439,7 +432,7 @@ jobs: # Timestamp will be used to create cache key - id: timestamp - run: echo "::set-output name=timestamp::$(timestamp +'%Y-%m-%dT%H:%M:%S')" + run: echo "::set-output name=timestamp::$(date +'%Y-%m-%dT%H:%M:%S')" # In case this is second attempt try restoring status of the prior attempt from cache - name: Restore the previous run result @@ -665,7 +658,7 @@ jobs: # Timestamp will be used to create cache key - id: timestamp - run: echo "::set-output name=timestamp::$(timestamp +'%Y-%m-%dT%H:%M:%S')" + run: echo "::set-output name=timestamp::$(date +'%Y-%m-%dT%H:%M:%S')" # In case this is second attempt try restoring status of the prior attempt from cache - name: Restore the previous run result @@ -1072,7 +1065,7 @@ jobs: # Timestamp will be used to create cache key - id: timestamp - run: echo "::set-output name=timestamp::$(timestamp +'%Y-%m-%dT%H:%M:%S')" + run: echo "::set-output name=timestamp::$(date +'%Y-%m-%dT%H:%M:%S')" # In case this is second attempt try restoring status of the prior attempt from cache - name: Restore the previous run result @@ -1540,14 +1533,14 @@ jobs: - name: Download the rts build artifact uses: actions/download-artifact@v2 with: - name: rts-build + name: rts-dist path: app/rts/dist - - name: Download the rts build artifact - uses: actions/download-artifact@v2 - with: - name: rts-build-deps - path: app/rts/node_modules/ + - name: Untar the rts folder + run: | + tar -xvf app/rts/dist/rts-dist.tar -C app/rts/ + echo "Cleaning up the tar files" + rm app/rts/dist/rts-dist.tar # Here, the GITHUB_REF is of type /refs/head/. We extract branch_name from this by removing the # first 11 characters. This can be used to build images for several branches @@ -1656,7 +1649,6 @@ jobs: tags: | ${{ secrets.DOCKER_HUB_ORGANIZATION }}/appsmith-server:${{ github.sha }} ${{ secrets.DOCKER_HUB_ORGANIZATION }}/appsmith-server:nightly - # Build release Docker image and push to Docker Hub - name: Push RTS release image to Docker Hub if: success() && github.ref == 'refs/heads/release' diff --git a/app/rts/build.sh b/app/rts/build.sh index cfcde751d831..7137fd4435ac 100755 --- a/app/rts/build.sh +++ b/app/rts/build.sh @@ -5,5 +5,7 @@ set -o errexit cd "$(dirname "$0")" yarn install --frozen-lockfile npx tsc && npx tsc-alias -# Copying node_modules directory into dist as rts server requires node_modules to run server build properly. This was previously being done in dockerfile which was copying the symlinks to image rather than the whole directory of shared modules (e.g. AST) -cp -r node_modules ./dist +# Copying node_modules directory into dist as rts server requires node_modules to run server build properly. +# This was previously being done in dockerfile which was copying the symlinks to image rather than the whole directory of shared modules (e.g. AST) +# Also, we copy node_modules with -L flag in order to follow the symlinks for @shared folder and copy the contents instead of just the symlink +cp -rL node_modules ./dist diff --git a/depot.json b/depot.json index f1c56eca2987..bc4321537d4f 100644 --- a/depot.json +++ b/depot.json @@ -1 +1 @@ -{"id":"ts81441f91"} +{ "id": "ts81441f91" }