diff options
author | Molly Lloyd <molly@mapbox.com> | 2017-10-25 09:38:54 -0700 |
---|---|---|
committer | Molly Lloyd <molly@mapbox.com> | 2017-10-26 11:14:25 -0700 |
commit | 8a9d5dba8fc56b08338c0229ecc27caf562b833e (patch) | |
tree | d81405a023917e3bd1a508c7d5dcecdf0a8ac482 | |
parent | 3d020d981b74f22308c254ced4b0fb53cda1d39e (diff) | |
download | qtlocation-mapboxgl-upstream/nightly-node.tar.gz |
try environment varsupstream/nightly-node
-rw-r--r-- | circle.yml | 11 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | platform/node/scripts/modify_remote_path.js | 14 |
3 files changed, 21 insertions, 6 deletions
diff --git a/circle.yml b/circle.yml index a0b560e119..074e3c4511 100644 --- a/circle.yml +++ b/circle.yml @@ -33,7 +33,7 @@ workflows: nightly-node: triggers: - schedule: - cron: "0 18 * * *" # 11am pdt + cron: "0 20 * * *" # 1pm pdt filters: branches: only: @@ -349,11 +349,12 @@ jobs: - *show-ccache-stats - *save-cache - *run-node-tests + - modify: + name: Modify package.json for nightly build + command: node platform/node/scripts/modify_remote_path.js - deploy: - name: Publish nightly build - command: | - DATE_STR=$(date -u +%Y-%m-%d) - ./node_modules/.bin/node-pre-gyp package publish info + name: Deploy nightly build to s3 + command: ./node_modules/.bin/node-pre-gyp package publish info - *upload-render-tests # ------------------------------------------------------------------------------ diff --git a/package.json b/package.json index 38ef2d2256..785533abf4 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "module_name": "mapbox_gl_native", "module_path": "./lib/", "host": "https://mapbox-node-binary.s3.amazonaws.com", - "remote_path": "./{name}/nightly/$DATE_STR", + "remote_path": "./{name}/nightly/{process.env.DATE_STR}", "package_name": "{node_abi}-{platform}-{arch}-{configuration}.tar.gz" } } diff --git a/platform/node/scripts/modify_remote_path.js b/platform/node/scripts/modify_remote_path.js new file mode 100644 index 0000000000..2bd4efce16 --- /dev/null +++ b/platform/node/scripts/modify_remote_path.js @@ -0,0 +1,14 @@ +const fs = require('fs'); +const path = require('path'); + +const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, './../../../package.json'))); + +const today = new Date(); +const dateString = `${today.getFullYear()}.${today.getMonth()+1}.${today.getDate()}`; + +packageJson.binary.remote_path = packageJson.binary.remote_path.replace(/{version}/, `nightly/${dateString}`); + +fs.writeFile(path.join(__dirname, './../../../package.json'), JSON.stringify(packageJson), (err)=>{ + if (err) return console.log('err'); + console.log('saved file'); +})
\ No newline at end of file |