Skip to content

Installing Cypress with CYPRESS_DOWNLOAD_MIRROR and Artifactory #15697

Closed
@bluepioupiou

Description

@bluepioupiou

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 ^^

Activity

minijus

minijus commented on May 12, 2021

@minijus
Contributor

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

gluxon commented on Nov 30, 2021

@gluxon

@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

4 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: installationIssue during installation or downloading Cypress

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @gluxon@bluepioupiou@minijus

      Issue actions

        Installing Cypress with CYPRESS_DOWNLOAD_MIRROR and Artifactory · Issue #15697 · cypress-io/cypress