From 5131a3aa11144cb060b8a3926b7b7ef618b712cd Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Wed, 11 Dec 2019 12:09:22 -0300 Subject: [PATCH] GitHub CI (#15918) --- .circleci/config.yml | 11 +- .circleci/docker.sh | 13 - .github/workflows/build_and_test.yml | 438 ++++++++++++++++++ .scripts/set-version.js | 1 - .scripts/start-xvfb.sh | 6 - .travis.yml | 104 ----- .travis/docker.sh | 15 - .travis/namefiles.sh | 9 - .travis/setartname.sh | 6 - .travis/setdeploydir.sh | 2 - .travis/setupsig.sh | 9 - .travis/sign.key.gpg | Bin 5117 -> 0 bytes .travis/snap.sh | 54 --- .travis/update-releases.sh | 8 - package.json | 1 - .../plugin/build-livechat.js | 6 +- .../plugin/compile-version.js | 8 - 17 files changed, 449 insertions(+), 242 deletions(-) delete mode 100644 .circleci/docker.sh create mode 100644 .github/workflows/build_and_test.yml delete mode 100755 .scripts/start-xvfb.sh delete mode 100644 .travis.yml delete mode 100755 .travis/docker.sh delete mode 100755 .travis/namefiles.sh delete mode 100755 .travis/setartname.sh delete mode 100755 .travis/setdeploydir.sh delete mode 100755 .travis/setupsig.sh delete mode 100644 .travis/sign.key.gpg delete mode 100755 .travis/snap.sh delete mode 100755 .travis/update-releases.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 4dd71940190..7300584bcb4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -464,7 +464,8 @@ workflows: tags: only: /^[0-9]+\.[0-9]+\.[0-9]+(?:-(?:rc|beta)\.[0-9]+)?$/ - test-with-oplog-mongo-4-0: *test-mongo - - deploy: + - hold-deploy: + type: approval requires: - test-with-oplog-mongo-3-4 - test-with-oplog-mongo-3-6 @@ -474,6 +475,14 @@ workflows: only: develop tags: only: /^[0-9]+\.[0-9]+\.[0-9]+(?:-(?:rc|beta)\.[0-9]+)?$/ + - deploy: + requires: + - hold-deploy + filters: + branches: + only: develop + tags: + only: /^[0-9]+\.[0-9]+\.[0-9]+(?:-(?:rc|beta)\.[0-9]+)?$/ - image-build: requires: - deploy diff --git a/.circleci/docker.sh b/.circleci/docker.sh deleted file mode 100644 index 4edf27c2177..00000000000 --- a/.circleci/docker.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -set -euvo pipefail -IFS=$'\n\t' - -CURL_URL="https://registry.hub.docker.com/u/rocketchat/rocket.chat/trigger/$DOCKER_TRIGGER_TOKEN/" - -if [[ $CIRCLE_TAG ]]; then - CURL_DATA='{"source_type":"Tag","source_name":"'"$CIRCLE_TAG"'"}'; -else - CURL_DATA='{"source_type":"Branch","source_name":"'"$CIRCLE_BRANCH"'"}'; -fi - -curl -H "Content-Type: application/json" --data "$CURL_DATA" -X POST "$CURL_URL" diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml new file mode 100644 index 00000000000..55925a503bf --- /dev/null +++ b/.github/workflows/build_and_test.yml @@ -0,0 +1,438 @@ +name: Build and Test + +on: + release: + types: [published] + pull_request: + branches: '**' + push: + branches: + - develop + +env: + CI: true + MONGO_URL: mongodb://localhost:27017 + TOOL_NODE_FLAGS: --max_old_space_size=4096 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Github Info + run: | + echo "GITHUB_ACTION: $GITHUB_ACTION" + echo "GITHUB_ACTOR: $GITHUB_ACTOR" + echo "GITHUB_REF: $GITHUB_REF" + echo "GITHUB_HEAD_REF: $GITHUB_HEAD_REF" + echo "GITHUB_BASE_REF: $GITHUB_BASE_REF" + echo "github.event_name: ${{ github.event_name }}" + cat $GITHUB_EVENT_PATH + + - uses: actions/checkout@v1 + + - name: Cache node modules + id: cache-nodemodules + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ runner.OS }}-node_modules-${{ hashFiles('**/package-lock.json') }} + + - name: Cache meteor local + uses: actions/cache@v1 + with: + path: ./.meteor/local + key: ${{ runner.OS }}-meteor_cache-${{ hashFiles('.meteor/versions') }} + + - name: Cache meteor + uses: actions/cache@v1 + with: + path: ~/.meteor + key: ${{ runner.OS }}-meteor-${{ hashFiles('.meteor/release') }} + + - name: Use Node.js 8.16.2 + uses: actions/setup-node@v1 + with: + node-version: "8.16.2" + + - name: Install Meteor + run: | + # Restore bin from cache + set +e + METEOR_SYMLINK_TARGET=$(readlink ~/.meteor/meteor) + METEOR_TOOL_DIRECTORY=$(dirname "$METEOR_SYMLINK_TARGET") + set -e + LAUNCHER=$HOME/.meteor/$METEOR_TOOL_DIRECTORY/scripts/admin/launch-meteor + if [ -e $LAUNCHER ] + then + echo "Cached Meteor bin found, restoring it" + sudo cp "$LAUNCHER" "/usr/local/bin/meteor" + else + echo "No cached Meteor bin found." + fi + + # only install meteor if bin isn't found + command -v meteor >/dev/null 2>&1 || curl https://install.meteor.com | sed s/--progress-bar/-sL/g | /bin/sh + + - name: Versions + run: | + npm --versions + node -v + meteor --version + meteor npm --versions + meteor node -v + git version + + - name: npm install + if: steps.cache-nodemodules.outputs.cache-hit != 'true' + run: | + meteor npm install + + - name: Launch MongoDB + uses: wbari/start-mongoDB@v0.2 + with: + mongoDBVersion: "4.0" + + - run: npm run lint + + - run: npm run testunit + + # To reduce memory need during actual build, build the packages solely first + - name: Build a Meteor cache + run: | + # to do this we can clear the main files and it build the rest + echo "" > server/main.js + echo "" > client/main.js + sed -i.backup 's/rocketchat:livechat/#rocketchat:livechat/' .meteor/packages + meteor build --server-only --debug --directory /tmp/build-temp + git checkout -- server/main.js client/main.js .meteor/packages + + - name: Reset Meteor + if: startsWith(github.ref, 'refs/tags/') == 'true' || github.ref == 'refs/heads/develop' + run: | + meteor reset + + - name: Build Rocket.Chat From Pull Request + if: startsWith(github.ref, 'refs/pull/') == true + env: + METEOR_PROFILE: 1000 + run: | + meteor build --server-only --directory --debug /tmp/build-test + + - name: Build Rocket.Chat + if: startsWith(github.ref, 'refs/pull/') != true + run: | + meteor build --server-only --directory /tmp/build-test + + - name: Prepare build + run: | + mkdir /tmp/build/ + cd /tmp/build-test + tar czf /tmp/build/Rocket.Chat.tar.gz bundle + cd /tmp/build-test/bundle/programs/server + npm install + cd /tmp + tar czf Rocket.Chat.test.tar.gz ./build-test + + - name: Store build for tests + uses: actions/upload-artifact@v1 + with: + name: build-test + path: /tmp/Rocket.Chat.test.tar.gz + + - name: Store build + uses: actions/upload-artifact@v1 + with: + name: build + path: /tmp/build + + test: + runs-on: ubuntu-16.04 + needs: build + + strategy: + matrix: + node-version: ["8.16.2"] + mongodb-version: ["3.4", "3.6", "4.0"] + + steps: + - name: Launch MongoDB + uses: wbari/start-mongoDB@v0.2 + with: + mongoDBVersion: ${{ matrix.mongodb-version }} --noprealloc --smallfiles --replSet=rs0 + + - name: Restore build for tests + uses: actions/download-artifact@v1 + with: + name: build-test + path: /tmp + + - name: Decompress build + run: | + cd /tmp + tar xzf Rocket.Chat.test.tar.gz + cd - + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Setup Chrome + run: | + npm i chromedriver + + - name: Configure Replica Set + run: | + docker exec mongo mongo --eval 'rs.initiate({_id:"rs0", members: [{"_id":1, "host":"localhost:27017"}]})' + docker exec mongo mongo --eval 'rs.status()' + + - uses: actions/checkout@v1 + + - name: Cache node modules + id: cache-nodemodules + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }} + + - name: NPM install + if: steps.cache-nodemodules.outputs.cache-hit != 'true' + run: | + npm install + + - name: Test + env: + TEST_MODE: "true" + MONGO_URL: mongodb://localhost:27017/rocketchat + MONGO_OPLOG_URL: mongodb://localhost:27017/local + run: | + for i in $(seq 1 5); do (docker exec mongo mongo rocketchat --eval 'db.dropDatabase()') && xvfb-run --auto-servernum npm test && s=0 && break || s=$? && sleep 1; done; (exit $s) + +# notification: +# runs-on: ubuntu-latest +# needs: test + +# steps: +# - name: Rocket.Chat Notification +# uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@1.1.1 +# with: +# type: ${{ job.status }} +# job_name: '**Build and Test**' +# url: ${{ secrets.ROCKETCHAT_WEBHOOK }} +# commit: true +# token: ${{ secrets.GITHUB_TOKEN }} + + build-image-pr: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + + steps: + - uses: actions/checkout@v1 + + - name: Cache node modules + id: cache-nodemodules + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ runner.OS }}-node_modules-${{ hashFiles('**/package-lock.json') }} + + - name: Cache meteor local + uses: actions/cache@v1 + with: + path: ./.meteor/local + key: ${{ runner.OS }}-meteor_cache-${{ hashFiles('.meteor/versions') }} + + - name: Cache meteor + uses: actions/cache@v1 + with: + path: ~/.meteor + key: ${{ runner.OS }}-meteor-${{ hashFiles('.meteor/release') }} + + - name: Use Node.js 8.16.2 + uses: actions/setup-node@v1 + with: + node-version: "8.16.2" + + - name: Install Meteor + run: | + # Restore bin from cache + set +e + METEOR_SYMLINK_TARGET=$(readlink ~/.meteor/meteor) + METEOR_TOOL_DIRECTORY=$(dirname "$METEOR_SYMLINK_TARGET") + set -e + LAUNCHER=$HOME/.meteor/$METEOR_TOOL_DIRECTORY/scripts/admin/launch-meteor + if [ -e $LAUNCHER ] + then + echo "Cached Meteor bin found, restoring it" + sudo cp "$LAUNCHER" "/usr/local/bin/meteor" + else + echo "No cached Meteor bin found." + fi + + # only install meteor if bin isn't found + command -v meteor >/dev/null 2>&1 || curl https://install.meteor.com | sed s/--progress-bar/-sL/g | /bin/sh + + - name: Versions + run: | + npm --versions + node -v + meteor --version + meteor npm --versions + meteor node -v + git version + echo $GITHUB_REF + + - name: npm install + if: steps.cache-nodemodules.outputs.cache-hit != 'true' + run: | + meteor npm install + + # To reduce memory need during actual build, build the packages solely first + - name: Build a Meteor cache + run: | + # to do this we can clear the main files and it build the rest + echo "" > server/main.js + echo "" > client/main.js + sed -i.backup 's/rocketchat:livechat/#rocketchat:livechat/' .meteor/packages + meteor build --server-only --debug --directory /tmp/build-temp + git checkout -- server/main.js client/main.js .meteor/packages + + - name: Build Rocket.Chat + run: | + meteor build --server-only --directory /tmp/build-pr + + - name: Build Docker image for PRs + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: pr-${{ github.event.number }} + run: | + cd /tmp/build-pr + + export OWNER="${GITHUB_REPOSITORY%/*}" + + docker login docker.pkg.github.com -u "${OWNER}" -p "${GITHUB_TOKEN}" + + cp $GITHUB_WORKSPACE/.docker/Dockerfile . + + export LOWERCASE_REPOSITORY=$(echo "$GITHUB_REPOSITORY" | tr "[:upper:]" "[:lower:]") + + export IMAGE_NAME="docker.pkg.github.com/${LOWERCASE_REPOSITORY}/rocket.chat:${VERSION}" + + echo "Build official Docker image ${IMAGE_NAME}" + + docker build -t $IMAGE_NAME . + docker push $IMAGE_NAME + + deploy: + runs-on: ubuntu-latest + if: github.event_name == 'release' || github.ref == 'refs/heads/develop' + needs: test + + steps: + - uses: actions/checkout@v1 + + - name: Restore build + uses: actions/download-artifact@v1 + with: + name: build + path: /tmp/build + + - name: Publish assets + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} + REDHAT_REGISTRY_PID: ${{ secrets.REDHAT_REGISTRY_PID }} + REDHAT_REGISTRY_KEY: ${{ secrets.REDHAT_REGISTRY_KEY }} + UPDATE_TOKEN: ${{ secrets.UPDATE_TOKEN }} + run: | + if [[ '${{ github.event_name }}' = 'release' ]]; then + export CIRCLE_TAG="${GITHUB_REF#*tags/}" + else + export CIRCLE_BRANCH="${GITHUB_REF#*heads/}" + fi; + + export CIRCLE_SHA1=$GITHUB_SHA + export CIRCLE_BUILD_NUM=$GITHUB_SHA + + aws s3 cp s3://rocketchat/sign.key.gpg .circleci/sign.key.gpg + + source .circleci/setartname.sh + source .circleci/setdeploydir.sh + bash .circleci/setupsig.sh + bash .circleci/namefiles.sh + + aws s3 cp $ROCKET_DEPLOY_DIR/ s3://download.rocket.chat/build/ --recursive + + bash .circleci/update-releases.sh + bash .circleci/snap.sh + bash .circleci/redhat-registry.sh + + image-build: + runs-on: ubuntu-latest + needs: deploy + + strategy: + matrix: + release: ["official", "preview"] + + env: + IMAGE: "rocketchat/rocket.chat" + + steps: + - uses: actions/checkout@v1 + + - name: Restore build + uses: actions/download-artifact@v1 + with: + name: build + path: /tmp/build + + - name: Unpack build + env: + DOCKER_USER: ${{ secrets.DOCKER_USER }} + DOCKER_PASS: ${{ secrets.DOCKER_PASS }} + run: | + cd /tmp/build + tar xzf Rocket.Chat.tar.gz + rm Rocket.Chat.tar.gz + + export DOCKER_PATH="${GITHUB_WORKSPACE}/.docker" + if [[ '${{ matrix.release }}' = 'preview' ]]; then + export IMAGE="${IMAGE}.preview" + export DOCKER_PATH="${DOCKER_PATH}-mongo" + fi; + + echo "Build ${{ matrix.release }} Docker image" + cp ${DOCKER_PATH}/Dockerfile . + if [ -e ${DOCKER_PATH}/entrypoint.sh ]; then + cp ${DOCKER_PATH}/entrypoint.sh . + fi; + + docker login -u $DOCKER_USER -p $DOCKER_PASS + + - name: Build Docker image for tag + if: github.event_name == 'release' + run: | + cd /tmp/build + export CIRCLE_TAG="${GITHUB_REF#*tags/}" + + docker build -t ${IMAGE}:$CIRCLE_TAG . + docker push ${IMAGE}:$CIRCLE_TAG + + if echo "$CIRCLE_TAG" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$' ; then + export RELEASE="latest" + elif echo "$CIRCLE_TAG" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$' ; then + export RELEASE="release-candidate" + fi + + docker tag ${IMAGE}:$CIRCLE_TAG ${IMAGE}:${RELEASE} + docker push ${IMAGE}:${RELEASE} + + - name: Build Docker image for develop + if: github.ref == 'refs/heads/develop' + run: | + cd /tmp/build + docker build -t ${IMAGE}:develop . + docker push ${IMAGE}:develop diff --git a/.scripts/set-version.js b/.scripts/set-version.js index 6524ce70017..5f3a6e4b94c 100644 --- a/.scripts/set-version.js +++ b/.scripts/set-version.js @@ -21,7 +21,6 @@ try { const files = [ './package.json', - './.travis/snap.sh', './.circleci/snap.sh', './.circleci/update-releases.sh', './.docker/Dockerfile', diff --git a/.scripts/start-xvfb.sh b/.scripts/start-xvfb.sh deleted file mode 100755 index 70be0b2e6bd..00000000000 --- a/.scripts/start-xvfb.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - sh -e /etc/init.d/xvfb start - sleep 3 -fi diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 31f618fadec..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,104 +0,0 @@ -language: node_js -services: -- docker -- mongodb -branches: - only: - - develop - - "/^\\d+\\.\\d+\\.\\d+(-rc\\.\\d+)?$/" -git: - depth: 1 -node_js: -- '8' -addons: - apt: - sources: - - google-chrome - - ubuntu-toolchain-r-test - packages: - - google-chrome-stable - - g++-4.8 - firefox: "latest" -before_cache: -- rm -rf $HOME/build/RocketChat/Rocket.Chat/.meteor/local/log -- rm -rf $HOME/build/RocketChat/Rocket.Chat/.meteor/local/run -- rm -rf $HOME/build/RocketChat/Rocket.Chat/.meteor/local/db -cache: - directories: - - "$HOME/node_modules" - - "$HOME/.meteor" - - "$HOME/.npm" - - "$HOME/.node-gyp" - - "$HOME/build/RocketChat/Rocket.Chat/node_modules" - - "$HOME/build/RocketChat/Rocket.Chat/.meteor/local" - - "$HOME/build/RocketChat/Rocket.Chat/packages/rocketchat-livechat/.npm" - - "$HOME/build/RocketChat/Rocket.Chat/packages/rocketchat-livechat/.app/node_modules" - - "$HOME/build/RocketChat/Rocket.Chat/packages/rocketchat-livechat/.app/.meteor/local" -before_install: -- if [ ! -e "$HOME/.meteor/meteor" ]; then curl https://install.meteor.com | sed s/--progress-bar/-sL/g | /bin/sh; fi -# Start X Virtual Frame Buffer for headless testing with real browsers -- .scripts/start-xvfb.sh -install: -- export PATH="$HOME/.meteor:$PATH" -before_script: -- if [[ $TRAVIS_TAG ]]; then meteor reset; fi -- echo "replication:" | sudo tee -a /etc/mongod.conf -- |- - echo " replSetName: \"rs0\"" | sudo tee -a /etc/mongod.conf -- sudo service mongod restart -- mkdir /tmp/build -- meteor --version -- travis_retry meteor npm install -- |- - mongo --eval 'rs.initiate({_id:"rs0", members: [{"_id":1, "host":"localhost:27017"}]})' -- meteor npm run lint -- meteor npm run testunit -- travis_retry meteor build --headless /tmp/build -- mkdir /tmp/build-test -- tar -xf /tmp/build/Rocket.Chat.tar.gz -C /tmp/build-test/ -- cd /tmp/build-test/bundle/programs/server -- npm install -- cd - -- mongo --eval 'rs.status()' -- mongo meteor --eval 'db.getCollectionNames()' -script: -- travis_retry npm test -- mongo meteor --eval 'db.dropDatabase()' -- unset MONGO_OPLOG_URL -- travis_retry npm test -before_deploy: -- source ".travis/setartname.sh" -- source ".travis/setdeploydir.sh" -- ".travis/setupsig.sh" -- ".travis/namefiles.sh" -deploy: - - provider: s3 - access_key_id: AKIAIKIA7H7D47KUHYCA - secret_access_key: "$ACCESSKEY" - bucket: download.rocket.chat - skip_cleanup: true - upload_dir: build - local_dir: "$ROCKET_DEPLOY_DIR" - on: - condition: "$TRAVIS_PULL_REQUEST=false" - all_branches: true - # - provider: releases - # api-key: "$GITHUB_TOKEN" - # file_glob: true - # file: build/* - # skip_cleanup: true - # on: - # tags: true - -after_deploy: -- ".travis/docker.sh" -- ".travis/update-releases.sh" -- ".travis/snap.sh" -env: - global: - - DISPLAY=:99.0 - - CXX=g++-4.8 - - secure: HrPOM5sBibYkMcf9aeQThYPCDiXeLkg0Xgv0HvH88/ku/gphDpNEjHNReHZM3cyfm9y3RhHpVdD+Zzy38S2goKyewRzpXJsuyerOYkjND0v3tivhs9CAX8PAUxj1U5zllTyH4bgW2ZwRtNnwnmtIM/JJlnySMpKVDqIZBpbhn3ph9bJ2J+BW3D3Jw8meQ1vCX8szIibyJK/5QX6HG2RBFXJGYoQ8DmR8jQv0aJQvT1Az5DO4yImk8tX4NP95qOc19Jywr1DsbaSBZeJ8lFJAmBpIGx7KAmUVCcxSxfbXGRhs2K4iEYb3rJ/dU6KiyPsKGUG4aYNGgbvcX0ZxX/BZ6ZU9ff0E4IIf43IxoN3ElrOqOFk5msJAXbrJEreINSzDqKOy8NFYtCQ49E2gwzfage4ZXkhFyx3wMPa5bzpr3ncsTceMjMVz03uL781X6NLuCkUmXv+n8K2MNhJU9Xinpdx1GRJm+0lXJspNNJ1ruHeJtls4epj4bmCwKmmZbFKPXqa5e8xVcMIkwt1LMiHduhE+WgKNHdOMhXrCcTxF62ybLlsHXmyLLJeNjTeKS8QG2XSoonClDAz/1R41I1DsMPblcgz9uvYCf7UtyftbhJ83bnJeEmOYQiwijLG0+QMq+B2+mmZan3Z7Hl7O53dnwuLxz7EO7EhQhY+CqHVgc6s= - - MONGO_OPLOG_URL: "mongodb://localhost:27017/local" - - MONGO_URL: "mongodb://localhost:27017/meteor" - - TEST_MODE: "true" diff --git a/.travis/docker.sh b/.travis/docker.sh deleted file mode 100755 index 29a7b1b0d8d..00000000000 --- a/.travis/docker.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -set -x -set -euvo pipefail -IFS=$'\n\t' - -CURL_URL="https://registry.hub.docker.com/u/rocketchat/rocket.chat/trigger/$PUSHTOKEN/" - -if [[ $TRAVIS_TAG ]] - then - CURL_DATA='{"source_type":"Tag","source_name":"'"$TRAVIS_TAG"'"}'; -else - CURL_DATA='{"source_type":"Branch","source_name":"'"$TRAVIS_BRANCH"'"}'; -fi - -curl -H "Content-Type: application/json" --data "$CURL_DATA" -X POST "$CURL_URL" diff --git a/.travis/namefiles.sh b/.travis/namefiles.sh deleted file mode 100755 index 4b497de93bf..00000000000 --- a/.travis/namefiles.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -x -set -euvo pipefail -IFS=$'\n\t' - -FILENAME="$ROCKET_DEPLOY_DIR/rocket.chat-$ARTIFACT_NAME.tgz"; - -ln -s /tmp/build/Rocket.Chat.tar.gz "$FILENAME" -gpg --armor --detach-sign "$FILENAME" diff --git a/.travis/setartname.sh b/.travis/setartname.sh deleted file mode 100755 index 38253aac315..00000000000 --- a/.travis/setartname.sh +++ /dev/null @@ -1,6 +0,0 @@ -if [[ $TRAVIS_TAG ]] - then - export ARTIFACT_NAME="$(meteor npm run version --silent)" -else - export ARTIFACT_NAME="$(meteor npm run version --silent).$TRAVIS_BUILD_NUMBER" -fi diff --git a/.travis/setdeploydir.sh b/.travis/setdeploydir.sh deleted file mode 100755 index 2c49e4a7027..00000000000 --- a/.travis/setdeploydir.sh +++ /dev/null @@ -1,2 +0,0 @@ -export ROCKET_DEPLOY_DIR="/tmp/deploy" -mkdir -p $ROCKET_DEPLOY_DIR diff --git a/.travis/setupsig.sh b/.travis/setupsig.sh deleted file mode 100755 index c5c424635d0..00000000000 --- a/.travis/setupsig.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -x -set -euvo pipefail -IFS=$'\n\t' - -cp .travis/sign.key.gpg /tmp -gpg --yes --batch --passphrase=$mypass /tmp/sign.key.gpg -gpg --allow-secret-key-import --import /tmp/sign.key -rm /tmp/sign.key diff --git a/.travis/sign.key.gpg b/.travis/sign.key.gpg deleted file mode 100644 index 488e275998d505474fd6a93c263b4931885d7d00..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5117 zcmVn>(*BrtSEM&sK?(j_8)%Q}kOP!Q#a*ys4&dDr+%)U1{~(%kAlO289lN-4-EE*!EVEY7;(4My9XcSTvuwYo zy0S@~xo(NJSD7oYnJBg|F@8lIi(8KnEyRy2FU^k*Yop9`DEKZ{4Na3{ElPJ~`)+tX zGKak59}L;U%meaDMf9t@cp$NzSX^d?$+n=lS&&4FD3!w)WMdq({#Rw|ZFnMh;#ff% zF^GS+dif10i}(^`C@;sl`EgwH*2|m~;E10O$(M@aKKO;keJyy$ksfNTZ!L2hIQcGCt4lH z>&(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-VlXI`uYILaz@g6z!%b!P1<{bFv9wdPEWV} zAF9xF`!@7Cxtw34>COxZ5L~X!T0l{MFq%&Jg#(y&lPn7%pFvH$q}!M04J0)7VZaE*#By-+I?xn^E>=SF2z92wjpN7g zW!VQ#{-_O&JedEQf8PdZ76G`xmW||-O@cpHbliBXL_TgYP&lPet7pk5f*bb*Uy!pLH5rmI9crecD`e|I_gt>q;>FuYvc z&`x#7h=MX-p*>crH|R}b&d7pk#$y)B%nGX}6q7DZ+xD>5AIR7hnIgZ=b7xIF>P?3@ z>fKj1=$2p49`^8UkLCn_0-cCn(qb4l?Wr^Cd6BJ|+>ArNf~V`fgnpv?Q``sswVC$+mn|rsW+Du#m7o{u|*5Yb$ay8 z-ETg9M8PRZWZayNZ3<5s^}n{LQX)!Tf*osV1qf;UhBiwO*X!=4`Nj+>yDCZw(O+^F zij8QF#>y@f(ph!cfE0l>*MzAtsC=u~^sNgeUOA^iB2)9Sm*sfvzUlG`VvzX-w60qU z4G<@)fD^P1lTM%WwJWD{aU$atM=fvpR>=8A0|CX*#oG`Z`7uIEaOrGWnmU_~8IrsF zlvzFtV_DwA5qdtw2@C1R20hY)MKnW4V?c%eP&Tzc-9YTR{Ni$f1v|3-zad=gtz`)9 zA_*c$Ru3&|i1L<5sftyu+m_BDVy~fDA@9V*Z_`6Xl(EZ=K!K?r*IzvT_GLu*UV7(} zBqIr4lS0^!prXu#C1HKm>ZIfI1jQkPgJn zc+{>xeAEMWbji1oco!`gGdXqNB)ApPN3TVDP#99n!Z^6Z9KrJ+npAk;D0LOTjXL~R z)Y}qui8+8Yc3?A^szY0|W}2&4u1EtGC}}FgF5dIGx#hYhV>{&4Sk_kvSK%w*zIkYe z(i)Gd*pslHxSn_UL1C-%n<#H>Tg_kfpdI0DAbQh&8SQ_myL ~/.ssh/known_hosts - -git config user.name "CI Bot" -git config user.email "rocketchat.buildmaster@git.launchpad.net" - -# Determine the channel to push snap to. -if [[ $TRAVIS_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+ ]]; then - CHANNEL=candidate - RC_VERSION=$TRAVIS_TAG -elif [[ $TRAVIS_TAG ]]; then - CHANNEL=stable - RC_VERSION=$TRAVIS_TAG -else - CHANNEL=edge - RC_VERSION=3.0.0-develop -fi - -echo "Preparing to trigger a snap release for $CHANNEL channel" - -cd $PWD/.snapcraft - -# Decrypt key -openssl aes-256-cbc -K $encrypted_f5c8ae370556_key -iv $encrypted_f5c8ae370556_iv -in launchpadkey.enc -out launchpadkey -d - -# Change permissions -chmod 0600 launchpadkey - -# We need some meta data so it'll actually commit. This could be useful to have for debugging later. -echo "Tag: $TRAVIS_TAG \r\nBranch: $TRAVIS_BRANCH\r\nBuild: $TRAVIS_BUILD_NUMBER\r\nCommit: $TRAVIS_COMMIT" > buildinfo - -# Clone launchpad repo for the channel down. -GIT_SSH_COMMAND="ssh -i launchpadkey" git clone -b $CHANNEL git+ssh://rocket.chat.buildmaster@git.launchpad.net/rocket.chat launchpad - -# Rarely will change, but just incase we copy it all -cp -r resources buildinfo launchpad/ -sed s/#{RC_VERSION}/$RC_VERSION/ snapcraft.yaml > launchpad/snapcraft.yaml - -cd launchpad -git add resources snapcraft.yaml buildinfo - -# Another place where basic meta data will live for at a glance info -git commit -m "Travis Build: $TRAVIS_BUILD_NUMBER Travis Commit: $TRAVIS_COMMIT" - -# Push up up to the branch of choice. -GIT_SSH_COMMAND="ssh -i ../launchpadkey" git push origin $CHANNEL - -# Clean up -cd .. -rm -rf launchpadkey launchpad diff --git a/.travis/update-releases.sh b/.travis/update-releases.sh deleted file mode 100755 index 658000b9b8a..00000000000 --- a/.travis/update-releases.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -x -set -euvo pipefail -IFS=$'\n\t' - -CURL_URL="https://rocket.chat/releases/update" - -curl -X POST "$CURL_URL" diff --git a/package.json b/package.json index 62b1dc30849..ba1e24feb72 100644 --- a/package.json +++ b/package.json @@ -268,7 +268,6 @@ "houston": { "updateFiles": [ "package.json", - ".travis/snap.sh", ".circleci/snap.sh", ".circleci/update-releases.sh", ".docker/Dockerfile", diff --git a/packages/rocketchat-livechat/plugin/build-livechat.js b/packages/rocketchat-livechat/plugin/build-livechat.js index cae2c077b28..a7fa062d64c 100644 --- a/packages/rocketchat-livechat/plugin/build-livechat.js +++ b/packages/rocketchat-livechat/plugin/build-livechat.js @@ -7,11 +7,7 @@ import UglifyJS from 'uglify-js'; const livechatSource = path.resolve('packages', 'rocketchat-livechat', 'assets', 'rocket-livechat.js'); const livechatTarget = path.resolve('packages', 'rocketchat-livechat', 'assets', 'rocketchat-livechat.min.js'); -if (process.env.CIRCLE_PR_NUMBER) { - fs.writeFileSync(livechatTarget, fs.readFileSync(livechatSource)); -} else { - fs.writeFileSync(livechatTarget, UglifyJS.minify(livechatSource).code); -} +fs.writeFileSync(livechatTarget, UglifyJS.minify(livechatSource).code); const packagePath = path.join(path.resolve('.'), 'packages', 'rocketchat-livechat'); const pluginPath = path.join(packagePath, 'plugin'); diff --git a/packages/rocketchat-version/plugin/compile-version.js b/packages/rocketchat-version/plugin/compile-version.js index 450b611f607..285de9c971d 100644 --- a/packages/rocketchat-version/plugin/compile-version.js +++ b/packages/rocketchat-version/plugin/compile-version.js @@ -26,14 +26,6 @@ class VersionCompiler { cpus: os.cpus().length, }; - if (process.env.TRAVIS_BUILD_NUMBER) { - output.travis = { - buildNumber: process.env.TRAVIS_BUILD_NUMBER, - branch: process.env.TRAVIS_BRANCH, - tag: process.env.TRAVIS_TAG, - }; - } - exec('git log --pretty=format:\'%H%n%ad%n%an%n%s\' -n 1', function(err, result) { if (err == null) { result = result.split('\n');