From d807f91cc0e06cca94a916b8fc84177838d54af0 Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Mon, 30 Oct 2017 21:19:23 -0400 Subject: [PATCH 1/4] document CYPRESS_BINARY_VERSION close #121 --- .../getting-started/installing-cypress.md | 25 +++++++++++++++++++ source/guides/references/changelog.md | 1 + 2 files changed, 26 insertions(+) diff --git a/source/guides/getting-started/installing-cypress.md b/source/guides/getting-started/installing-cypress.md index 8bf36ced82..dc04ee71d4 100644 --- a/source/guides/getting-started/installing-cypress.md +++ b/source/guides/getting-started/installing-cypress.md @@ -108,3 +108,28 @@ By installing Cypress through `npm` you also get access to many other CLI comman As of version `0.20.0` Cypress is also a fully baked `node_module` you can require in your node scripts. You can {% url 'read more about the CLI here' command-line %}. + +# Advanced Installation + +If the normal `npm install cypress` command does not work for some reason (like a corporate proxy not allowing downloading Cypress binary from the `https://cdn.cypress.io` server), you still have a workaround. The installer can override version and/or path of the binary to download via `CYPRESS_BINARY_VERSION` environment variable. You have three choices: + +1. Install a different binary version from the `cypres` NPM package version. For example, to install NPM `cypress` package version 1.0.3 with binary 1.0.1 use this command: + + ```shell + CYPRESS_BINARY_VERSION=1.0.1 npm install cypress@1.0.3 + ``` + +2. Install Cypress binary from the given URL. For example, you can download Cypress binary from our CDN server `https://download.cypress.io/desktop` and place it on our company's server. Then use the following command: + + ```shell + CYPRESS_BINARY_VERSION=https://company.domain.com/cypress.zip npm install cypress + ``` + +3. Download Cypress binary Zip file and install from a local file. In the example below, I am downloading the version 1.0.2 of binary for Mac platform and save it as local file `cypress.zip`. Then I am installing the latest `cypress` NPM package and the downloaded zip file. + + ```shell + curl -O https://cdn.cypress.io/desktop/1.0.2/osx64/cypress.zip + CYPRESS_BINARY_VERSION=cypress.zip npm install cypress + ``` + +In all cases, the fact that the binary was installed from a custom location *is not saved* in your `package.json` file. Every repeated installation would have to use the same environment variable to install the same binary. diff --git a/source/guides/references/changelog.md b/source/guides/references/changelog.md index 783d19c5c8..6328e942c9 100644 --- a/source/guides/references/changelog.md +++ b/source/guides/references/changelog.md @@ -25,6 +25,7 @@ comments: false - Cypress binaries can now be pointed to a staging environment with `CYPRESS_ENV=staging`. Fixes {% issue 813 %}. - The Desktop GUI displays the scrollbar correctly when the update banner is displayed. Fixes {% issue 803 %}. - The branch name is now properly collected when recording in Buildkite CI. Fixes {% issue 777 %}. +- You can install Cypress binary from any URL or file path using `CYPRESS_BINARY_VERSION` environment variable. Closes {% issue 701 %}. **Documentation Changes:** From 2f26a7b08b613158add1de89022ff5264e3d3c17 Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Wed, 1 Nov 2017 11:05:17 -0400 Subject: [PATCH 2/4] general editing to new binary version docs --- source/guides/getting-started/installing-cypress.md | 10 +++++----- source/guides/references/changelog.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/guides/getting-started/installing-cypress.md b/source/guides/getting-started/installing-cypress.md index dc04ee71d4..437753831a 100644 --- a/source/guides/getting-started/installing-cypress.md +++ b/source/guides/getting-started/installing-cypress.md @@ -109,23 +109,23 @@ As of version `0.20.0` Cypress is also a fully baked `node_module` you can requi You can {% url 'read more about the CLI here' command-line %}. -# Advanced Installation +# Advanced installation -If the normal `npm install cypress` command does not work for some reason (like a corporate proxy not allowing downloading Cypress binary from the `https://cdn.cypress.io` server), you still have a workaround. The installer can override version and/or path of the binary to download via `CYPRESS_BINARY_VERSION` environment variable. You have three choices: +If the normal `npm install cypress` command does not work for some reason (like a corporate proxy not allowing downloading the Cypress binary from the `https://cdn.cypress.io` server), you still have a workaround. The installer can override the version and/or path of the binary to download via the `CYPRESS_BINARY_VERSION` environment variable. You have three choices: -1. Install a different binary version from the `cypres` NPM package version. For example, to install NPM `cypress` package version 1.0.3 with binary 1.0.1 use this command: +1. Install a different binary version from the {% url "`cypress` npm package" https://www.npmjs.com/package/cypress %} version. For example, to install the `cypress` npm package version `1.0.3` with the binary `1.0.1` version use this command: ```shell CYPRESS_BINARY_VERSION=1.0.1 npm install cypress@1.0.3 ``` -2. Install Cypress binary from the given URL. For example, you can download Cypress binary from our CDN server `https://download.cypress.io/desktop` and place it on our company's server. Then use the following command: +2. Install the Cypress binary from the given URL. For example, you can download the Cypress binary from our CDN server `https://download.cypress.io/desktop` and place it on our company's server. Then use the following command: ```shell CYPRESS_BINARY_VERSION=https://company.domain.com/cypress.zip npm install cypress ``` -3. Download Cypress binary Zip file and install from a local file. In the example below, I am downloading the version 1.0.2 of binary for Mac platform and save it as local file `cypress.zip`. Then I am installing the latest `cypress` NPM package and the downloaded zip file. +3. Download the Cypress binary zip file and install it from a local file. In the example below, we download the version `1.0.2` of the binary for the Mac OS and save it as a local file `cypress.zip`. Then we install the latest `cypress` npm package version and the downloaded zip file. ```shell curl -O https://cdn.cypress.io/desktop/1.0.2/osx64/cypress.zip diff --git a/source/guides/references/changelog.md b/source/guides/references/changelog.md index 6328e942c9..824093937d 100644 --- a/source/guides/references/changelog.md +++ b/source/guides/references/changelog.md @@ -25,7 +25,7 @@ comments: false - Cypress binaries can now be pointed to a staging environment with `CYPRESS_ENV=staging`. Fixes {% issue 813 %}. - The Desktop GUI displays the scrollbar correctly when the update banner is displayed. Fixes {% issue 803 %}. - The branch name is now properly collected when recording in Buildkite CI. Fixes {% issue 777 %}. -- You can install Cypress binary from any URL or file path using `CYPRESS_BINARY_VERSION` environment variable. Closes {% issue 701 %}. +- You can install the Cypress binary from any URL or file path using the {% "`CYPRESS_BINARY_VERSION` environment variable" installing-cypress#Advanced-installation %}. Closes {% issue 701 %}. **Documentation Changes:** From 61a88fe09eb059ad9bf63c8040a4cf779c26eede Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Wed, 1 Nov 2017 11:05:31 -0400 Subject: [PATCH 3/4] Mention version and binary version to CI doc --- source/guides/guides/continuous-integration.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/guides/guides/continuous-integration.md b/source/guides/guides/continuous-integration.md index 30ea4b28bb..9c522108bc 100644 --- a/source/guides/guides/continuous-integration.md +++ b/source/guides/guides/continuous-integration.md @@ -143,6 +143,8 @@ You can set any configuration value as an environment variable. This overrides v - `CYPRESS_BASE_URL` - `CYPRESS_VIDEO_COMPRESSION` - `CYPRESS_REPORTER` +- `CYPRESS_VERSION` +- `CYPRESS_BINARY_VERSION` {% note info %} Refer to the {% url 'configuration' configuration#Environment-Variables %} for more examples. From 976f26e5c475d6d420b6aebd43a47bd70db94b41 Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Wed, 1 Nov 2017 11:31:13 -0400 Subject: [PATCH 4/4] fix missing url --- source/guides/references/changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/guides/references/changelog.md b/source/guides/references/changelog.md index 824093937d..4ceb5be419 100644 --- a/source/guides/references/changelog.md +++ b/source/guides/references/changelog.md @@ -25,7 +25,7 @@ comments: false - Cypress binaries can now be pointed to a staging environment with `CYPRESS_ENV=staging`. Fixes {% issue 813 %}. - The Desktop GUI displays the scrollbar correctly when the update banner is displayed. Fixes {% issue 803 %}. - The branch name is now properly collected when recording in Buildkite CI. Fixes {% issue 777 %}. -- You can install the Cypress binary from any URL or file path using the {% "`CYPRESS_BINARY_VERSION` environment variable" installing-cypress#Advanced-installation %}. Closes {% issue 701 %}. +- You can install the Cypress binary from any URL or file path using the {% url "`CYPRESS_BINARY_VERSION` environment variable" installing-cypress#Advanced-installation %}. Closes {% issue 701 %}. **Documentation Changes:**