From 226a9caf61a0511604ac34641a90ea305c0a4eda Mon Sep 17 00:00:00 2001 From: debdutdeb Date: Tue, 23 Jan 2024 18:41:47 +0000 Subject: [PATCH 01/16] Bump Rocket.Chat version to 6.5.3 --- snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index f536068..524f8b1 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,7 +1,7 @@ name: rocketchat-server title: Rocket.Chat Server base: core20 -version: 6.5.2 +version: 6.5.3 summary: An Open Source Slack Alternative description: | Have your own Slack like online chat, built with Meteor. https://rocket.chat/ From cdaee4ce96d02c07c5e77bbde2f4bc30cdde0660 Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Fri, 12 Apr 2024 17:18:53 +0530 Subject: [PATCH 02/16] chore: update snap version to 6.7.0 --- snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 524f8b1..a78d770 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,7 +1,7 @@ name: rocketchat-server title: Rocket.Chat Server base: core20 -version: 6.5.3 +version: 6.7.0 summary: An Open Source Slack Alternative description: | Have your own Slack like online chat, built with Meteor. https://rocket.chat/ From 248c0ccbd87dd84151fb12d403e702a3a08d4276 Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Mon, 11 Nov 2024 14:11:05 +0530 Subject: [PATCH 03/16] new 7 release --- MONGO_UPDATE.md | 2 +- .../feature_compatibity/00-adopt_version.sh | 0 snap/snapcraft.yaml | 13 ++++++++----- 3 files changed, 9 insertions(+), 6 deletions(-) mode change 100644 => 100755 migrations/pre_refresh/feature_compatibity/00-adopt_version.sh diff --git a/MONGO_UPDATE.md b/MONGO_UPDATE.md index f9ec693..0471a52 100644 --- a/MONGO_UPDATE.md +++ b/MONGO_UPDATE.md @@ -3,7 +3,7 @@ ## 1. Enable migration ```sh -chmod +x migrations/pre_refresh/feature_compatibility/00-adopt-version.sh +chmod +x migrations/pre_refresh/feature_compatibility/00-adopt_version.sh ``` This migration or pre-refresh script will make sure the feature compatibility version of the existing mongodb instance is set correctly for the update to pass through successfully. diff --git a/migrations/pre_refresh/feature_compatibity/00-adopt_version.sh b/migrations/pre_refresh/feature_compatibity/00-adopt_version.sh old mode 100644 new mode 100755 diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index a78d770..b42d5ce 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,12 +1,12 @@ name: rocketchat-server title: Rocket.Chat Server base: core20 -version: 6.7.0 +version: 7.0.0 summary: An Open Source Slack Alternative description: | Have your own Slack like online chat, built with Meteor. https://rocket.chat/ -epoch: 10 +epoch: 10* grade: stable confinement: strict @@ -80,7 +80,8 @@ parts: # - on amd64: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.0.27.tgz #- on amd64: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.2.17.tgz #- on amd64: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-4.4.15.tgz - - on amd64: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.15.tgz + # - on amd64: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.15.tgz + - on amd64: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-6.0.19.tgz # - on arm64: https://fastdl.mongodb.org/linux/mongodb-linux-arm64-ubuntu1604-3.6.23.tgz - on arm64: https://fastdl.mongodb.org/linux/mongodb-linux-arm64-ubuntu1604-4.0.28.tgz stage-packages: @@ -113,7 +114,8 @@ parts: plugin: dump source: #- on amd64: https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2004-x86_64-100.5.0.tgz - - on amd64: https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2004-x86_64-100.7.0.tgz + # - on amd64: https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2004-x86_64-100.7.0.tgz + - on amd64: https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2004-x86_64-100.10.0.tgz # - on arm64: https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2004-arm64-100.5.0.tgz stage: - bin/mongodump @@ -125,7 +127,8 @@ parts: #- on amd64: https://nodejs.org/download/release/v12.22.8/node-v12.22.8-linux-x64.tar.gz #- on amd64: https://nodejs.org/download/release/v14.18.3/node-v14.18.3-linux-x64.tar.xz #- on amd64: https://nodejs.org/download/release/v14.19.3/node-v14.19.3-linux-x64.tar.xz - - on amd64: https://nodejs.org/download/release/v14.21.2/node-v14.21.2-linux-x64.tar.xz + # - on amd64: https://nodejs.org/download/release/v14.21.2/node-v14.21.2-linux-x64.tar.xz + - on amd64: https://nodejs.org/dist/v20.18.0/node-v20.18.0-linux-x64.tar.xz #- on arm64: https://nodejs.org/download/release/v12.22.8/node-v12.22.8-linux-arm64.tar.gz - on arm64: https://nodejs.org/download/release/v14.18.3/node-v14.18.3-linux-arm64.tar.gz stage: From 38eef9ebde73334ce52437fe43482929522854fb Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Mon, 11 Nov 2024 14:31:21 +0530 Subject: [PATCH 04/16] run ci From 94851586976cece53d2066f0f40610ad0825ff4a Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Mon, 11 Nov 2024 14:53:00 +0530 Subject: [PATCH 05/16] use mongosh instead of mongo binary --- snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index b42d5ce..192c3c2 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -49,7 +49,7 @@ apps: - network-bind mongo: - command: bin/mongo + command: bin/mongosh environment: {LC_ALL: C} plugs: [network] From fc9d5b419aaedb24852dea0dca3bfd7ea78ffbad Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Mon, 11 Nov 2024 14:59:12 +0530 Subject: [PATCH 06/16] mongosh install --- snap/snapcraft.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 192c3c2..eb12202 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -49,7 +49,12 @@ apps: - network-bind mongo: - command: bin/mongosh + command: usr/bin/mongosh + environment: {LC_ALL: C} + plugs: [network] + + mongosh: + command: usr/bin/mongosh environment: {LC_ALL: C} plugs: [network] @@ -121,6 +126,11 @@ parts: - bin/mongodump - bin/mongorestore + mongosh: + plugin: dump + source: https://downloads.mongodb.com/compass/mongodb-mongosh_2.3.3_amd64.deb + source-type: deb + node: plugin: dump source: From 1af51793a6c992a40e0d20ba77946fb94aac6ca0 Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Mon, 11 Nov 2024 16:01:29 +0530 Subject: [PATCH 07/16] handle non existent revisions for track --- .github/workflows/test.yml | 14 ++++++++++++++ helpers/mongo.sh | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 40fd8c8..7641302 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,9 @@ on: required: false type: string default: 'false' + secrets: + snapcraft-credential: + required: false outputs: snap-basename: value: ${{ jobs.build.outputs.snap-basename }} @@ -35,6 +38,7 @@ jobs: commit: ${{ steps.prepare.outputs.commit }} run: ${{ steps.prepare.outputs.run }} candidate: ${{ steps.prepare.outputs.candidate }} + last-channel: ${{ steps.prepare.outputs.last-channel }} runs-on: ubuntu-latest steps: - name: 'Clone repository' @@ -45,6 +49,8 @@ jobs: - name: 'Prepare for next steps' id: prepare shell: bash + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.snapcraft-credential }} run: | version=${{ inputs.tag }} snap_track="${version:0:1}.x" @@ -86,6 +92,13 @@ jobs: echo "run=$run" >> $GITHUB_OUTPUT echo "commit=$commit" >>$GITHUB_OUTPUT + if ! snapcraft list-revisions rocketchat-server | tail -n '+2' | grep -q "$snap_track/stable"; then + last_channel="$((${version:0:1}-1)).x/stable" + fi + + echo "last_channel: $last_channel" + echo "last-channel=$last_channel" >> $GITHUB_OUTPUT + build: needs: - prepare @@ -145,6 +158,7 @@ jobs: - name: 'Run tests' shell: bash env: + ROCKETCHAT_PREVIOUS_CHANNEL: ${{ needs.prepare.outputs.last-channel }} ROCKETCHAT_TAG: ${{ inputs.tag }} run: | sudo apt-get --no-install-recommends install jo jq -y diff --git a/helpers/mongo.sh b/helpers/mongo.sh index 2e716a1..1b6ad93 100644 --- a/helpers/mongo.sh +++ b/helpers/mongo.sh @@ -7,6 +7,11 @@ MAX_MONGOD_START_RETRY_COUNT=30 MAX_MONGOD_PRIMARY_WAIT_SECONDS=5 MAX_MONGOD_PRIMARY_RETRY_COUNT=10 +mongo() { + # TODO switch to mongosh commands all over + mongosh "$@" +} + is_mongod_running() { local pid_file if ! pid_file=$(yq -e e .processManagement.pidFilePath $SNAP_DATA/mongod.conf); then From faf35c4941fd4bd87a3469aa9fba2f139063192a Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Mon, 11 Nov 2024 16:04:48 +0530 Subject: [PATCH 08/16] install snapcraft in prepare stage --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7641302..330a4ac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,6 +41,8 @@ jobs: last-channel: ${{ steps.prepare.outputs.last-channel }} runs-on: ubuntu-latest steps: + - uses: samuelmeuli/action-snapcraft@v2 + name: 'Install snapcraft' - name: 'Clone repository' uses: actions/checkout@v3 with: From 8f12050b44d9c12d8fb05376e7600c2f2adc8756 Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Mon, 11 Nov 2024 16:10:47 +0530 Subject: [PATCH 09/16] specify right workflow file --- .github/workflows/pr.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 62dcf73..2f86916 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -3,7 +3,6 @@ name: Build and test snap on: pull_request: branches: '**' - # - develop jobs: variables: @@ -20,7 +19,7 @@ jobs: echo "tag=$tag" >> $GITHUB_OUTPUT build-and-test: - uses: RocketChat/server-snap/.github/workflows/test.yml@develop + uses: RocketChat/server-snap/.github/workflows/test.yml@${{ github.head_ref || github.ref_name }} needs: [variables] with: tag: ${{ needs.variables.outputs.tag }} From 3d9c53efffd7a396bbdaf1700f9f84781d355ec3 Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Mon, 11 Nov 2024 16:13:13 +0530 Subject: [PATCH 10/16] this is weird From 0809768a9b057521323af0575cbb20e1cc2db77f Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Mon, 11 Nov 2024 16:19:07 +0530 Subject: [PATCH 11/16] doesn't support expansion --- .github/workflows/pr.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 2f86916..b2a8863 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -19,9 +19,12 @@ jobs: echo "tag=$tag" >> $GITHUB_OUTPUT build-and-test: - uses: RocketChat/server-snap/.github/workflows/test.yml@${{ github.head_ref || github.ref_name }} + # uses: RocketChat/server-snap/.github/workflows/test.yml@${{ github.head_ref || github.ref_name }} + uses: RocketChat/server-snap/.github/workflows/test.yml@7.x needs: [variables] with: tag: ${{ needs.variables.outputs.tag }} test-only: 'true' + secrets: + snapcraft-credential: ${{ secrets.snapcraft-credential }} From 80a1085e28f70970e9c50508a1dd61316bbea08c Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Mon, 11 Nov 2024 16:51:19 +0530 Subject: [PATCH 12/16] use rocketchat's repo --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 330a4ac..90ca621 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -154,7 +154,7 @@ jobs: - name: 'Clone tests repository' uses: actions/checkout@v3 with: - repository: debdutdeb/rocket.chat.tests + repository: RocketChat/public-releases submodules: true - name: 'Run tests' From df2b4cc1241abeba30e826939f5cf39fe7df47f6 Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Mon, 11 Nov 2024 16:53:44 +0530 Subject: [PATCH 13/16] right secret --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index b2a8863..14a2d49 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -26,5 +26,5 @@ jobs: tag: ${{ needs.variables.outputs.tag }} test-only: 'true' secrets: - snapcraft-credential: ${{ secrets.snapcraft-credential }} + snapcraft-credential: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} From e06db9c70b4efaf2ab7030e3c4b0d8246b3ec929 Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Tue, 12 Nov 2024 12:46:36 +0530 Subject: [PATCH 14/16] add deno --- helpers/rocketchat.sh | 3 +++ snap/snapcraft.yaml | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/helpers/rocketchat.sh b/helpers/rocketchat.sh index 4002bc9..d796115 100644 --- a/helpers/rocketchat.sh +++ b/helpers/rocketchat.sh @@ -14,6 +14,9 @@ start_rocketchat() { export MONGO_OPLOG_URL=$(snapctl get mongo-oplog-url) export ROOT_URL=$(snapctl get siteurl) export REG_TOKEN=$(snapctl get reg-token) + export DENO_DIR="$SNAP_COMMON/deno" + + [[ -d "$DENO_DIR" ]] || mkdir -p "$DENO_DIR" # We know that mongodb IS running # Let's save the PID someplace diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index eb12202..8b9eb79 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -146,6 +146,15 @@ parts: - include - lib + deno: + plugin: dump + # https://github.com/RocketChat/Rocket.Chat/blob/3bd70ee2165942a0fc731dbfd16482362eb5114a/apps/meteor/.docker/Dockerfile.debian#L1 + source: + - on amd64: https://github.com/denoland/deno/releases/download/v1.37.1/deno-x86_64-unknown-linux-gnu.zip + source-type: zip + organize: + deno: bin/deno # https://github.com/RocketChat/public-releases/blob/96976fbc0e263658e55281472b3fd04b77defc1b/snap/snap.bats#L58 + # libvips: # source: # - on arm64: https://github.com/libvips/libvips/releases/download/v8.12.2/vips-8.12.2.tar.gz From d86ed693a55f1ec2fbc8bd4f4b39904727e40aba Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Wed, 13 Nov 2024 19:03:32 +0530 Subject: [PATCH 15/16] .. --- .github/workflows/force_release.yaml | 6 +++--- .github/workflows/main.yml | 24 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/force_release.yaml b/.github/workflows/force_release.yaml index 54e14b0..5f8388c 100644 --- a/.github/workflows/force_release.yaml +++ b/.github/workflows/force_release.yaml @@ -12,7 +12,7 @@ jobs: with: ref: ${{ github.ref_name }} path: server-snap - + - name: Set variables id: prepare working-directory: server-snap @@ -34,11 +34,11 @@ jobs: id: snap-build with: path: server-snap - + - name: 'Clone tests repository' uses: actions/checkout@v3 with: - repository: debdutdeb/rocket.chat.tests + repository: RocketChat/public-releases submodules: true path: tests diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6dca7e9..9de444a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,12 +11,34 @@ on: required: true github-token: required: true + workflow_dispatch: + # this trigger uses existing version for release jobs: + prereqs: + runs-on: ubuntu-latest + outputs: + version: ${{ steps._id.outputs.version }} + steps: + - shell: bash + id: _id + run: | + tag= + if [[ "${{ github.event_name }}" == 'workflow_dispatch' ]]; then + tag="$(awk -F: '/^version:/ snap/snapcraft.yaml {print $2}' | tr -d '[:space:]')" + else + tag="${{inputs.tag}}" + fi + + echo "tag: $tag" + echo "version=$tag" >> $GITHUB_OUTPUT + + build-and-test: + needs: [ prereqs ] uses: RocketChat/server-snap/.github/workflows/test.yml@develop with: - tag: ${{ inputs.tag }} + tag: ${{ needs.prereqs.outputs.version }} release: if: '! contains(inputs.tag, ''rc'')' From 9ff62a6fa079a1232b27da839c860fba26edf5af Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Wed, 13 Nov 2024 19:23:22 +0530 Subject: [PATCH 16/16] fix bash syntax error --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9de444a..4ffe288 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,7 +25,7 @@ jobs: run: | tag= if [[ "${{ github.event_name }}" == 'workflow_dispatch' ]]; then - tag="$(awk -F: '/^version:/ snap/snapcraft.yaml {print $2}' | tr -d '[:space:]')" + tag="$(awk -F: '/^version:/ {print $2}' snap/snapcraft.yaml | tr -d '[:space:]')" else tag="${{inputs.tag}}" fi