From d657b3545f4dd3c247dd29fcb2e3e5f2dfa60adf Mon Sep 17 00:00:00 2001 From: Brian Mann Date: Wed, 4 Oct 2017 18:47:59 -0400 Subject: [PATCH] root: add release tasks to bump cypress server manifest [skip ci] --- package.json | 2 +- scripts/binary/bump.coffee | 9 +++++++++ scripts/binary/index.coffee | 4 ++-- scripts/binary/upload.coffee | 11 +++++++++-- scripts/binary/util/upload.coffee | 10 +++++++++- scripts/gulpfile.coffee | 7 ------- 6 files changed, 30 insertions(+), 13 deletions(-) delete mode 100644 scripts/gulpfile.coffee diff --git a/package.json b/package.json index d414f9ce17..4c51265aa1 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "binary-deploy": "node ./scripts/binary.js deploy", "binary-purge": "node ./scripts/binary.js purge-version", "binary-deploy-linux": "./scripts/build-linux-binary.sh", - "release": "gulp release", + "binary-release": "node ./scripts/binary.js release", "test-mocha": "mocha --reporter spec scripts/spec.js", "test-mocha-snapshot": "mocha scripts/mocha-snapshot-spec.js" }, diff --git a/scripts/binary/bump.coffee b/scripts/binary/bump.coffee index 0ec5c595d2..46b280682a 100644 --- a/scripts/binary/bump.coffee +++ b/scripts/binary/bump.coffee @@ -67,8 +67,17 @@ remapProjects = (projectsByProvider) -> PROJECTS = remapProjects(_PROVIDERS) getCiConfig = -> + ## gleb: fix this plzzzzzz + old = process.cwd() + + process.chdir(__dirname) + key = "support/.ci.json" + config = configFromEnvOrJsonFile(key) + + process.chdir(old) + if !config console.error('⛔️ Cannot find CI credentials') console.error('Using @cypress/env-or-json-file module') diff --git a/scripts/binary/index.coffee b/scripts/binary/index.coffee index 5ce097c761..e7a452e349 100644 --- a/scripts/binary/index.coffee +++ b/scripts/binary/index.coffee @@ -102,12 +102,12 @@ deploy = { success("Release Complete") .catch (err) -> fail("Release Failed") - reject(err) + throw err if v = options.version release(v) else - ask.whichRelease(meta.distDir) + ask.whichRelease(meta.distDir("")) .then(release) build: (options) -> diff --git a/scripts/binary/upload.coffee b/scripts/binary/upload.coffee index ad4d1d1919..6be05eebbf 100644 --- a/scripts/binary/upload.coffee +++ b/scripts/binary/upload.coffee @@ -54,7 +54,7 @@ module.exports = { } } - src = path.join(meta.buildDir, "manifest.json") + src = path.resolve("manifest.json") fs.outputJsonAsync(src, obj).return(src) s3Manifest: (version) -> @@ -65,8 +65,13 @@ module.exports = { headers = {} headers["Cache-Control"] = "no-cache" + manifest = null + new Promise (resolve, reject) => - @createRemoteManifest(aws.folder, version).then (src) -> + @createRemoteManifest(aws.folder, version) + .then (src) -> + manifest = src + gulp.src(src) .pipe rename (p) -> p.dirname = aws.folder + "/" + p.dirname @@ -76,6 +81,8 @@ module.exports = { .pipe awspublish.reporter() .on "error", reject .on "end", resolve + .finally -> + fs.removeAsync(manifest) toS3: ({zipFile, version, platform}) -> console.log("#uploadToS3 ⏳") diff --git a/scripts/binary/util/upload.coffee b/scripts/binary/util/upload.coffee index 5ad91ec9c1..503162962a 100644 --- a/scripts/binary/util/upload.coffee +++ b/scripts/binary/util/upload.coffee @@ -11,9 +11,17 @@ Promise = require("bluebird") konfig = require("../../../packages/server/lib/konfig") getS3Credentials = () -> - key = path.join('scripts', 'binary', 'support', '.aws-credentials.json') + ## gleb: fix this plzzzzzz + old = process.cwd() + + process.chdir(path.resolve(__dirname, '..')) + + key = path.join('support', '.aws-credentials.json') config = configFromEnvOrJsonFile(key) + + process.chdir(old) + if !config console.error('⛔️ Cannot find AWS credentials') console.error('Using @cypress/env-or-json-file module') diff --git a/scripts/gulpfile.coffee b/scripts/gulpfile.coffee deleted file mode 100644 index 076ca789bc..0000000000 --- a/scripts/gulpfile.coffee +++ /dev/null @@ -1,7 +0,0 @@ -deploy = require("./deploy") - -gulp.task "release", deploy.release - -gulp.task "deploy", deploy.deploy - -gulp.task "bump", deploy.bump