working on making individual binary steps work

This commit is contained in:
Gleb Bahmutov
2017-06-28 09:41:58 -04:00
parent 81d6bb3028
commit dd0dca3fa1
4 changed files with 34 additions and 20 deletions

View File

@@ -27,9 +27,10 @@
"precommit": "lint-staged",
"precommit-lint": "eslint --fix --rule 'no-only-tests/no-only-tests: 2'",
"bump": "gulp bump",
"no-predeploy": "echo 'Just to be safe, rebuilding Sass binary' && npm rebuild node-sass",
"deploy": "node ./scripts/deploy.js deploy",
"upload": "node ./scripts/deploy.js upload",
"binary-build": "node ./scripts/deploy.js build",
"binary-zip": "node ./scripts/deploy.js zip",
"binary-upload": "node ./scripts/deploy.js upload",
"binary-deploy": "node ./scripts/deploy.js deploy",
"release": "gulp release"
},
"lint-staged": {

View File

@@ -39,13 +39,12 @@ module.exports = (platform, version) ->
path.resolve("dist", platform, args...)
## returns a path into the /build directory
## the output folder should have top level "Cypress" folder
## the output folder should look something like this
## build/
## <platform>/ = linux or darwin
## Cypress/
## ... platform-specific files
## ... platform-specific files
buildDir = (args...) ->
path.resolve("build", platform, "Cypress", args...)
path.resolve("build", platform, args...)
## returns a path into the /build/*/app directory
## specific to each platform

View File

@@ -137,17 +137,17 @@ deploy = {
build: ->
options = @parseOptions(process.argv)
askMissingOptions(options)
.then (version) ->
build(platform, version)
askMissingOptions(['version', 'platform'])(options)
.then () ->
build(options.platform, options.version)
zip: ->
# TODO only ask for built folder name
options = @parseOptions(process.argv)
askMissingOptions(options)
# .then ({platform, buildDir}) =>
# dest = path.resolve(zippedFilename(platform))
# zip.ditto(buildDir, dest)
askMissingOptions(['version', 'platform'])(options)
.then (options) =>
dest = path.resolve(zippedFilename(options.platform))
zip.ditto(buildDir, dest)
upload: ->
console.log('#upload')

View File

@@ -16,6 +16,18 @@ fs = Promise.promisifyAll(fs)
isValidPlatform = check.oneOf(["darwin", "linux"])
uploadNames = {
darwin: "osx64"
linux: "linux64"
win32: "win64"
}
getUploadNameByOs = (os) ->
name = uploadNames[os]
if not name
throw new Error("Cannot find upload name for OS #{os}")
name
module.exports = {
getPublisher: ->
aws = @getAwsObj()
@@ -36,7 +48,8 @@ module.exports = {
getUploadDirName: ({version, platform}) ->
aws = @getAwsObj()
dirName = [aws.folder, version, platform, null].join("/")
osName = getUploadNameByOs(platform)
dirName = [aws.folder, version, osName, null].join("/")
console.log("target directory %s", dirName)
dirName
@@ -47,7 +60,8 @@ module.exports = {
url = [konfig('cdn_url'), "desktop", version, platform, zipName].join("/")
console.log("purging url", url)
cp.exec "cfcli purgefile #{url}", (err, stdout, stderr) ->
configFile = path.resolve("support", ".cfcli.yml")
cp.exec "cfcli purgefile -c #{configFile} #{url}", (err, stdout, stderr) ->
if err
console.error("Could not purge #{url}")
console.error(err.message)
@@ -92,8 +106,8 @@ module.exports = {
p.dirname = aws.folder + "/" + p.dirname
p
.pipe debug()
.pipe publisher.publish(headers)
.pipe awspublish.reporter()
# .pipe publisher.publish(headers)
# .pipe awspublish.reporter()
.on "error", reject
.on "end", resolve
@@ -121,6 +135,6 @@ module.exports = {
.on "end", resolve
upload()
.then =>
@purgeCache({zipFile, version, platform})
# .then =>
# @purgeCache({zipFile, version, platform})
}