diff --git a/.snapcraft/candidate/snapcraft.yaml b/.snapcraft/candidate/snapcraft.yaml new file mode 100644 index 000000000000..83ef7f72292b --- /dev/null +++ b/.snapcraft/candidate/snapcraft.yaml @@ -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 diff --git a/.snapcraft/edge/snapcraft.yaml b/.snapcraft/edge/snapcraft.yaml index 432d07b0eba7..052dcf364f49 100644 --- a/.snapcraft/edge/snapcraft.yaml +++ b/.snapcraft/edge/snapcraft.yaml @@ -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 diff --git a/.snapcraft/stable/snapcraft.yaml b/.snapcraft/stable/snapcraft.yaml index 9c6c3cb65763..5a6ca3e8b947 100644 --- a/.snapcraft/stable/snapcraft.yaml +++ b/.snapcraft/stable/snapcraft.yaml @@ -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 diff --git a/.travis.yml b/.travis.yml index 9fed9bbe3480..09bfc03484ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/.travis/snap.sh b/.travis/snap.sh index 10e8ec20be55..9897cedd0fdd 100755 --- a/.travis/snap.sh +++ b/.travis/snap.sh @@ -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" @@ -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