Skip to content

Commit

Permalink
Update Travis CI Scripts (#2915)
Browse files Browse the repository at this point in the history
Fix publish to S3
  • Loading branch information
Vasil Chimev authored Jun 30, 2017
1 parent e50a7fc commit 895e0bf
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 37 deletions.
52 changes: 26 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ before_script:
- npm install grunt
- node_modules/.bin/grunt enableScripts:false
- grunt rebuild
- ./bin/nativescript error-reporting disable # force ~/.local dir creation -- some tests rely on it
- ./bin/nativescript usage-reporting disable
- "./bin/nativescript error-reporting disable"
- "./bin/nativescript usage-reporting disable"
- npm test
- node_modules/.bin/grunt enableScripts:true
script:
Expand All @@ -30,27 +30,27 @@ after_success:
before_deploy:
- node .travis/add-publishConfig.js $TRAVIS_BRANCH
deploy:
- provider: s3
bucket: nativescript-ci
access_key_id: AKIAIYSWYOZRFLVKPCTQ
secret_access_key:
secure: THGlblH9XdRcTQMc3jm4kpwCB3myl8MGB3v9XjB5ObK4gqxUxuPi6e158LEG9Dgb730MGEYtaAjc9OneH59WAjQOrdcf3GXiGKOiCYzGYZLqVE4pjNDuxHaVGOj7mso4TzMinMCaDSQajTvadCfVmXqgT6p9eSXkiV3V2d2DN6c=
skip_cleanup: true
local-dir: s3-publish
upload-dir: build_result
on:
branch: master
- provider: npm
skip_cleanup: true
email: nativescript@telerik.com
on:
branch: master
api_key:
secure: KzzsvF3eA3j4gRQa8tO//+XWNSR3XiX8Sa18o3PyKyG9/cBZ6PQ3Te74cNS1C3ZiLUOgs5dWA6/TmRVPci4XjvFaWo/B6e2fuVSl5H94Od99bkeBHJsbLSEkLN4ClV/YbGuyKgA5Q2yIFt6p2EJjL90RjbbIk7I4YuyG2Mo3j0Q=
- provider: npm
skip_cleanup: true
email: nativescript@telerik.com
on:
branch: release
api_key:
secure: KzzsvF3eA3j4gRQa8tO//+XWNSR3XiX8Sa18o3PyKyG9/cBZ6PQ3Te74cNS1C3ZiLUOgs5dWA6/TmRVPci4XjvFaWo/B6e2fuVSl5H94Od99bkeBHJsbLSEkLN4ClV/YbGuyKgA5Q2yIFt6p2EJjL90RjbbIk7I4YuyG2Mo3j0Q=
- provider: s3
access_key_id: AKIAJL6X6724CSX64X3Q
secret_access_key:
secure: a0T/2S+/rkRJqEotWPAr1VELA3k5TGyRw6VmXgBQnkirc6H0Pfu0P2DY8iriO7pnTPDCPAskdBCuk6t+RYw/OCrGDzFPApnAQ7t3tksKPr2bGYqh2HVqbFKZyEbNjzwsgxn7cmLPo936ZTHP2muQItEI3o9Zh9EZ5XHtv0Maw0k=
bucket: nativescript-ci
skip_cleanup: true
local-dir: s3-publish
upload-dir: build_result
on:
branch: master
- provider: npm
skip_cleanup: true
email: nativescript@telerik.com
on:
branch: master
api_key:
secure: KzzsvF3eA3j4gRQa8tO//+XWNSR3XiX8Sa18o3PyKyG9/cBZ6PQ3Te74cNS1C3ZiLUOgs5dWA6/TmRVPci4XjvFaWo/B6e2fuVSl5H94Od99bkeBHJsbLSEkLN4ClV/YbGuyKgA5Q2yIFt6p2EJjL90RjbbIk7I4YuyG2Mo3j0Q=
- provider: npm
skip_cleanup: true
email: nativescript@telerik.com
on:
branch: release
api_key:
secure: KzzsvF3eA3j4gRQa8tO//+XWNSR3XiX8Sa18o3PyKyG9/cBZ6PQ3Te74cNS1C3ZiLUOgs5dWA6/TmRVPci4XjvFaWo/B6e2fuVSl5H94Od99bkeBHJsbLSEkLN4ClV/YbGuyKgA5Q2yIFt6p2EJjL90RjbbIk7I4YuyG2Mo3j0Q=
18 changes: 7 additions & 11 deletions .travis/add-publishConfig.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
#!/usr/bin/env node

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

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

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

var packageDef = JSON.parse(content);
const packageDef = JSON.parse(content);
if (!packageDef.publishConfig) {
packageDef.publishConfig = {};
}

var branch = process.argv[2];
const 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, " ");
const newContent = JSON.stringify(packageDef, null, " ");
fsModule.writeFileSync(path, newContent, fileOptions);

0 comments on commit 895e0bf

Please sign in to comment.