Skip to content

Commit e7722ce

Browse files
vchimevvchimev
vchimev
authored and
vchimev
committed
Update Travis CI Scripts
Fix publish to S3
1 parent e50a7fc commit e7722ce

File tree

2 files changed

+35
-37
lines changed

2 files changed

+35
-37
lines changed

.travis.yml

+27-26
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ env:
33
- DATE=$(date +%Y-%m-%d)
44
- PACKAGE_VERSION=$DATE-$TRAVIS_BUILD_NUMBER
55
- NATIVESCRIPT_SKIP_POSTINSTALL_TASKS=1
6+
- secure: dPOuoYB5u46avjLOuEYbkypB90TO7Yh9FktbnpMA4EZo0x7t/ANq5u6QKQsmcpqM+THPvwJswJKP24HZg5+p03pW/b60HTC+6gK7bzWjCYQVLv3r7l1sZ9U9UTjWY27c0p67ggejNALPOywsvdD3ZgL+xnN5I0e2jJlmM+ZapoU=
67
language: node_js
78
node_js:
89
- '6'
@@ -16,8 +17,8 @@ before_script:
1617
- npm install grunt
1718
- node_modules/.bin/grunt enableScripts:false
1819
- grunt rebuild
19-
- ./bin/nativescript error-reporting disable # force ~/.local dir creation -- some tests rely on it
20-
- ./bin/nativescript usage-reporting disable
20+
- "./bin/nativescript error-reporting disable"
21+
- "./bin/nativescript usage-reporting disable"
2122
- npm test
2223
- node_modules/.bin/grunt enableScripts:true
2324
script:
@@ -30,27 +31,27 @@ after_success:
3031
before_deploy:
3132
- node .travis/add-publishConfig.js $TRAVIS_BRANCH
3233
deploy:
33-
- provider: s3
34-
bucket: nativescript-ci
35-
access_key_id: AKIAIYSWYOZRFLVKPCTQ
36-
secret_access_key:
37-
secure: THGlblH9XdRcTQMc3jm4kpwCB3myl8MGB3v9XjB5ObK4gqxUxuPi6e158LEG9Dgb730MGEYtaAjc9OneH59WAjQOrdcf3GXiGKOiCYzGYZLqVE4pjNDuxHaVGOj7mso4TzMinMCaDSQajTvadCfVmXqgT6p9eSXkiV3V2d2DN6c=
38-
skip_cleanup: true
39-
local-dir: s3-publish
40-
upload-dir: build_result
41-
on:
42-
branch: master
43-
- provider: npm
44-
skip_cleanup: true
45-
46-
on:
47-
branch: master
48-
api_key:
49-
secure: KzzsvF3eA3j4gRQa8tO//+XWNSR3XiX8Sa18o3PyKyG9/cBZ6PQ3Te74cNS1C3ZiLUOgs5dWA6/TmRVPci4XjvFaWo/B6e2fuVSl5H94Od99bkeBHJsbLSEkLN4ClV/YbGuyKgA5Q2yIFt6p2EJjL90RjbbIk7I4YuyG2Mo3j0Q=
50-
- provider: npm
51-
skip_cleanup: true
52-
53-
on:
54-
branch: release
55-
api_key:
56-
secure: KzzsvF3eA3j4gRQa8tO//+XWNSR3XiX8Sa18o3PyKyG9/cBZ6PQ3Te74cNS1C3ZiLUOgs5dWA6/TmRVPci4XjvFaWo/B6e2fuVSl5H94Od99bkeBHJsbLSEkLN4ClV/YbGuyKgA5Q2yIFt6p2EJjL90RjbbIk7I4YuyG2Mo3j0Q=
34+
- provider: s3
35+
bucket: nativescript-ci
36+
access_key_id: AKIAJEB5WNURKRJVFE4A
37+
secret_access_key:
38+
secure: THGlblH9XdRcTQMc3jm4kpwCB3myl8MGB3v9XjB5ObK4gqxUxuPi6e158LEG9Dgb730MGEYtaAjc9OneH59WAjQOrdcf3GXiGKOiCYzGYZLqVE4pjNDuxHaVGOj7mso4TzMinMCaDSQajTvadCfVmXqgT6p9eSXkiV3V2d2DN6c=
39+
skip_cleanup: true
40+
local-dir: s3-publish
41+
upload-dir: build_result
42+
on:
43+
branch: master
44+
- provider: npm
45+
skip_cleanup: true
46+
47+
on:
48+
branch: master
49+
api_key:
50+
secure: KzzsvF3eA3j4gRQa8tO//+XWNSR3XiX8Sa18o3PyKyG9/cBZ6PQ3Te74cNS1C3ZiLUOgs5dWA6/TmRVPci4XjvFaWo/B6e2fuVSl5H94Od99bkeBHJsbLSEkLN4ClV/YbGuyKgA5Q2yIFt6p2EJjL90RjbbIk7I4YuyG2Mo3j0Q=
51+
- provider: npm
52+
skip_cleanup: true
53+
54+
on:
55+
branch: release
56+
api_key:
57+
secure: KzzsvF3eA3j4gRQa8tO//+XWNSR3XiX8Sa18o3PyKyG9/cBZ6PQ3Te74cNS1C3ZiLUOgs5dWA6/TmRVPci4XjvFaWo/B6e2fuVSl5H94Od99bkeBHJsbLSEkLN4ClV/YbGuyKgA5Q2yIFt6p2EJjL90RjbbIk7I4YuyG2Mo3j0Q=

.travis/add-publishConfig.js

+8-11
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
#!/usr/bin/env node
22

3-
var fsModule = require("fs");
3+
const tag = "next";
4+
const fsModule = require("fs");
5+
const path = "./package.json";
6+
const fileOptions = {encoding: "utf-8"};
7+
const content = fsModule.readFileSync(path, fileOptions);
48

5-
// Adds a publishConfig section to the package.json file
6-
// and sets a tag to it
7-
8-
var path = "./package.json";
9-
var fileOptions = {encoding: "utf-8"};
10-
var content = fsModule.readFileSync(path, fileOptions);
11-
12-
var packageDef = JSON.parse(content);
9+
const packageDef = JSON.parse(content);
1310
if (!packageDef.publishConfig) {
1411
packageDef.publishConfig = {};
1512
}
1613

17-
var branch = process.argv[2];
14+
const branch = process.argv[2];
1815
if (!branch) {
1916
console.log("Please pass the branch name as an argument!");
2017
process.exit(1);
2118
}
2219
packageDef.publishConfig.tag = branch === "release" ? "rc" : "next";
2320

24-
var newContent = JSON.stringify(packageDef, null, " ");
21+
const newContent = JSON.stringify(packageDef, null, " ");
2522
fsModule.writeFileSync(path, newContent, fileOptions);

0 commit comments

Comments
 (0)