mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-05 14:30:32 -05:00
form upload hash from CI environment vars if not set
This commit is contained in:
@@ -73,6 +73,9 @@ uploadNpmPackage = (args = []) ->
|
||||
la(isNpmPackageFile(options.file),
|
||||
"invalid file to upload extension", options.file)
|
||||
|
||||
if not options.hash
|
||||
options.hash = uploadUtils.formHashFromEnvironment()
|
||||
|
||||
la(check.unemptyString(options.hash), "missing hash to give", options)
|
||||
la(check.unemptyString(options.version), "missing version", options)
|
||||
|
||||
|
||||
@@ -76,6 +76,9 @@ uploadUniqueBinary = (args = []) ->
|
||||
la(isBinaryFile(options.file),
|
||||
"invalid file to upload extension", options.file)
|
||||
|
||||
if not options.hash
|
||||
options.hash = uploadUtils.formHashFromEnvironment()
|
||||
|
||||
la(check.unemptyString(options.hash), "missing hash to give", options)
|
||||
la(check.unemptyString(options.version), "missing version", options)
|
||||
|
||||
|
||||
@@ -10,6 +10,16 @@ Promise = require("bluebird")
|
||||
{configFromEnvOrJsonFile, filenameToShellVariable} = require('@cypress/env-or-json-file')
|
||||
konfig = require("../../../packages/server/lib/konfig")
|
||||
|
||||
formHashFromEnvironment = () ->
|
||||
env = process.env
|
||||
if env.BUILDKITE
|
||||
return "#{env.BUILDKITE_BRANCH}-#{env.BUILDKITE_COMMIT}-#{env.BUILDKITE_BUILD_NUMBER}"
|
||||
if env.CIRCLE
|
||||
return "#{env.CIRCLE_BRANCH}-#{env.CIRCLE_SHA1}-#{env.CIRCLE_BUILD_NUM}"
|
||||
if env.APPVEYOR
|
||||
return "#{env.APPVEYOR_REPO_BRANCH}-#{env.APPVEYOR_REPO_COMMIT}-#{env.APPVEYOR_BUILD_ID}"
|
||||
throw new Error("Do not know how to form unique build hash on this CI")
|
||||
|
||||
getS3Credentials = () ->
|
||||
## gleb: fix this plzzzzzz
|
||||
old = process.cwd()
|
||||
@@ -133,5 +143,6 @@ module.exports = {
|
||||
purgeDesktopAppFromCache,
|
||||
purgeDesktopAppAllPlatforms,
|
||||
getUploadNameByOs,
|
||||
saveUrl
|
||||
saveUrl,
|
||||
formHashFromEnvironment
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user