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

Installing Cypress with CYPRESS_DOWNLOAD_MIRROR and Artifactory #15697

Closed
4 tasks done
bluepioupiou opened this issue Mar 29, 2021 · 3 comments · Fixed by #19526
Closed
4 tasks done

Installing Cypress with CYPRESS_DOWNLOAD_MIRROR and Artifactory #15697

bluepioupiou opened this issue Mar 29, 2021 · 3 comments · Fixed by #19526
Labels
topic: installation Issue during installation or downloading Cypress

Comments

@bluepioupiou
Copy link

bluepioupiou commented Mar 29, 2021

Current behavior

When setting Cypress in artifactory, and downloading it with CYPRESS_DOWNLOAD_MIRROR set toward this tool, the download script find binary files as 6.8.0 and not cypress.zip and fail. Apparently I can't rename binaries in artifactory.

My artifactory admin tell me to dothis command before but I can't since it's a post action of Cypress
curl –v « https://artifactory.mycompany.fr/artifactory/remote-download.cypress-generic/desktop/6.8.0?platform=win32&arch=x64 » > cypress.zip

Debug logs

Installing Cypress (version: 6.8.0)

  ×  Downloading Cypress    
    → Cypress Version: 6.8.0
     Unzipping Cypress      
     Finishing Installation 
The Cypress App could not be downloaded.

Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading
Cypress. Read more: https://on.cypress.io/proxy-configuration

Otherwise, please check network connectivity and try again:


URL: https://artifactory.mycompany.fr/artifactory/remote-download.cypress.io/desktop/6.8.0?platform=win32&arch=x64
Error: self signed certificate in certificate chain

Download method

  • npm

Operating System

  • Linux
  • Windows

Other

  • I'm behind a proxy

I don't really know if it's an artifactory or a Cypress matter but I need help ^^

@bluepioupiou bluepioupiou added the topic: installation Issue during installation or downloading Cypress label Mar 29, 2021
@minijus
Copy link
Contributor

minijus commented May 12, 2021

It seems similar issue to #8825 which was closed with #8877.
Version 7.3.0 now supports CYPRESS_DOWNLOAD_USE_CA env variable which forces cypress to honour ca and cafile properties on .npmrc.

From my own personal experience setting up Artifactory to mirror cypress binary:

In summary it is possible to setup Artifactory with self-signed certificate to mirror cypress binaries for different platforms with cypress version 7.3.0.

@gluxon
Copy link

gluxon commented Nov 30, 2021

@minijus's directions get pretty close, but requires unchecking "Store artifacts locally". Without storing artifacts locally, a lot of the benefits of having an internal cached mirror are lost. Each Cypress download would refetch https://download.cypress.io.

Would it be possible to get a new config for the Cypress downloader to use path params? Or have Cypress attempt query params and fallback to path params? That would make it possible to internally cache through JFrog Artifactory.

Thank you! 🙂


Related: I recently noticed that the desktop.json listing returns /desktop/:version/:platform-:arch URLs after #17291 (comment)

curl https://download.cypress.io/desktop.json  | jq
{
  "name": "Cypress",
  "version": "9.1.0",
  "packages": {
    "mac": {
      "url": "https://cdn.cypress.io/desktop/9.1.0/darwin-x64/cypress.zip"
    },
    "linux64": {
      "url": "https://cdn.cypress.io/desktop/9.1.0/linux-x64/cypress.zip"
    },
    "darwin": {
      "url": "https://cdn.cypress.io/desktop/9.1.0/darwin-x64/cypress.zip"
    },
    "linux": {
      "url": "https://cdn.cypress.io/desktop/9.1.0/linux-x64/cypress.zip"
    },
    "darwin-x64": {
      "url": "https://cdn.cypress.io/desktop/9.1.0/darwin-x64/cypress.zip"
    },
    "linux-x64": {
      "url": "https://cdn.cypress.io/desktop/9.1.0/linux-x64/cypress.zip"
    },
    "win32-x64": {
      "url": "https://cdn.cypress.io/desktop/9.1.0/win32-x64/cypress.zip"
    }
  }
}

But Cypress itself still searches for platform and version with query params in a hard-coded manner:

return `${endpoint}?platform=${platform}&arch=${arch()}`

The Cypress App could not be downloaded.

Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration

Otherwise, please check network connectivity and try again:

----------

URL: https://example.test/desktop/9.1.0?platform=linux&arch=x64
Error: Failed downloading the Cypress binary.
Response code: 404
Response message:

----------

Platform: linux-x64 (Ubuntu - 20.04)
Cypress Version: 9.1.0

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 18, 2022

Released in 9.3.0.

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

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label Jan 18, 2022
@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jan 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic: installation Issue during installation or downloading Cypress
Projects
None yet
3 participants