diff --git a/.docker/latest/Dockerfile b/.docker/Dockerfile similarity index 97% rename from .docker/latest/Dockerfile rename to .docker/Dockerfile index 77b309ea5830..0b3e327ed403 100644 --- a/.docker/latest/Dockerfile +++ b/.docker/Dockerfile @@ -1,6 +1,6 @@ FROM rocketchat/base:4 -ENV RC_VERSION latest +ENV RC_VERSION 0.56.0-rc.2 MAINTAINER buildmaster@rocket.chat diff --git a/.docker/develop/Dockerfile b/.docker/develop/Dockerfile deleted file mode 100644 index b14fd89de4d4..000000000000 --- a/.docker/develop/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -FROM rocketchat/base:4 - -ENV RC_VERSION develop - -MAINTAINER buildmaster@rocket.chat - -RUN set -x \ - && curl -SLf "https://rocket.chat/releases/${RC_VERSION}/download" -o rocket.chat.tgz \ - && curl -SLf "https://rocket.chat/releases/${RC_VERSION}/asc" -o rocket.chat.tgz.asc \ - && mkdir /app \ - && gpg --verify rocket.chat.tgz.asc \ - && mkdir -p /app \ - && tar -zxf rocket.chat.tgz -C /app \ - && rm rocket.chat.tgz rocket.chat.tgz.asc \ - && cd /app/bundle/programs/server \ - && npm install \ - && npm cache clear \ - && chown -R rocketchat:rocketchat /app - -USER rocketchat - -VOLUME /app/uploads - -WORKDIR /app/bundle - -# needs a mongoinstance - defaults to container linking with alias 'mongo' -ENV DEPLOY_METHOD=docker \ - NODE_ENV=production \ - MONGO_URL=mongodb://mongo:27017/rocketchat \ - MONGO_OPLOG_URL=mongodb://mongo:27017/local \ - HOME=/tmp \ - PORT=3000 \ - ROOT_URL=http://localhost:3000 \ - Accounts_AvatarStorePath=/app/uploads - -EXPOSE 3000 - -CMD ["node", "main.js"] diff --git a/.docker/release-candidate/Dockerfile b/.docker/release-candidate/Dockerfile deleted file mode 100644 index 192b8e95c019..000000000000 --- a/.docker/release-candidate/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM rocketchat/base:4 - -ENV RC_VERSION release-candidate - -MAINTAINER buildmaster@rocket.chat - -RUN set -x \ - && curl -SLf "https://rocket.chat/releases/${RC_VERSION}/download" -o rocket.chat.tgz \ - && curl -SLf "https://rocket.chat/releases/${RC_VERSION}/asc" -o rocket.chat.tgz.asc \ - && mkdir /app \ - && gpg --verify rocket.chat.tgz.asc \ - && mkdir -p /app \ - && tar -zxf rocket.chat.tgz -C /app \ - && rm rocket.chat.tgz rocket.chat.tgz.asc \ - && cd /app/bundle/programs/server \ - && npm install \ - && npm cache clear \ - && chown -R rocketchat:rocketchat /app - -USER rocketchat - -VOLUME /app/uploads - -WORKDIR /app/bundle - -# needs a mongoinstance - defaults to container linking with alias 'mongo' -ENV DEPLOY_METHOD=docker \ - NODE_ENV=production \ - MONGO_URL=mongodb://mongo:27017/rocketchat \ - HOME=/tmp \ - PORT=3000 \ - ROOT_URL=http://localhost:3000 \ - Accounts_AvatarStorePath=/app/uploads - -EXPOSE 3000 - -CMD ["node", "main.js"] diff --git a/.scripts/set-version.js b/.scripts/set-version.js new file mode 100644 index 000000000000..d5534f7a3f68 --- /dev/null +++ b/.scripts/set-version.js @@ -0,0 +1,48 @@ +/* eslint object-shorthand: 0, prefer-template: 0 */ + +const path = require('path'); +const fs = require('fs'); +let pkgJson = {}; + +try { + pkgJson = require(path.resolve( + process.cwd(), + './package.json' + )); +} catch (err) { + console.error('no root package.json found'); +} + +const readline = require('readline'); + +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout +}); + +const files = [ + './package.json', + './.sandstorm/sandstorm-pkgdef.capnp', + './.travis/snap.sh', + './.docker/Dockerfile.sh', + './packages/rocketchat-lib/rocketchat.info' +]; + +console.log('Current version:', pkgJson.version); +rl.question('New version: ', function(version) { + rl.close(); + + version = version.trim(); + + if (version === '') { + return; + } + + console.log('Updating files to version ' + version); + + files.forEach(function(file) { + const data = fs.readFileSync(file, 'utf8'); + + fs.writeFileSync(file, data.replace(pkgJson.version, version), 'utf8'); + }); +}); diff --git a/.scripts/version.js b/.scripts/version.js index a99cf2799468..c4aeb68acd0f 100644 --- a/.scripts/version.js +++ b/.scripts/version.js @@ -1,8 +1,7 @@ /* eslint object-shorthand: 0, prefer-template: 0 */ const path = require('path'); -const fs = require('fs'); -let pkgJson = {}; +var pkgJson = {}; try { pkgJson = require(path.resolve( @@ -13,35 +12,4 @@ try { console.error('no root package.json found'); } -const readline = require('readline'); - -const rl = readline.createInterface({ - input: process.stdin, - output: process.stdout -}); - -const files = [ - './package.json', - './.sandstorm/sandstorm-pkgdef.capnp', - './.travis/snap.sh', - './packages/rocketchat-lib/rocketchat.info' -]; - -console.log('Current version:', pkgJson.version); -rl.question('New version: ', function(version) { - rl.close(); - - version = version.trim(); - - if (version === '') { - return; - } - - console.log('Updating files to version ' + version); - - files.forEach(function(file) { - const data = fs.readFileSync(file, 'utf8'); - - fs.writeFileSync(file, data.replace(pkgJson.version, version), 'utf8'); - }); -}); +console.log(pkgJson.version); diff --git a/.travis.yml b/.travis.yml index 09bfc03484ba..3192c2d4b139 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ services: branches: only: - develop - - release-candidate - "/^\\d+\\.\\d+\\.\\d+(-rc\\.\\d+)?$/" git: depth: 1 diff --git a/.travis/setartname.sh b/.travis/setartname.sh index cf8f9a150c9a..349280f82055 100755 --- a/.travis/setartname.sh +++ b/.travis/setartname.sh @@ -1,6 +1 @@ -if [[ $TRAVIS_TAG ]] - then - export ARTIFACT_NAME="$TRAVIS_TAG"; -else - export ARTIFACT_NAME="$TRAVIS_BRANCH"; -fi +export ARTIFACT_NAME="$(meteor npm run version --silent)" diff --git a/package.json b/package.json index af484c18f11c..8723c50536db 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,8 @@ "chimp-test": "chimp tests/chimp-config.js", "postinstall": "cd packages/rocketchat-katex && npm i", "version": "node .scripts/version.js", - "release": "npm run version && conventional-changelog --config .github/changelog.js -i HISTORY.md -s" + "set-version": "node .scripts/set-version.js", + "release": "npm run set-version && conventional-changelog --config .github/changelog.js -i HISTORY.md -s" }, "license": "MIT", "repository": {