Skip to content

Commit 304c914

Browse files
vchimevvchimev
vchimev
authored and
vchimev
committed
Update Travis CI Scripts
1 parent dbb8210 commit 304c914

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ after_success:
2424
- mkdir s3-publish
2525
- cp nativescript*.tgz s3-publish/nativescript.tgz
2626
before_deploy:
27-
- node .travis/add-publishConfig.js
27+
- node .travis/add-publishConfig.js $TRAVIS_BRANCH
2828
deploy:
2929
- provider: s3
3030
bucket: nativescript-ci
@@ -47,6 +47,6 @@ deploy:
4747
skip_cleanup: true
4848
email: nativescript@telerik.com
4949
on:
50-
branch: release
50+
branch: vchimev-travis
5151
api_key:
5252
secure: KzzsvF3eA3j4gRQa8tO//+XWNSR3XiX8Sa18o3PyKyG9/cBZ6PQ3Te74cNS1C3ZiLUOgs5dWA6/TmRVPci4XjvFaWo/B6e2fuVSl5H94Od99bkeBHJsbLSEkLN4ClV/YbGuyKgA5Q2yIFt6p2EJjL90RjbbIk7I4YuyG2Mo3j0Q=

.travis/add-publishConfig.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env node
22

3-
var fsModule = require('fs');
3+
var fsModule = require("fs");
44

55
// Adds a publishConfig section to the package.json file
66
// and sets a tag to it
77

8-
var path = './package.json';
8+
var path = "./package.json";
99
var fileOptions = {encoding: "utf-8"};
1010
var content = fsModule.readFileSync(path, fileOptions);
1111

@@ -14,11 +14,12 @@ if (!packageDef.publishConfig) {
1414
packageDef.publishConfig = {};
1515
}
1616

17-
if ($TRAVIS_BRANCH === 'release') {
18-
packageDef.publishConfig.tag = 'rc';
19-
} else {
20-
packageDef.publishConfig.tag = 'next';
17+
var branch = process.argv[2];
18+
if (!branch) {
19+
console.log("Please pass the branch name as an argument!");
20+
process.exit(1);
2121
}
22+
packageDef.publishConfig.tag = branch === "release" ? "rc" : "next";
2223

23-
var newContent = JSON.stringify(packageDef, null, ' ');
24+
var newContent = JSON.stringify(packageDef, null, " ");
2425
fsModule.writeFileSync(path, newContent, fileOptions);

0 commit comments

Comments
 (0)