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 488e275998d..00000000000 Binary files a/.travis/sign.key.gpg and /dev/null differ diff --git a/.travis/snap.sh b/.travis/snap.sh deleted file mode 100755 index 99e5cc613e1..00000000000 --- a/.travis/snap.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -set -euvo pipefail -IFS=$'\n\t' - -# Add launchpad to known hosts -ssh-keyscan -t rsa -H git.launchpad.net > ~/.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');