Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplifying deploy scripts #1595

Merged
merged 6 commits into from
Dec 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .docker/dockerfiles/develop/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 0E163286C20D07B9787EB

WORKDIR /app

RUN curl -fSL "https://s3.amazonaws.com/rocketchatbuild/develop.rocket.chat-v.latest.tgz" -o rocket.chat.tgz \
RUN curl -fSL "https://s3.amazonaws.com/rocketchatbuild/rocket.chat-develop.tgz" -o rocket.chat.tgz \
&& tar zxvf ./rocket.chat.tgz \
&& rm ./rocket.chat.tgz \
&& cd /app/bundle/programs/server \
Expand Down
2 changes: 1 addition & 1 deletion .docker/dockerfiles/master/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 0E163286C20D07B9787EB

WORKDIR /app

RUN curl -fSL "https://s3.amazonaws.com/rocketchatbuild/master.rocket.chat-v.latest.tgz" -o rocket.chat.tgz \
RUN curl -fSL "https://s3.amazonaws.com/rocketchatbuild/rocket.chat-master.tgz" -o rocket.chat.tgz \
&& tar zxvf ./rocket.chat.tgz \
&& rm ./rocket.chat.tgz \
&& cd /app/bundle/programs/server \
Expand Down
19 changes: 0 additions & 19 deletions .sandstorm/buildrc.sh

This file was deleted.

18 changes: 0 additions & 18 deletions .sandstorm/preprcbuild.sh

This file was deleted.

4 changes: 2 additions & 2 deletions .sandstorm/sandstorm-pkgdef.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const pkgdef :Spk.PackageDefinition = (

appTitle = (defaultText = "Rocket.Chat"),

appVersion = 2, # Increment this for every release.
appVersion = 3, # Increment this for every release.

appMarketingVersion = (defaultText = "0.7.2445"),
appMarketingVersion = (defaultText = "0.8.0"),
# Human-readable representation of appVersion. Should match the way you
# identify versions of your app in documentation and marketing.

Expand Down
62 changes: 32 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,43 @@ branches:
only:
- develop
- master
- even-faster-deploy
node_js:
- '0.12'
cache:
directories:
- ~/.meteor
before_install:
- curl https://install.meteor.com | /bin/sh
- npm install -g npm@'>=2.13.5'
- mkdir -p node_modules
- cd $TRAVIS_BUILD_DIR
- mkdir ../build
- export TAG=$(git describe --abbrev=0 --tags)
- export SANDSTORM_VERSION=$(curl -f "https://install.sandstorm.io/dev?from=0&type=install")
- export PATH=$PATH:/tmp/sandstorm-$SANDSTORM_VERSION/bin
- cd .sandstorm
- ./preprcbuild.sh
install:
- curl https://install.meteor.com | /bin/sh
before_script:
- mkdir /tmp/build
script:
- cd $TRAVIS_BUILD_DIR
- if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then echo "Building PR $TRAVIS_PULL_REQUEST"; meteor build ../build; exit $?; fi
- meteor build ../build
- cp ../build/Rocket.Chat.tar.gz /home/vagrant
- cd .travis
- sh ./namefiles.sh
- cd $TRAVIS_BUILD_DIR/.sandstorm
- ./buildrc.sh
- cd $TRAVIS_BUILD_DIR
- mv rocket.chat.latest.spk ../build
- meteor build /tmp/build
before_deploy:
- mkdir /tmp/deploy
- .travis/namefiles.sh
- .travis/sandstorm.sh
deploy:
provider: s3
access_key_id: "AKIAIKIA7H7D47KUHYCA"
secret_access_key: $ACCESSKEY
bucket: "rocketchatbuild"
skip_cleanup: true
local_dir: ../build
on:
branch:
- develop
- master
- provider: s3
access_key_id: "AKIAIKIA7H7D47KUHYCA"
secret_access_key: $ACCESSKEY
bucket: "rocketchatbuild"
skip_cleanup: true
local_dir: /tmp/deploy
on:
branch:
- develop
- master
- even-faster-deploy
- provider: releases
api_key: "GITHUB OAUTH TOKEN"
file: "FILE TO UPLOAD"
skip_cleanup: true
on:
branch: master
tags: true
after_deploy:
- cd .travis
- ./builddocker.sh
- .travis/docker.sh
2 changes: 1 addition & 1 deletion .travis/builddocker.sh → .travis/docker.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

set -euo pipefail
IFS=$'\n\t'

# TRAVIS_TAG='v0.7'
# TAG="v0.7"
Expand Down
11 changes: 7 additions & 4 deletions .travis/namefiles.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
cd ../../build
FILENAME=rocket.chat-"$TAG.$TRAVIS_BUILD_NUMBER.$TRAVIS_BRANCH".tgz
mv Rocket.Chat.tar.gz "$FILENAME"
ln -s "$FILENAME" "$TRAVIS_BRANCH.rocket.chat-v.latest.tgz"
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'

#cd $TRAVIS_BUILD_DIR
#export TAG=$(git describe --abbrev=0 --tags)
ln -s /tmp/build/Rocket.Chat.tar.gz "/tmp/deploy/rocket.chat-$TRAVIS_BRANCH.tgz"
38 changes: 38 additions & 0 deletions .travis/sandstorm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'

export SANDSTORM_VERSION=$(curl -f "https://install.sandstorm.io/dev?from=0&type=install")
export PATH=$PATH:/tmp/sandstorm-$SANDSTORM_VERSION/bin

cd /tmp
curl https://dl.sandstorm.io/sandstorm-$SANDSTORM_VERSION.tar.xz | tar -xJf -

sudo mkdir -p /opt
sudo chown -R travis /opt
cd /opt
curl https://dl.sandstorm.io/meteor-spk-0.1.8.tar.xz | tar -xJf -
ln -s meteor-spk-0.1.8 meteor-spk
cp -a /bin/bash /opt/meteor-spk/meteor-spk.deps/bin/
cp -a /lib/x86_64-linux-gnu/libncurses.so.* /opt/meteor-spk/meteor-spk.deps/lib/x86_64-linux-gnu/
cp -a /lib/x86_64-linux-gnu/libtinfo.so.* /opt/meteor-spk/meteor-spk.deps/lib/x86_64-linux-gnu/
ln -s $TRAVIS_BUILD_DIR /opt/app

cd /tmp
spk init -p3000 -- nothing
export SANDSTORM_ID="$(grep '\sid =' sandstorm-pkgdef.capnp)"

cd $TRAVIS_BUILD_DIR
export METEOR_WAREHOUSE_DIR="${METEOR_WAREHOUSE_DIR:-$HOME/.meteor}"
export METEOR_DEV_BUNDLE=$(dirname $(readlink -f "$METEOR_WAREHOUSE_DIR/meteor"))/dev_bundle

sudo mkdir -p /home/vagrant
sudo chown -R travis /home/vagrant
tar -zxf /tmp/build/Rocket.Chat.tar.gz --directory /home/vagrant/
cd /home/vagrant/bundle/programs/server && "$METEOR_DEV_BUNDLE/bin/npm" install
cd $TRAVIS_BUILD_DIR/.sandstorm
sed -i "s/\sid = .*/$SANDSTORM_ID/" sandstorm-pkgdef.capnp
mkdir -p /home/vagrant/bundle/opt/app/.sandstorm/
cp /opt/app/.sandstorm/launcher.sh /home/vagrant/bundle/opt/app/.sandstorm/
sed -i "s/\spgp/#pgp/g" sandstorm-pkgdef.capnp
spk pack /tmp/deploy/rocket.chat-$TRAVIS_BRANCH.spk
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ Branch **develop** (Newer but unstable):
## Sandstorm.io
[![Rocket.Chat on Sandstorm.io](https://raw.githubusercontent.com/Sing-Li/bbug/master/images/sandstorm.jpg)](https://apps.sandstorm.io/app/vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0)

_*Grab*_ the latest [Sandstorm SPK](https://s3.amazonaws.com/rocketchatbuild/rocket.chat.latest.spk) for testing on your own server.
_*Grab*_ the latest [Sandstorm SPK](https://s3.amazonaws.com/rocketchatbuild/rocket.chat-develop.spk) for testing on your own server.

## Sloppy.io
Host your docker container at [sloppy.io](http://sloppy.io). Get an account and use the [quickstarter](https://github.com/sloppyio/quickstarters/tree/master/rocketchat)

Expand Down
2 changes: 1 addition & 1 deletion rocketchat.info
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.7.0"
"version": "0.8.0"
}