Unverified Commit 8d1c8738 authored by Timothy Stone's avatar Timothy Stone
Browse files

feat(template): use latest and update documentation

Per Docker Images Versions[1] and Latest version by default[2] update the cypress image to use
latest.

It's unclear from the history why Cypress is using a version and not latest. Possibly the "tool"
exception[3]. However, this appears to be directed at implementation users not TBC directly.
Additionally, the core team has never updated this to use latest, but seeing the number of trivy
vulnerabilities in the 13.x line, an update to use latest seemed prudent.

1. https://to-be-continuous.gitlab.io/doc/usage/#docker-images-versions
2. https://to-be-continuous.gitlab.io/doc/dev/architecture/#latest-version-by-default
3. https://to-be-continuous.gitlab.io/doc/dev/architecture/#tool-versions-must-be-selected-with-image-tags

Fixes: cypress#14
parent a60c05b1
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ It uses the following variable:

| Input / Variable      | Description                              | Default value     |
| --------------------- | ---------------------------------------- | ----------------- |
| `image` / `CYPRESS_IMAGE` | The Docker image used to run Cypress (use [included images](https://github.com/cypress-io/cypress-docker-images/tree/master/included) only). | `docker.io/cypress/included:13.13.3` <br/>[![Trivy Badge](https://to-be-continuous.gitlab.io/doc/secu/trivy-badge-CYPRESS_IMAGE.svg)](https://to-be-continuous.gitlab.io/doc/secu/trivy-CYPRESS_IMAGE) |
| `image` / `CYPRESS_IMAGE` | The Docker image used to run Cypress (use [included images](https://github.com/cypress-io/cypress-docker-images/tree/master/included) only). | `docker.io/cypress/included:latest` <br/>[![Trivy Badge](https://to-be-continuous.gitlab.io/doc/secu/trivy-badge-CYPRESS_IMAGE.svg)](https://to-be-continuous.gitlab.io/doc/secu/trivy-CYPRESS_IMAGE) |
| `project-dir` / `CYPRESS_PROJECT_DIR` | The Cypress project directory (containing `cypress.config.js` or `cypress.config.ts`) | `.` |
| `extra-args` / `CYPRESS_EXTRA_ARGS` | Cypress extra [run options](https://docs.cypress.io/guides/guides/command-line.html#cypress-run) (to select a different browser, configuration or spec files for e.g.) | _none_ |
| `review-enabled` / `REVIEW_ENABLED` | Set to `true` to enable Cypress tests on review environments (dynamic environments instantiated on development branches) | _none_ (disabled) |
@@ -71,6 +71,20 @@ environments) will automatically be propagated to your Cypress tests.
If you're not using a smart deployment job, you may still explicitly declare the `CYPRESS_BASE_URL` variable (but that 
will be unfortunately hardcoded to a single server).

### arm64 runners

:warning: Browsers are not installed for ARM images, including Apple Silicon (sometimes called aarch64 or M-series). For background and possible workarounds, see [Cypress issue 1191](https://github.com/cypress-io/cypress-docker-images/issues/1191) and related issues. 

Consider [tagged runners](https://docs.gitlab.com/ci/runners/configure_runners/#control-jobs-that-a-runner-can-run) with amd64 runners for Cypress jobs, for example:

```yaml
cypress:
  ...
  ...
  tags:
    - cypress-amd64
```

### Hook scripts

The Cypress template supports _optional_ **hook scripts** from your project, located in the `$CYPRESS_PROJECT_DIR` directory to perform additional project-specific logic:
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
    {
      "name": "CYPRESS_IMAGE",
      "description": "The Docker image used to run Cypress (use [included images](https://github.com/cypress-io/cypress-docker-images/tree/master/included) only).",
      "default": "docker.io/cypress/included:13.13.3"
      "default": "docker.io/cypress/included:latest"
    },
    {
      "name": "CYPRESS_PROJECT_DIR",
+2 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ spec:
  inputs:
    image:
      description: The Docker image used to run Cypress (use [included images](https://github.com/cypress-io/cypress-docker-images/tree/master/included) only).
      default: docker.io/cypress/included:13.13.3
      default: docker.io/cypress/included:latest
    project-dir:
      description: The Cypress project directory (containing `cypress.config.js` or `cypress.config.ts`)
      default: .
@@ -376,6 +376,7 @@ stages:
cypress:
  image:
    name: "$CYPRESS_IMAGE"
    # See https://github.com/cypress-io/cypress-docker-images/blob/master/included/README.md#gitlab-pipelines
    entrypoint: [""]
  cache:
    key: "$CI_COMMIT_REF_SLUG-cypress"