Skip to content

Update Travis CI Scripts #2804

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

Merged
merged 1 commit into from
May 11, 2017
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 .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ after_success:
- mkdir s3-publish
- cp nativescript*.tgz s3-publish/nativescript.tgz
before_deploy:
- node .travis/add-publishConfig.js
- node .travis/add-publishConfig.js $TRAVIS_BRANCH
deploy:
- provider: s3
bucket: nativescript-ci
Expand Down
15 changes: 8 additions & 7 deletions .travis/add-publishConfig.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env node

var fsModule = require('fs');
var fsModule = require("fs");

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

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

Expand All @@ -14,11 +14,12 @@ if (!packageDef.publishConfig) {
packageDef.publishConfig = {};
}

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

var newContent = JSON.stringify(packageDef, null, ' ');
var newContent = JSON.stringify(packageDef, null, " ");
fsModule.writeFileSync(path, newContent, fileOptions);