From 3103bc540db4714b46bebe07e4139562f946f26f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 10:38:14 +0100 Subject: [PATCH 01/19] circle-submodule --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5cc557870300..6e5b7d7c2fe7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,7 +59,7 @@ jobs: - run: name: Install submodules command: | - git submodule init && git submodule updated + git submodule init && git submodule update - run: name: Lint From 60caafaf52c01b369d5122371779f11fade6e9e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 11:57:07 +0100 Subject: [PATCH 02/19] harmonize deployment for Travis and CircleCi --- .circleci/config.yml | 8 ++---- .scripts/check-deploy.sh | 25 ---------------- .scripts/deploy-assistify-chat.sh | 47 +++++++++++++++++++++++++++++++ .scripts/seperateTesting.sh | 6 ++-- .travis.yml | 44 ++++++++++++++--------------- 5 files changed, 75 insertions(+), 55 deletions(-) delete mode 100755 .scripts/check-deploy.sh create mode 100755 .scripts/deploy-assistify-chat.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 6e5b7d7c2fe7..7bee0b671d97 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -176,8 +176,7 @@ jobs: - run: name: Run Tests command: | - for i in $(seq 1 5); do npm test && s=0 && break || s=$? && sleep 1; done; (exit $s) - + npm test - store_artifacts: path: .screenshots/ @@ -205,7 +204,7 @@ jobs: - run: name: Run Tests command: | - for i in $(seq 1 5); do npm test && s=0 && break || s=$? && sleep 1; done; (exit $s) + npm test - store_artifacts: path: .screenshots/ @@ -237,8 +236,7 @@ jobs: name: Publish assets command: | if [[ $CIRCLE_PULL_REQUESTS ]]; then exit 0; fi; - - bash .scripts/check-deploy.sh + bash .scripts/deploy-assistify-chat.sh workflows: version: 2 diff --git a/.scripts/check-deploy.sh b/.scripts/check-deploy.sh deleted file mode 100755 index 41d44283f886..000000000000 --- a/.scripts/check-deploy.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash - -pip install --user --upgrade awscli -export PATH=$PATH:$HOME/.local/bin - -mkdir -p ~/.aws - -cat > ~/.aws/credentials << EOL -[default] -aws_access_key_id = ${AWS_ACCESS_KEY} -aws_secret_access_key = ${AWS_SECRET_KEY} -EOL - -TARGET_ENVIRONMENT=undefined -if [ ${TRAVIS_BRANCH} = master ] - then - TARGET_ENVIRONMENT=production -else - if [[ ${TRAVIS_BRANCH} == develop ]] || [[ $TRAVIS_BRANCH == "release/"* ]] - then - TARGET_ENVIRONMENT=test - fi -fi - -aws s3api put-object-tagging --region ${AWS_REGION} --bucket ${AWS_BUCKET} --key rocketchat/${BUILD_FILE} --tagging "{ \"TagSet\": [ { \"Key\": \"environment\", \"Value\": \"${TARGET_ENVIRONMENT}\" }, { \"Key\": \"nodejs_version\", \"Value\": \"${NODEJS_VERSION}\" }, { \"Key\": \"nodejs_checksum\", \"Value\": \"${NODEJS_CHECKSUM}\" }, { \"Key\": \"assets\", \"Value\": \"${ASSETS_URL}\" } ] }" diff --git a/.scripts/deploy-assistify-chat.sh b/.scripts/deploy-assistify-chat.sh new file mode 100755 index 000000000000..7e80604512f8 --- /dev/null +++ b/.scripts/deploy-assistify-chat.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +# Install AWS-CLI - if it's there, this will be done quickly +pip install --user --upgrade awscli +export PATH=$PATH:$HOME/.local/bin # add user-installed aws-cli to path + +# we want this script to work with Travis and CircleCi, so abstract the Environment variables +export BRANCH=${TRAVIS_BRANCH}${CIRCLE_BRANCH} +export COMMIT=${TRAVIS_COMMIT}${CIRCLE_SHA1} +export BUILD_FILE=Assistify_Chat_${BRANCH/\//_}_${COMMIT:1}.tar.gz + +export NODEJS_VERSION="8.9.4" +export NODEJS_CHECKSUM="21fb4690e349f82d708ae766def01d7fec1b085ce1f5ab30d9bda8ee126ca8fc" + +# in Circle-Ci, the containers already got a aws-config, so if it exsists, assume it's ok +if [ ! -f ~/.aws/credentials ] + then + mkdir -p ~/.aws + + cat > ~/.aws/credentials << EOL + [default] + aws_access_key_id = ${AWS_ACCESS_KEY} + aws_secret_access_key = ${AWS_SECRET_KEY} + EOL +fi + +# store the build artifact +mv /tmp/build/Rocket.Chat.tar.gz /tmp/build/${BUILD_FILE} +aws s3 cp ${BUILD_FILE} s3://${AWS_BUCKET}/rocketchat/ --region ${AWS_REGION} --acl bucket-owner-full-control + +# For dedicated branches, we tag the artifacts - this should actually be based on git tags +TARGET_ENVIRONMENT=undefined +if [ ${BRANCH} = master ] + then + TARGET_ENVIRONMENT=production + + # publish a new "latest"-file in order to make new clients be created with it + aws s3 cp ${BUILD_FILE} s3://${AWS_BUCKET}/rocketchat/rocket-chat-latest.tar.tgz --region ${AWS_REGION} --acl bucket-owner-full-control + +else + if [[ ${BRANCH} == develop ]] || [[ $BRANCH == "release/"* ]] + then + TARGET_ENVIRONMENT=test + fi +fi + +aws s3api put-object-tagging --region ${AWS_REGION} --bucket ${AWS_BUCKET} --key rocketchat/${BUILD_FILE} --tagging "{ \"TagSet\": [ { \"Key\": \"environment\", \"Value\": \"${TARGET_ENVIRONMENT}\" }, { \"Key\": \"nodejs_version\", \"Value\": \"${NODEJS_VERSION}\" }, { \"Key\": \"nodejs_checksum\", \"Value\": \"${NODEJS_CHECKSUM}\" }, { \"Key\": \"assets\", \"Value\": \"${ASSETS_URL}\" } ] }" diff --git a/.scripts/seperateTesting.sh b/.scripts/seperateTesting.sh index eb8d2fa06412..bdac8d58d997 100755 --- a/.scripts/seperateTesting.sh +++ b/.scripts/seperateTesting.sh @@ -2,10 +2,10 @@ tmpPath=tests/end-to-end/temporary_staged_test rm -rf $tmpPath mkdir -p $tmpPath -[ -z "$retry_test" ] && retry_test=1 +[ -z "$RETRY_TEST" ] && RETRY_TEST=1 for file in tests/end-to-end/*/*.js; do failed=1 - for i in `seq 1 $retry_test`; do + for i in `seq 1 $RETRY_TEST`; do echo '-------------- '$i' try ---------------' set -x cp $file $tmpPath @@ -20,4 +20,4 @@ for file in tests/end-to-end/*/*.js; do exit 1 fi rm $tmpPath/${file##*/} -done \ No newline at end of file +done diff --git a/.travis.yml b/.travis.yml index 081317d627db..3229a59e629d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -79,29 +79,29 @@ before_deploy: - mv /tmp/build/Rocket.Chat.tar.gz /tmp/build/rocketchat/${BUILD_FILE} deploy: -- provider: s3 - access_key_id: $AWS_ACCESS_KEY - secret_access_key: $AWS_SECRET_KEY - local_dir: /tmp/build/ - skip_cleanup: true - on: &1 - repo: assistify/Rocket.Chat - branch: develop - bucket: $AWS_BUCKET - region: $AWS_REGION -- provider: s3 - access_key_id: $AWS_ACCESS_KEY - secret_access_key: $AWS_SECRET_KEY - local_dir: /tmp/build/ - skip_cleanup: true - on: &2 - repo: assistify/Rocket.Chat - branch: master - bucket: $AWS_BUCKET - region: $AWS_REGION +# - provider: s3 +# access_key_id: $AWS_ACCESS_KEY +# secret_access_key: $AWS_SECRET_KEY +# local_dir: /tmp/build/ +# skip_cleanup: true +# on: &1 +# repo: assistify/Rocket.Chat +# branch: develop +# bucket: $AWS_BUCKET +# region: $AWS_REGION +# - provider: s3 +# access_key_id: $AWS_ACCESS_KEY +# secret_access_key: $AWS_SECRET_KEY +# local_dir: /tmp/build/ +# skip_cleanup: true +# on: &2 +# repo: assistify/Rocket.Chat +# branch: master +# bucket: $AWS_BUCKET +# region: $AWS_REGION -after_deploy: -- $TRAVIS_BUILD_DIR/.scripts/check-deploy.sh +# after_deploy: +- $TRAVIS_BUILD_DIR/.scripts/deploy-assistify-chat.sh env: global: From 2258b45863fa3f23e3bf7eabb6132651e76b89d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 13:35:27 +0100 Subject: [PATCH 03/19] don't rely on meteor warpper for testing --- .scripts/continueTesting.sh | 4 ++-- .scripts/seperateTesting.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.scripts/continueTesting.sh b/.scripts/continueTesting.sh index e03cca19add7..fef2966eec2d 100755 --- a/.scripts/continueTesting.sh +++ b/.scripts/continueTesting.sh @@ -19,7 +19,7 @@ for file in ${array[@]:$j}; do echo '-------------- '$i' try ---------------' set -x cp $file $tmpPath - CHIMP_PATH=$tmpPath meteor npm run chimp-path + CHIMP_PATH=$tmpPath npm run chimp-path failed=$? set +x if [ $failed -eq 0 ]; then @@ -30,4 +30,4 @@ for file in ${array[@]:$j}; do exit 1 fi rm $tmpPath/${file##*/} -done \ No newline at end of file +done diff --git a/.scripts/seperateTesting.sh b/.scripts/seperateTesting.sh index bdac8d58d997..5d5de5e474d4 100755 --- a/.scripts/seperateTesting.sh +++ b/.scripts/seperateTesting.sh @@ -9,7 +9,7 @@ for file in tests/end-to-end/*/*.js; do echo '-------------- '$i' try ---------------' set -x cp $file $tmpPath - CHIMP_PATH=$tmpPath meteor npm run chimp-path + CHIMP_PATH=$tmpPath npm run chimp-path failed=$? set +x if [ $failed -eq 0 ]; then From 5c6eb08244a4d674a5672f0784bf6948838f25ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 14:37:12 +0100 Subject: [PATCH 04/19] run Smarti in CircleCI --- .circleci/config.yml | 52 +++++++++++++++++++ .scripts/continueTesting.sh | 4 +- .scripts/deploy-assistify-chat.sh | 6 ++- ...{dockerfile => dockerfile-smarti-with-nlp} | 2 +- .scripts/seperateTesting.sh | 4 +- .scripts/smarti.sh | 6 +-- .scripts/start.js | 2 +- 7 files changed, 65 insertions(+), 11 deletions(-) rename .scripts/{dockerfile => dockerfile-smarti-with-nlp} (90%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7bee0b671d97..d32211b9d4c0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -176,6 +176,7 @@ jobs: - run: name: Run Tests command: | + rm -rf ./tests/end-to-end/ui_smarti # Smarti tests run separately npm test - store_artifacts: path: .screenshots/ @@ -204,6 +205,57 @@ jobs: - run: name: Run Tests command: | + rm -rf ./tests/end-to-end/ui_smarti # Smarti tests run separately + npm test + + - store_artifacts: + path: .screenshots/ + + test-smarti: + <<: *defaults + docker: + - image: circleci/node:8-browsers + - image: circleci/mongo:3.4 + + environment: + TEST_MODE: "true" + MONGO_URL: mongodb://localhost:27017/testsmarti + + steps: + - attach_workspace: + at: /tmp + + - checkout + + # Enable remote docker host for temporary images (see https://circleci.com/docs/2.0/building-docker-images/ + - setup_remote_docker: + docker_layer_caching: true + + - run: + name: Install Docker client + command: | + set -x + VER="17.11.0-ce" + curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz + tar -xz -C /tmp -f /tmp/docker-$VER.tgz + mv /tmp/docker/* /usr/bin + + - run: + name: Build and start Smarti + command: | + docker pull assisitfy/smarti:0.7.0 + docker build -t smarti-with-stanfordnlp - < .scripts/dockerfile-smarti-with-nlp + docker run -d --name smarti --net=host smarti-with-stanfordnlp --security.config.mongo.admin-password=admin --spring.data.mongodb.uri=mongodb://localhost/smarti + + - run: + name: NPM install + command: | + npm install + + - run: + name: Run Tests + command: | + shopt -s extglob && rm -rf ./tests/end-to-end/!(ui_smarti) # remove all non-Smarti-tests npm test - store_artifacts: diff --git a/.scripts/continueTesting.sh b/.scripts/continueTesting.sh index fef2966eec2d..19a0e174e56a 100755 --- a/.scripts/continueTesting.sh +++ b/.scripts/continueTesting.sh @@ -2,7 +2,7 @@ tmpPath=tests/end-to-end/temporary_staged_test stopfile=`find ${tmpPath} -type f | head -1` echo 'Last stop at:' $stopfile -[ -z "$retry_test" ] && retry_test=1 +[ -z "$RETRY_TESTS" ] && RETRY_TESTS=1 stopfile=`find ${tmpPath} -type f | head -1` array=(`find tests/end-to-end/*/*.js -type f`) @@ -15,7 +15,7 @@ rm -rf $tmpPath mkdir -p $tmpPath for file in ${array[@]:$j}; do failed=1 - for i in `seq 1 $retry_test`; do + for i in `seq 1 $RETRY_TESTS`; do echo '-------------- '$i' try ---------------' set -x cp $file $tmpPath diff --git a/.scripts/deploy-assistify-chat.sh b/.scripts/deploy-assistify-chat.sh index 7e80604512f8..939981b82618 100755 --- a/.scripts/deploy-assistify-chat.sh +++ b/.scripts/deploy-assistify-chat.sh @@ -1,12 +1,16 @@ #!/usr/bin/env bash +function parse_git_hash(){ + git rev-parse --short HEAD 2> /dev/null | sed "s/\(.*\)/\1/" +} + # Install AWS-CLI - if it's there, this will be done quickly pip install --user --upgrade awscli export PATH=$PATH:$HOME/.local/bin # add user-installed aws-cli to path # we want this script to work with Travis and CircleCi, so abstract the Environment variables export BRANCH=${TRAVIS_BRANCH}${CIRCLE_BRANCH} -export COMMIT=${TRAVIS_COMMIT}${CIRCLE_SHA1} +export COMMIT= $(parse_git_hash) # ${TRAVIS_COMMIT}${CIRCLE_SHA1} will return the long sha which is too long to be readable export BUILD_FILE=Assistify_Chat_${BRANCH/\//_}_${COMMIT:1}.tar.gz export NODEJS_VERSION="8.9.4" diff --git a/.scripts/dockerfile b/.scripts/dockerfile-smarti-with-nlp similarity index 90% rename from .scripts/dockerfile rename to .scripts/dockerfile-smarti-with-nlp index 24cb0e863bb6..402e5956a439 100644 --- a/.scripts/dockerfile +++ b/.scripts/dockerfile-smarti-with-nlp @@ -1,4 +1,4 @@ -FROM assisitfy/smarti:0.7.0-RC1 +FROM assisitfy/smarti:0.7.0 USER root ADD [\ "https://repo1.maven.org/maven2/edu/stanford/nlp/stanford-corenlp/3.8.0/stanford-corenlp-3.8.0.jar", \ diff --git a/.scripts/seperateTesting.sh b/.scripts/seperateTesting.sh index 5d5de5e474d4..47e477bb5465 100755 --- a/.scripts/seperateTesting.sh +++ b/.scripts/seperateTesting.sh @@ -2,10 +2,10 @@ tmpPath=tests/end-to-end/temporary_staged_test rm -rf $tmpPath mkdir -p $tmpPath -[ -z "$RETRY_TEST" ] && RETRY_TEST=1 +[ -z "$RETRY_TESTS" ] && RETRY_TESTS=1 for file in tests/end-to-end/*/*.js; do failed=1 - for i in `seq 1 $RETRY_TEST`; do + for i in `seq 1 $RETRY_TESTS`; do echo '-------------- '$i' try ---------------' set -x cp $file $tmpPath diff --git a/.scripts/smarti.sh b/.scripts/smarti.sh index 44836aa2dc15..026f9bdf87e4 100755 --- a/.scripts/smarti.sh +++ b/.scripts/smarti.sh @@ -1,10 +1,8 @@ #!/usr/bin/env bash -docker pull assisitfy/smarti:0.7.0-RC1 +docker pull assisitfy/smarti:0.7.0 -#docker run -d --net=host assisitfy/smarti:0.6.1 - -docker build -t smarti-with-stanfordnlp - < .scripts/dockerfile +docker build -t smarti-with-stanfordnlp - < .scripts/dockerfile-smarti-with-nlp docker run -d --name smarti --net=host smarti-with-stanfordnlp --security.config.mongo.admin-password=admin --spring.data.mongodb.uri=mongodb://localhost/smarti diff --git a/.scripts/start.js b/.scripts/start.js index f42b9c437923..dcdead1247f1 100644 --- a/.scripts/start.js +++ b/.scripts/start.js @@ -67,7 +67,7 @@ function startApp(callback) { function startChimp() { startProcess({ name: 'Chimp', - command: 'retry_test=3 .scripts/seperateTesting.sh', + command: 'RETRY_TESTS=3 .scripts/seperateTesting.sh', options: { env: Object.assign({}, process.env, { NODE_PATH: process.env.NODE_PATH + From bc836bf7a344663b4f607c50794950deab50be79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 14:56:39 +0100 Subject: [PATCH 05/19] parallelize Smarti --- .circleci/config.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index d32211b9d4c0..65cc407a13d4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -310,10 +310,17 @@ workflows: filters: tags: only: /^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$/ + - test-smarti: + requires: + - build + filters: + tags: + only: /^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$/ - deploy: requires: - test-with-oplog - test-without-oplog + - test-smarti filters: branches: only: develop From f94f9d49a6b0288dc0ab58e7899ccdd9f3cc86c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 15:28:31 +0100 Subject: [PATCH 06/19] change docker version --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 65cc407a13d4..4133cf345c47 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -235,7 +235,7 @@ jobs: name: Install Docker client command: | set -x - VER="17.11.0-ce" + VER="17.12.1-ce" curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz tar -xz -C /tmp -f /tmp/docker-$VER.tgz mv /tmp/docker/* /usr/bin From 7bf4c9e42c8b8a582268c9ac397f85bfb422764b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 15:48:51 +0100 Subject: [PATCH 07/19] try remote docker --- .circleci/config.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4133cf345c47..a3b28425c006 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -231,15 +231,6 @@ jobs: - setup_remote_docker: docker_layer_caching: true - - run: - name: Install Docker client - command: | - set -x - VER="17.12.1-ce" - curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz - tar -xz -C /tmp -f /tmp/docker-$VER.tgz - mv /tmp/docker/* /usr/bin - - run: name: Build and start Smarti command: | From 4c6ef159358315ad66531c99c57aeb8947e31556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 18:53:17 +0100 Subject: [PATCH 08/19] revert to assistify-smarti-0.7.0-RC --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a3b28425c006..406e479a3144 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -234,7 +234,7 @@ jobs: - run: name: Build and start Smarti command: | - docker pull assisitfy/smarti:0.7.0 + docker pull assisitfy/smarti:0.7.0-RC1 docker build -t smarti-with-stanfordnlp - < .scripts/dockerfile-smarti-with-nlp docker run -d --name smarti --net=host smarti-with-stanfordnlp --security.config.mongo.admin-password=admin --spring.data.mongodb.uri=mongodb://localhost/smarti From 883777e04f3f6c4299d967d95c9564bc5b27dcbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 19:30:20 +0100 Subject: [PATCH 09/19] revert to docker-smarti-rc in all the places --- .scripts/dockerfile-smarti-with-nlp | 2 +- .scripts/smarti.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.scripts/dockerfile-smarti-with-nlp b/.scripts/dockerfile-smarti-with-nlp index 402e5956a439..24cb0e863bb6 100644 --- a/.scripts/dockerfile-smarti-with-nlp +++ b/.scripts/dockerfile-smarti-with-nlp @@ -1,4 +1,4 @@ -FROM assisitfy/smarti:0.7.0 +FROM assisitfy/smarti:0.7.0-RC1 USER root ADD [\ "https://repo1.maven.org/maven2/edu/stanford/nlp/stanford-corenlp/3.8.0/stanford-corenlp-3.8.0.jar", \ diff --git a/.scripts/smarti.sh b/.scripts/smarti.sh index 026f9bdf87e4..86e007d569f5 100755 --- a/.scripts/smarti.sh +++ b/.scripts/smarti.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -docker pull assisitfy/smarti:0.7.0 +docker pull assisitfy/smarti:0.7.0-RC1 docker build -t smarti-with-stanfordnlp - < .scripts/dockerfile-smarti-with-nlp From bac6da373a9960292aa9d1708c25f24dc22bdf86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 19:35:16 +0100 Subject: [PATCH 10/19] test only smarti-docker --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 406e479a3144..1c38070ccdaf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -302,15 +302,15 @@ workflows: tags: only: /^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$/ - test-smarti: - requires: - - build + # requires: + # - build filters: tags: only: /^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$/ - deploy: requires: - - test-with-oplog - - test-without-oplog + # - test-with-oplog + # - test-without-oplog - test-smarti filters: branches: From a3118f42ee2c6e34cc44d044826f83f2094d336b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 19:39:03 +0100 Subject: [PATCH 11/19] 2 --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1c38070ccdaf..2c2e1967a2c3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -238,10 +238,10 @@ jobs: docker build -t smarti-with-stanfordnlp - < .scripts/dockerfile-smarti-with-nlp docker run -d --name smarti --net=host smarti-with-stanfordnlp --security.config.mongo.admin-password=admin --spring.data.mongodb.uri=mongodb://localhost/smarti - - run: - name: NPM install - command: | - npm install + # - run: + # name: NPM install + # command: | + # npm install - run: name: Run Tests From f30aa1fae66568d2b8764351eb81443601629145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 19:44:03 +0100 Subject: [PATCH 12/19] 3 --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2c2e1967a2c3..268abc8e262b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -246,7 +246,8 @@ jobs: - run: name: Run Tests command: | - shopt -s extglob && rm -rf ./tests/end-to-end/!(ui_smarti) # remove all non-Smarti-tests + shopt -s extglob + rm -rf ./tests/end-to-end/!(ui_smarti) # remove all non-Smarti-tests npm test - store_artifacts: From e08f2bc1317ba39d209c931f05e48062f29b4bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 19:58:25 +0100 Subject: [PATCH 13/19] use non-nlp-image --- .circleci/config.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 268abc8e262b..3d5d7d27dce5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -216,10 +216,13 @@ jobs: docker: - image: circleci/node:8-browsers - image: circleci/mongo:3.4 + - image: assisitfy/smarti:0.7.0-RC1 environment: TEST_MODE: "true" MONGO_URL: mongodb://localhost:27017/testsmarti + SPRING_DATA_MONGODB_URI: mongodb://localhost:27017/smarti + SECURITY_CONFIG_MONGO_ADMIN-PASSWORD: admin steps: - attach_workspace: @@ -231,13 +234,13 @@ jobs: - setup_remote_docker: docker_layer_caching: true - - run: - name: Build and start Smarti - command: | - docker pull assisitfy/smarti:0.7.0-RC1 - docker build -t smarti-with-stanfordnlp - < .scripts/dockerfile-smarti-with-nlp - docker run -d --name smarti --net=host smarti-with-stanfordnlp --security.config.mongo.admin-password=admin --spring.data.mongodb.uri=mongodb://localhost/smarti - + # - run: + # name: Build and start Smarti + # command: | + # docker pull assisitfy/smarti:0.7.0-RC1 + # docker build -t smarti-with-stanfordnlp - < .scripts/dockerfile-smarti-with-nlp + # docker run -d --name smarti --net=host smarti-with-stanfordnlp --security.config.mongo.admin-password=admin --spring.data.mongodb.uri=mongodb://localhost/smarti +# # - run: # name: NPM install # command: | From f3fd742c0f99ee33962f3cb92f99eb54257b1ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 20:01:01 +0100 Subject: [PATCH 14/19] no remote docker --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3d5d7d27dce5..030467c7eaa8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -231,8 +231,8 @@ jobs: - checkout # Enable remote docker host for temporary images (see https://circleci.com/docs/2.0/building-docker-images/ - - setup_remote_docker: - docker_layer_caching: true + # - setup_remote_docker: + # docker_layer_caching: true # - run: # name: Build and start Smarti From 6aabbba8eb6ea20706d0fcba9cab57a6c84eafa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 20:09:19 +0100 Subject: [PATCH 15/19] Skip Smarti-tests on circle-ci for the moment --- .circleci/config.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 030467c7eaa8..c76e768e9bdb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -306,16 +306,19 @@ workflows: tags: only: /^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$/ - test-smarti: - # requires: - # - build + requires: + - build filters: tags: only: /^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$/ + branches: + only: + - master - deploy: requires: - # - test-with-oplog - # - test-without-oplog - - test-smarti + - test-with-oplog + - test-without-oplog + # - test-smarti filters: branches: only: develop From 1d2de4dc5452be32fe1c57abe618a65ddc44a6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 22:35:12 +0100 Subject: [PATCH 16/19] Try to make "without-oplog" work in circleci --- .circleci/config.yml | 16 +++++++++++++++- .scripts/start.js | 2 +- .travis.yml | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c76e768e9bdb..4b1df46f35d0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -189,7 +189,7 @@ jobs: environment: TEST_MODE: "true" - MONGO_URL: mongodb://localhost:27017/testwithoplog + MONGO_URL: mongodb://localhost:27017/testwithoutplog steps: - attach_workspace: @@ -197,6 +197,20 @@ jobs: - checkout + - run: + name: Install dependencies + command: | + sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 + echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list + sudo apt-get update + sudo apt-get install -y mongodb-org-shell + + - run: + name: Configure Replica Set + command: | + mongo --eval 'rs.initiate({_id:"rs0", members: [{"_id":1, "host":"localhost:27017"}]})' + mongo --eval 'rs.status()' + - run: name: NPM install command: | diff --git a/.scripts/start.js b/.scripts/start.js index dcdead1247f1..0d0089c4767e 100644 --- a/.scripts/start.js +++ b/.scripts/start.js @@ -67,7 +67,7 @@ function startApp(callback) { function startChimp() { startProcess({ name: 'Chimp', - command: 'RETRY_TESTS=3 .scripts/seperateTesting.sh', + command: '.scripts/seperateTesting.sh', options: { env: Object.assign({}, process.env, { NODE_PATH: process.env.NODE_PATH + diff --git a/.travis.yml b/.travis.yml index 3229a59e629d..72d3433df535 100644 --- a/.travis.yml +++ b/.travis.yml @@ -101,7 +101,7 @@ deploy: # region: $AWS_REGION # after_deploy: -- $TRAVIS_BUILD_DIR/.scripts/deploy-assistify-chat.sh + - $TRAVIS_BUILD_DIR/.scripts/deploy-assistify-chat.sh env: global: From 4a5ecb96a0667b534bab2eaa29cfb239d9a6000f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 22:56:33 +0100 Subject: [PATCH 17/19] reduce travis to Smarti-testing --- .circleci/config.yml | 1 + .travis.yml | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4b1df46f35d0..8e41c463f894 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -186,6 +186,7 @@ jobs: docker: - image: circleci/node:8-browsers - image: circleci/mongo:3.4 + command: [mongod, --nojournal, --noprealloc, --smallfiles, --replSet=rs0] environment: TEST_MODE: "true" diff --git a/.travis.yml b/.travis.yml index 72d3433df535..7748980b43c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,17 +68,20 @@ before_script: - mongo --eval 'rs.status()' - mongo meteor --eval 'db.getCollectionNames()' script: +- shopt -s extglob +- rm -rf ./tests/end-to-end/!(ui_smarti) # remove all non-Smarti-tests - if [[ ! $SKIP_TESTS ]]; then npm test; fi + # - mongo meteor --eval 'db.dropDatabase()' # - unset MONGO_OPLOG_URL # - npm test -before_deploy: -- mkdir -p /tmp/build/rocketchat -- export BUILD_FILE=Assistify_Chat_${TRAVIS_BRANCH/\//_}_${TRAVIS_COMMIT:1}.tar.gz -- mv /tmp/build/Rocket.Chat.tar.gz /tmp/build/rocketchat/${BUILD_FILE} +# before_deploy: +# - mkdir -p /tmp/build/rocketchat +# - export BUILD_FILE=Assistify_Chat_${TRAVIS_BRANCH/\//_}_${TRAVIS_COMMIT:1}.tar.gz +# - mv /tmp/build/Rocket.Chat.tar.gz /tmp/build/rocketchat/${BUILD_FILE} -deploy: +# deploy: # - provider: s3 # access_key_id: $AWS_ACCESS_KEY # secret_access_key: $AWS_SECRET_KEY @@ -101,7 +104,7 @@ deploy: # region: $AWS_REGION # after_deploy: - - $TRAVIS_BUILD_DIR/.scripts/deploy-assistify-chat.sh + # - $TRAVIS_BUILD_DIR/.scripts/deploy-assistify-chat.sh env: global: From dc5b831d5d5111e83ec991ad0c4195bb095604ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 23:29:25 +0100 Subject: [PATCH 18/19] Tests without oplog don't start - deactivate for the time being --- .circleci/config.yml | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8e41c463f894..d010cebf4183 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -186,8 +186,7 @@ jobs: docker: - image: circleci/node:8-browsers - image: circleci/mongo:3.4 - command: [mongod, --nojournal, --noprealloc, --smallfiles, --replSet=rs0] - +´ environment: TEST_MODE: "true" MONGO_URL: mongodb://localhost:27017/testwithoutplog @@ -198,20 +197,6 @@ jobs: - checkout - - run: - name: Install dependencies - command: | - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 - echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list - sudo apt-get update - sudo apt-get install -y mongodb-org-shell - - - run: - name: Configure Replica Set - command: | - mongo --eval 'rs.initiate({_id:"rs0", members: [{"_id":1, "host":"localhost:27017"}]})' - mongo --eval 'rs.status()' - - run: name: NPM install command: | @@ -320,6 +305,9 @@ workflows: filters: tags: only: /^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$/ + branches: + only: + - circle-without-oplog - test-smarti: requires: - build @@ -328,15 +316,17 @@ workflows: only: /^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$/ branches: only: - - master + - circle-smarti - deploy: requires: - test-with-oplog - - test-without-oplog + # - test-without-oplog # - test-smarti filters: branches: - only: develop + only: + - develop + - master tags: only: /^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$/ From 071caaceec56eae30b70a9375dd9d4fb6ba10978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20J=C3=A4gle?= Date: Wed, 21 Mar 2018 23:33:38 +0100 Subject: [PATCH 19/19] fix syntax-error --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d010cebf4183..6295f00f6213 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -186,7 +186,7 @@ jobs: docker: - image: circleci/node:8-browsers - image: circleci/mongo:3.4 -´ + environment: TEST_MODE: "true" MONGO_URL: mongodb://localhost:27017/testwithoutplog