Skip to content

Commit

Permalink
Merge branch 'develop' into issue13808
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosSpessatto committed May 17, 2019
2 parents 95b7f59 + 3278d91 commit fb36bf4
Show file tree
Hide file tree
Showing 1,571 changed files with 29,740 additions and 12,051 deletions.
155 changes: 64 additions & 91 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,59 +33,54 @@ test-configure-replicaset: &test-configure-replicaset
mongo --eval 'rs.initiate({_id:"rs0", members: [{"_id":1, "host":"localhost:27017"}]})'
mongo --eval 'rs.status()'
test-restore-npm-cache: &test-restore-npm-cache
keys:
- node-modules-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum "package.json" }}

test-save-npm-cache: &test-save-npm-cache
key: node-modules-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum "package.json" }}
paths:
- ./node_modules

test-docker-image: &test-docker-image
circleci/node:8.11-stretch-browsers

test: &test
test-with-oplog: &test-with-oplog
<<: *defaults
environment: &test-environment
environment:
TEST_MODE: "true"
MONGO_URL: mongodb://localhost:27017/rocketchat


test-with-oplog: &test-with-oplog
<<: *test
environment:
<<: *test-environment
MONGO_OPLOG_URL: mongodb://localhost:27017/local

steps:
- attach_workspace: *attach_workspace
- checkout
- run: *test-install-dependencies
- run: *test-configure-replicaset
- restore_cache: *test-restore-npm-cache
- run: *test-npm-install
- run: *test-run
- save_cache: *test-save-npm-cache
- store_artifacts: *test-store_artifacts

test-without-oplog: &test-without-oplog
<<: *test
steps:
- attach_workspace: *attach_workspace
- checkout
- run: *test-install-dependencies
- run: *test-npm-install
- run: *test-run
- store_artifacts: *test-store_artifacts


version: 2
jobs:
build:
<<: *defaults
docker:
- image: circleci/node:8.11-stretch
- image: mongo:3.2

steps:
- checkout

# - restore_cache:
# keys:
# - node-modules-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum "package.json" }}
- restore_cache:
keys:
- node-modules-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum "package.json" }}

# - restore_cache:
# keys:
# - meteor-{{ checksum ".circleci/config.yml" }}-{{ checksum ".meteor/release" }}
- restore_cache:
keys:
- meteor-{{ checksum ".circleci/config.yml" }}-{{ checksum ".meteor/release" }}

- run:
name: Install Meteor
Expand Down Expand Up @@ -123,6 +118,9 @@ jobs:
# rm -rf node_modules
# rm -f package-lock.json
meteor npm install
cd packages/rocketchat-livechat/.app
meteor npm install
cd -
- run:
name: Lint
Expand All @@ -132,27 +130,36 @@ jobs:
- run:
name: Unit Test
command: |
meteor npm run testunit
MONGO_URL=mongodb://localhost:27017 meteor npm run testunit
# - restore_cache:
# keys:
# - meteor-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum ".meteor/versions" }}
- restore_cache:
keys:
- meteor-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum ".meteor/versions" }}

# - restore_cache:
# keys:
# - livechat-meteor-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum "packages/rocketchat-livechat/app/.meteor/versions" }}
- restore_cache:
keys:
- livechat-meteor-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum "packages/rocketchat-livechat/.app/.meteor/versions" }}

# - restore_cache:
# keys:
# - livechat-node-modules-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum "packages/rocketchat-livechat/app/package.json" }}
- restore_cache:
keys:
- livechat-node-modules-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum "packages/rocketchat-livechat/.app/package.json" }}

- run:
name: Build Rocket.Chat
environment:
TOOL_NODE_FLAGS: --max_old_space_size=3072
command: |
if [[ $CIRCLE_TAG ]]; then meteor reset; fi
meteor build --server-only --directory /tmp/build-test
if [[ $CIRCLE_TAG ]] || [[ $CIRCLE_BRANCH == 'develop' ]]; then
meteor reset;
fi
export CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-${CIRCLE_PULL_REQUEST##*/}}"
if [[ -z $CIRCLE_PR_NUMBER ]]; then
meteor build --server-only --directory /tmp/build-test
else
export METEOR_PROFILE=1000
meteor build --server-only --directory --debug /tmp/build-test
fi;
- run:
name: Prepare build
Expand All @@ -163,30 +170,30 @@ jobs:
cd /tmp/build-test/bundle/programs/server
npm install
# - save_cache:
# key: node-modules-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum "package.json" }}
# paths:
# - ./node_modules
- save_cache:
key: node-modules-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum "package.json" }}
paths:
- ./node_modules

# - save_cache:
# key: meteor-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum ".meteor/versions" }}
# paths:
# - ./.meteor/local
- save_cache:
key: meteor-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum ".meteor/versions" }}
paths:
- ./.meteor/local

# - save_cache:
# key: livechat-node-modules-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum "packages/rocketchat-livechat/app/package.json" }}
# paths:
# - ./packages/rocketchat-livechat/app/node_modules
- save_cache:
key: livechat-node-modules-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum "packages/rocketchat-livechat/.app/package.json" }}
paths:
- ./packages/rocketchat-livechat/app/node_modules

# - save_cache:
# key: livechat-meteor-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum "packages/rocketchat-livechat/app/.meteor/versions" }}
# paths:
# - ./packages/rocketchat-livechat/app/.meteor/local
- save_cache:
key: livechat-meteor-cache-{{ checksum ".circleci/config.yml" }}-{{ checksum "packages/rocketchat-livechat/.app/.meteor/versions" }}
paths:
- ./packages/rocketchat-livechat/app/.meteor/local

# - save_cache:
# key: meteor-{{ checksum ".circleci/config.yml" }}-{{ checksum ".meteor/release" }}
# paths:
# - ~/.meteor
- save_cache:
key: meteor-{{ checksum ".circleci/config.yml" }}-{{ checksum ".meteor/release" }}
paths:
- ~/.meteor

- persist_to_workspace:
root: /tmp/
Expand Down Expand Up @@ -226,32 +233,6 @@ jobs:
- image: mongo:4.0
command: [mongod, --noprealloc, --smallfiles, --replSet=rs0]


test-without-oplog-mongo-3-2:
<<: *test-without-oplog
docker:
- image: *test-docker-image
- image: mongo:3.2

test-without-oplog-mongo-3-4:
<<: *test-without-oplog
docker:
- image: *test-docker-image
- image: mongo:3.4

test-without-oplog-mongo-3-6:
<<: *test-without-oplog
docker:
- image: *test-docker-image
- image: mongo:3.6

test-without-oplog-mongo-4-0:
<<: *test-without-oplog
docker:
- image: *test-docker-image
- image: mongo:4.0


deploy:
<<: *defaults
docker:
Expand Down Expand Up @@ -427,20 +408,12 @@ workflows:
only: /^[0-9]+\.[0-9]+\.[0-9]+(?:-(?:rc|beta)\.[0-9]+)?$/
- test-with-oplog-mongo-3-6: *test-mongo-no-pr
- test-with-oplog-mongo-4-0: *test-mongo
- test-without-oplog-mongo-3-2: *test-mongo-no-pr
- test-without-oplog-mongo-3-4: *test-mongo-no-pr
- test-without-oplog-mongo-3-6: *test-mongo-no-pr
- test-without-oplog-mongo-4-0: *test-mongo-no-pr
- deploy:
requires:
- test-with-oplog-mongo-3-2
- test-with-oplog-mongo-3-4
- test-with-oplog-mongo-3-6
- test-with-oplog-mongo-4-0
- test-without-oplog-mongo-3-2
- test-without-oplog-mongo-3-4
- test-without-oplog-mongo-3-6
- test-without-oplog-mongo-4-0
filters:
branches:
only: develop
Expand Down
4 changes: 2 additions & 2 deletions .docker-mongo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ ADD entrypoint.sh /app/bundle/
MAINTAINER buildmaster@rocket.chat

RUN set -x \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 \
&& echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.6 main" | tee /etc/apt/sources.list.d/mongodb-org-3.6.list \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4 \
&& echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 main" | tee /etc/apt/sources.list.d/mongodb-org-4.0.list \
&& apt-get update \
&& apt-get install -y --force-yes pwgen mongodb-org \
&& echo "mongodb-org hold" | dpkg --set-selections \
Expand Down
20 changes: 0 additions & 20 deletions .docker/Dockerfile.local

This file was deleted.

2 changes: 1 addition & 1 deletion .docker/Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM registry.access.redhat.com/rhscl/nodejs-8-rhel7

ENV RC_VERSION 1.0.0-develop
ENV RC_VERSION 1.1.0-develop

MAINTAINER buildmaster@rocket.chat

Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ public/livechat/
!.scripts
!packages/rocketchat-livechat/.app
public/pdf.worker.min.js
imports/client/
Loading

0 comments on commit fb36bf4

Please sign in to comment.