mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-24 07:59:12 -05:00
retry signing the binary once if it fails
This commit is contained in:
@@ -19,6 +19,7 @@ debug = require("debug")("cypress:binary")
|
||||
R = require("ramda")
|
||||
la = require("lazy-ass")
|
||||
check = require("check-more-types")
|
||||
humanInterval = require("human-interval")
|
||||
|
||||
meta = require("./meta")
|
||||
smoke = require("./smoke")
|
||||
@@ -241,14 +242,43 @@ buildCypressApp = (platform, version, options = {}) ->
|
||||
else
|
||||
run()
|
||||
|
||||
codeSign = ->
|
||||
codeSign = Promise.method ->
|
||||
if platform isnt "darwin"
|
||||
# do we need to code sign on Windows?
|
||||
return Promise.resolve()
|
||||
return
|
||||
|
||||
appFolder = meta.zipDir(platform)
|
||||
log("#codeSign #{appFolder}")
|
||||
execa('build', ["--publish", "never", "--prepackaged", appFolder], {stdio: "inherit"})
|
||||
fiveMinutes = humanInterval("5 seconds")
|
||||
|
||||
execaBuild = Promise.method ->
|
||||
log("#codeSign #{appFolder}")
|
||||
|
||||
execa('build', ["--publish", "never", "--prepackaged", appFolder], {
|
||||
stdio: "inherit"
|
||||
})
|
||||
.catch (err) ->
|
||||
## ignore canceled errors
|
||||
if err.isCanceled
|
||||
return
|
||||
|
||||
throw err
|
||||
|
||||
## try to build and if we timeout in 5 minutes
|
||||
## then try again - which sometimes happens in
|
||||
## circle CI
|
||||
cp = execaBuild()
|
||||
|
||||
cp
|
||||
.timeout(fiveMinutes)
|
||||
.catch Promise.TimeoutError, (err) ->
|
||||
console.log(
|
||||
chalk.red("timed out signing binary after #{fiveMinutes}ms. retrying...")
|
||||
)
|
||||
|
||||
cp.cancel()
|
||||
|
||||
execaBuild()
|
||||
|
||||
|
||||
verifyAppCanOpen = ->
|
||||
if (platform != "darwin") then return Promise.resolve()
|
||||
|
||||
Reference in New Issue
Block a user