When CYPRESS_DOWNLOAD_MIRROR is specified Cypress will download the binaries from something like https://whatever/desktop?platform=OS&arch=ARCH.
This means we cannot serve these binaries from a static file server. Because of the query parameters.
Change the API so that the file gets downloaded from something like https://whatever/desktop/platform/:platform/arch/:arc/cypress.zip.
Such an API can easily be implemented with a simple static file server. Something that is usually easy to setup in corporate environments.
CYPRESS_DOWNLOAD_MIRROR to point at a static file server.3.4.1
@tomasbjerre it wouldn't be pretty, but I think you can still name your static files/folders with the query param strings. Let me know if that works for you. However I do agree changing this would make it much easier
I also "think" it is likely possible, but not easy. And I think it should be easy as I think it is part of solving a very common problem.
This would solve the problem reported in #5036 where users are working on mixed platforms. Some will need the Windows binary and some the Linux binary. With this we could just set the version in package.json and have this mirror in .npmrc and then the current implementation will pick the binary fit for the current platform.
Edit: It is not easy for me to convince the operations team that they should host a binary file, with a cryptic filename, and make it available from everywhere. And tell them they should do so because I just started using a new trendy tool I found on the Internet.
Tried with Github, does not seem to work.
@Bkucera just curious if the source code for the download server is available so one could easily host it in a corporate environment?
Same. I need to run Cypress on a private network that has a private proxied npm registry with no access to the outside world. The docs mention running a local mirror but no mention of how to do that
I created a tool to deal with this problem:
https://github.com/tomasbjerre/dictator-cypress-example
You would need to clone this repository and publish your own cypress-dictator to your private npm repository:
https://github.com/tomasbjerre/dictator-cypress
It uses dictator builder to, before npm install, copy platform specific zip-files to root of repository and make sure it is pointed at by .npmrc.
{
"message": "Copy linux cypress to cypress.zip",
"triggers": [
{
"runningOnPlatform": ["linux"]
}
],
"actions": [
{
"copyFrom": "linux-x64.zip",
"target": "cypress.zip"
}
]
}
Most helpful comment
I also "think" it is likely possible, but not easy. And I think it should be easy as I think it is part of solving a very common problem.
This would solve the problem reported in #5036 where users are working on mixed platforms. Some will need the Windows binary and some the Linux binary. With this we could just set the version in
package.jsonand have this mirror in.npmrcand then the current implementation will pick the binary fit for the current platform.Edit: It is not easy for me to convince the operations team that they should host a binary file, with a cryptic filename, and make it available from everywhere. And tell them they should do so because I just started using a new trendy tool I found on the Internet.