Skip to content

Commit

Permalink
Merge pull request #6614 from RocketChat/release-candidate-snap
Browse files Browse the repository at this point in the history
Add candidate snap channel
  • Loading branch information
engelgabriel authored Apr 6, 2017
2 parents 4789c38 + 3c9f536 commit e58d9c9
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 6 deletions.
100 changes: 100 additions & 0 deletions .snapcraft/candidate/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#
# Easiest way to work with this file, from an updated Ubuntu 16.04 LTS image
# 1. create a non-root user with sudo priv and perform following steps as non-root
# 2. `sudo apt-get update`
# 3. `sudo apt-get install snapcraft python build-essential`
# 4. `snapcraft stage`
# 5. `snapcraft snap`

name: rocketchat-server
version: #{RC_VERSION}
summary: Rocket.Chat server
description: Have your own Slack like online chat, built with Meteor. https://rocket.chat/
confinement: strict
apps:
rocketchat-server:
command: startRocketChat
daemon: simple
plugs: [network, network-bind]
rocketchat-mongo:
command: startmongo
daemon: simple
plugs: [network, network-bind]
rocketchat-caddy:
command: env LC_ALL=C caddy -conf=$SNAP_DATA/Caddyfile -host=localhost:8080
daemon: simple
plugs: [network, network-bind]
backupdb:
command: env LC_ALL=c rcbackup
plugs: [network]
initcaddy:
command: env LC_ALL=c initcaddy
parts:
node:
plugin: nodejs
node-engine: 4.8.1
node-packages:
- promise
- fibers
- underscore
- source-map-support
- semver
build-packages:
# For fibers
- python
- build-essential
- nodejs
organize:
lib/node_modules: node_modules
rocketchat-server:
plugin: dump
after: [mongodb]
source: https://rocket.chat/releases/release-candidate/download
source-type: tar
stage-packages:
- graphicsmagick
stage:
- programs
- main.js
- .node_version.txt
- usr
- lib
snap:
- programs
- main.js
- .node_version.txt
- usr
- lib
mongodb:
source: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-3.2.7.tgz
plugin: dump
stage-packages:
- libssl1.0.0
stage:
- usr
- bin
- lib
snap:
- usr
- bin
- lib
scripts:
plugin: dump
source: resources/
organize:
rcbackup: bin/rcbackup
startmongo: bin/startmongo
startRocketChat: bin/startRocketChat
initreplset.js: bin/initreplset.js
Caddyfile: bin/Caddyfile
initcaddy: bin/initcaddy
snap:
- bin
caddy:
plugin: go
go-importpath: github.com/mholt/caddy
source: https://github.com/mholt/caddy
source-type: git
source-commit: 53e117802fedd5915eeb32907873d8786a4b2936
snap:
- bin/caddy
2 changes: 1 addition & 1 deletion .snapcraft/edge/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# 5. `snapcraft snap`

name: rocketchat-server
version: 0.55.0-develop
version: #{RC_VERSION}
summary: Rocket.Chat server
description: Have your own Slack like online chat, built with Meteor. https://rocket.chat/
confinement: strict
Expand Down
2 changes: 1 addition & 1 deletion .snapcraft/stable/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# 5. `snapcraft snap`

name: rocketchat-server
version: 0.55.0-develop
version: #{RC_VERSION}
summary: Rocket.Chat server
description: Have your own Slack like online chat, built with Meteor. https://rocket.chat/
confinement: strict
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ deploy:
after_deploy:
- ".travis/docker.sh"
- ".travis/update-releases.sh"
#- ".travis/snap.sh"
- ".travis/snap.sh"
env:
global:
- DISPLAY=:99.0
Expand Down
12 changes: 9 additions & 3 deletions .travis/snap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ 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 ]]
then
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=0.55.0-develop
fi

echo "Preparing to trigger a snap release for $CHANNEL channel"
Expand All @@ -33,7 +37,9 @@ echo "Tag: $TRAVIS_TAG \r\nBranch: $TRAVIS_BRANCH\r\nBuild: $TRAVIS_BUILD_NUMBER
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 $CHANNEL/snapcraft.yaml buildinfo launchpad/
cp -r resources buildinfo launchpad/
sed /#{RC_VERSION}/$RC_VERSION/ $CHANNEL/snapcraft.yaml > launchpad/snapcraft.yaml

cd launchpad
git add resources snapcraft.yaml buildinfo

Expand Down

0 comments on commit e58d9c9

Please sign in to comment.