Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placeholder support for CYPRESS_INSTALL_BINARY #16976

Closed
FDIM opened this issue Jun 17, 2021 · 3 comments
Closed

Placeholder support for CYPRESS_INSTALL_BINARY #16976

FDIM opened this issue Jun 17, 2021 · 3 comments

Comments

@FDIM
Copy link

FDIM commented Jun 17, 2021

What would you like?

An easy way to configure and install cypress in corporate environment. It's nice that CYPRESS_INSTALL_BINARY options exists but it could be better.

To cover all scenarios we need to support windows, mac, and linux (for CI) and there is no nice way do this if you are sitting behind corporate firewall. Here is what I ended up doing and I believe it would work for quite a few others without having to mirror download site (we use artifactory and sadly cypress download site does not come out of the box, I also have limited rights to play with it so I'm also not aware of complete functionality).

So.... drums rolls....

in .npmrc I have this:

CYPRESS_INSTALL_BINARY_TEMPLATE=https://artifactory.some.internal.domain/npm-packages/cypress/__VERSION__/cypress___PLATFORM__-__ARCH__.zip
CYPRESS_INSTALL_BINARY=0

and in our postinstall hook I do this:

console.info('Running cypress install task manually');
process.env.CYPRESS_INSTALL_BINARY = process.env.npm_config_CYPRESS_INSTALL_BINARY_TEMPLATE
    .replace('__VERSION__', process.env.npm_package_devDependencies_cypress)
    .replace('__PLATFORM__', process.platform)
    .replace('__ARCH__', process.arch);

require('cypress/lib/tasks/install').start({
    force: false
}).catch(console.error);

This is obviously workaround and I'll have to maintain it in the future, but it is definitely better than proposed alternatives I could find.

So for the solution, how about adding placeholders for cypress version, platform and architecture in CYPRESS_INSTALL_BINARY variable?

CYPRESS_INSTALL_BINARY=https://artifactory.some.internal.domain.com/npm-packages/cypress/__CYPRESS_VERSION__/cypress___PLATFORM__-__ARCH__.zip

Thanks for an awesome tool!

Why is this needed?

To make it less painful to configure and use cypress across workstations and CI.

@jemerald
Copy link

CYPRESS_DOWNLOAD_PATH_TEMPLATE was added since 9.3.0

ZachJW34 pushed a commit that referenced this issue Aug 16, 2022
…16976 #22864) (#23194)

Co-authored-by: Blue F <blue@cypress.io>
Co-authored-by: Matt Henkes <mjhenkes@gmail.com>
@tbiethman
Copy link
Contributor

The code for this is done in #23194, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Aug 16, 2022

Released in 10.6.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v10.6.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants