Skip to content

Commit

Permalink
Merge branch 'develop' into livechat-desktop-notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Jul 4, 2018
2 parents b411fe4 + 64d969f commit 3c27397
Show file tree
Hide file tree
Showing 42 changed files with 2,651 additions and 577 deletions.
36 changes: 32 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,23 +276,36 @@ jobs:
name: Build Docker image
command: |
cd /tmp/build
cp ~/repo/.docker/Dockerfile .
tar xzf Rocket.Chat.tar.gz
rm Rocket.Chat.tar.gz
export CIRCLE_TAG=${CIRCLE_TAG:=}
if [[ $CIRCLE_TAG ]]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS
echo "Build official Docker image"
cp ~/repo/.docker/Dockerfile .
docker build -t rocketchat/rocket.chat:$CIRCLE_TAG .
docker push rocketchat/rocket.chat:$CIRCLE_TAG
if [[ $CIRCLE_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Build preview Docker image"
cp ~/repo/.docker-mongo/Dockerfile .
cp ~/repo/.docker-mongo/entrypoint.sh .
docker build -t rocketchat/rocket.chat.preview:$CIRCLE_TAG .
docker push rocketchat/rocket.chat.preview:$CIRCLE_TAG
if echo "$CIRCLE_TAG" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$' ; then
docker tag rocketchat/rocket.chat:$CIRCLE_TAG rocketchat/rocket.chat:latest
docker push rocketchat/rocket.chat:latest
else
docker tag rocketchat/rocket.chat.preview:$CIRCLE_TAG rocketchat/rocket.chat.preview:latest
docker push rocketchat/rocket.chat.preview:latest
elif echo "$CIRCLE_TAG" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$' ; then
docker tag rocketchat/rocket.chat:$CIRCLE_TAG rocketchat/rocket.chat:release-candidate
docker push rocketchat/rocket.chat:release-candidate
docker tag rocketchat/rocket.chat.preview:$CIRCLE_TAG rocketchat/rocket.chat.preview:release-candidate
docker push rocketchat/rocket.chat.preview:release-candidate
fi
exit 0
Expand All @@ -301,9 +314,17 @@ jobs:
if [[ $CIRCLE_BRANCH == 'develop' ]]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS
echo "Build official Docker image"
cp ~/repo/.docker/Dockerfile .
docker build -t rocketchat/rocket.chat:develop .
docker push rocketchat/rocket.chat:develop
echo "Build preview Docker image"
cp ~/repo/.docker-mongo/Dockerfile .
cp ~/repo/.docker-mongo/entrypoint.sh .
docker build -t rocketchat/rocket.chat.preview:develop .
docker push rocketchat/rocket.chat.preview:develop
exit 0
fi;
Expand All @@ -330,15 +351,22 @@ jobs:
fi;
cd /tmp/build
cp ~/repo/.docker/Dockerfile .
tar xzf Rocket.Chat.tar.gz
rm Rocket.Chat.tar.gz
docker login -u $DOCKER_USER -p $DOCKER_PASS
echo "Build official Docker image"
cp ~/repo/.docker/Dockerfile .
docker build -t rocketchat/rocket.chat:pr-$CIRCLE_PR_NUMBER .
docker push rocketchat/rocket.chat:pr-$CIRCLE_PR_NUMBER
echo "Build preview Docker image"
cp ~/repo/.docker-mongo/Dockerfile .
cp ~/repo/.docker-mongo/entrypoint.sh .
docker build -t rocketchat/rocket.chat.preview:pr-$CIRCLE_PR_NUMBER .
docker push rocketchat/rocket.chat.preview:pr-$CIRCLE_PR_NUMBER
workflows:
version: 2
build-and-test:
Expand Down
40 changes: 40 additions & 0 deletions .docker-mongo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM rocketchat/base:8

ADD . /app
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-get update \
&& apt-get install -y --force-yes pwgen mongodb-org \
&& echo "mongodb-org hold" | dpkg --set-selections \
&& echo "mongodb-org-server hold" | dpkg --set-selections \
&& echo "mongodb-org-shell hold" | dpkg --set-selections \
&& echo "mongodb-org-mongos hold" | dpkg --set-selections \
&& echo "mongodb-org-tools hold" | dpkg --set-selections \
&& cd /app/bundle/programs/server \
&& npm install \
&& npm cache clear --force \
&& rm -rf /var/lib/apt/lists/*

VOLUME /app/uploads

WORKDIR /app/bundle

# needs a mongoinstance - defaults to container linking with alias 'mongo'
ENV DEPLOY_METHOD=docker-preview \
NODE_ENV=production \
MONGO_URL=mongodb://localhost:27017/rocketchat \
HOME=/tmp \
PORT=3000 \
ROOT_URL=http://localhost:3000 \
Accounts_AvatarStorePath=/app/uploads

EXPOSE 3000

RUN chmod +x /app/bundle/entrypoint.sh

ENTRYPOINT /app/bundle/entrypoint.sh
19 changes: 19 additions & 0 deletions .docker-mongo/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

echo """
██████╗ ██████╗ ██████╗██╗ ██╗███████╗████████╗ ██████╗██╗ ██╗ █████╗ ████████╗ ██████╗ ██████╗ ███████╗██╗ ██╗██╗███████╗██╗ ██╗
██╔══██╗██╔═══██╗██╔════╝██║ ██╔╝██╔════╝╚══██╔══╝██╔════╝██║ ██║██╔══██╗╚══██╔══╝ ██╔══██╗██╔══██╗██╔════╝██║ ██║██║██╔════╝██║ ██║
██████╔╝██║ ██║██║ █████╔╝ █████╗ ██║ ██║ ███████║███████║ ██║ ██████╔╝██████╔╝█████╗ ██║ ██║██║█████╗ ██║ █╗ ██║
██╔══██╗██║ ██║██║ ██╔═██╗ ██╔══╝ ██║ ██║ ██╔══██║██╔══██║ ██║ ██╔═══╝ ██╔══██╗██╔══╝ ╚██╗ ██╔╝██║██╔══╝ ██║███╗██║
██║ ██║╚██████╔╝╚██████╗██║ ██╗███████╗ ██║██╗╚██████╗██║ ██║██║ ██║ ██║ ██║ ██║ ██║███████╗ ╚████╔╝ ██║███████╗╚███╔███╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═╝╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═══╝ ╚═╝╚══════╝ ╚══╝╚══╝
"""

mongod --smallfiles --storageEngine=mmapv1 --fork --config /etc/mongod.conf

until mongo --eval "db" &> /dev/null; do
echo "MongoDB still not ready, sleeping"
sleep 1
done

node main.js
22 changes: 22 additions & 0 deletions .docker-mongo/licenses/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2015-2017 Rocket.Chat Technologies Corp.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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 0.66.0-develop
ENV RC_VERSION 0.67.0-develop

MAINTAINER buildmaster@rocket.chat

Expand Down
Loading

0 comments on commit 3c27397

Please sign in to comment.