diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..3c3629e64 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +node_modules diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..3fbd5f55e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# This Docker file is for building this project on Codeship Pro +# https://documentation.codeship.com/pro/languages-frameworks/nodejs/ + +# use Cypress provided image with all dependencies included +FROM cypress/base:10 +RUN node --version +RUN npm --version +WORKDIR /home/node/app +# copy our test application +COPY package.json package-lock.json ./ +COPY app ./app +# copy Cypress tests +COPY cypress.json cypress ./ +COPY cypress ./cypress + +# avoid many lines of progress bars during install +# https://github.com/cypress-io/cypress/issues/1243 +ENV CI=1 + +# install NPM dependencies and Cypress binary +RUN npm ci +# check if the binary was installed successfully +RUN $(npm bin)/cypress verify diff --git a/README.md b/README.md index c95e805ba..4e0c01a02 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ CI | Build status | basic config file | full parallel config AppVeyor | [![AppVeyor CI](https://ci.appveyor.com/api/projects/status/bo4x59pha1eb18de?svg=true)](https://ci.appveyor.com/project/cypress-io/cypress-example-kitchensink) | [appveyor.yml](appveyor.yml) Buildkite | [![Buildkite CI](https://badge.buildkite.com/d1bd1f093d97de34475da7d545c80eb2be9749eefe1c7133f0.svg)](https://buildkite.com/cypress-io/cypress-example-kitchensink) | [.buildkite/pipeline.yml](.buildkite/pipeline.yml) Circle | [![Circle CI](https://circleci.com/gh/cypress-io/cypress-example-kitchensink.svg?style=svg)](https://circleci.com/gh/cypress-io/cypress-example-kitchensink) | [basic/circle.yml](basic/circle.yml) | [circle.yml](circle.yml) -Codeship Basic | [ ![Codeship Basic CI](https://app.codeship.com/projects/8d6a20c0-b70e-0133-41c6-56e5cd60fbd0/status?branch=master)](https://app.codeship.com/projects/134609) +Codeship Pro | [ ![Codeship Pro CI](https://app.codeship.com/projects/8d6a20c0-b70e-0133-41c6-56e5cd60fbd0/status?branch=master)](https://app.codeship.com/projects/134609) | [basic/codeship-pro](basic/codeship-pro) GitLab | [![GitLab CI](https://gitlab.com/cypress-io/cypress-example-kitchensink/badges/master/pipeline.svg)](https://gitlab.com/cypress-io/cypress-example-kitchensink/commits/master) | | [.gitlab-ci.yml](.gitlab-ci.yml) Jenkins | | [basic/Jenkinsfile](basic/Jenkinsfile) | [Jenkinsfile](Jenkinsfile) Semaphore | [![Semaphore CI](https://semaphoreci.com/api/v1/jennifer-mann/cypress-example-kitchensink/branches/master/badge.svg)](https://semaphoreci.com/jennifer-mann/cypress-example-kitchensink) diff --git a/basic/README.md b/basic/README.md index f682dc801..5b129c500 100644 --- a/basic/README.md +++ b/basic/README.md @@ -3,5 +3,6 @@ This folder contains basic configuration files for many CI providers. Each of th CI | basic config file :--- | :--- Circle | [circle.yml](circle.yml) +Codeship Pro | [codeship-pro](codeship-pro) Jenkins | [Jenkinsfile](Jenkinsfile) Travis | [.travis.yml](.travis.yml) diff --git a/basic/codeship-pro/Dockerfile b/basic/codeship-pro/Dockerfile new file mode 100644 index 000000000..3fbd5f55e --- /dev/null +++ b/basic/codeship-pro/Dockerfile @@ -0,0 +1,23 @@ +# This Docker file is for building this project on Codeship Pro +# https://documentation.codeship.com/pro/languages-frameworks/nodejs/ + +# use Cypress provided image with all dependencies included +FROM cypress/base:10 +RUN node --version +RUN npm --version +WORKDIR /home/node/app +# copy our test application +COPY package.json package-lock.json ./ +COPY app ./app +# copy Cypress tests +COPY cypress.json cypress ./ +COPY cypress ./cypress + +# avoid many lines of progress bars during install +# https://github.com/cypress-io/cypress/issues/1243 +ENV CI=1 + +# install NPM dependencies and Cypress binary +RUN npm ci +# check if the binary was installed successfully +RUN $(npm bin)/cypress verify diff --git a/basic/codeship-pro/README.md b/basic/codeship-pro/README.md new file mode 100644 index 000000000..8608c35b9 --- /dev/null +++ b/basic/codeship-pro/README.md @@ -0,0 +1,5 @@ +This folder has 3 files necessary to configure Codeship Pro to execute Cypress end-to-end tests. + +- [Dockerfile](Dockerfile) +- [codeship-services.yml](codeship-services.yml) +- [codeship-steps.yml](codeship-steps.yml) diff --git a/basic/codeship-pro/codeship-services.yml b/basic/codeship-pro/codeship-services.yml new file mode 100644 index 000000000..ba0d22677 --- /dev/null +++ b/basic/codeship-pro/codeship-services.yml @@ -0,0 +1,7 @@ +cypress-codeship-test: + build: + image: cypress/cypress_codeship_test + dockerfile: Dockerfile + # if we wanted to pass private environment variables like CYPRESS_RECORD_KEY + # we would need to include encrypted env file + # see instructions https://documentation.codeship.com/pro/builds-and-configuration/environment-variables/ diff --git a/basic/codeship-pro/codeship-steps.yml b/basic/codeship-pro/codeship-steps.yml new file mode 100644 index 000000000..a9ee70887 --- /dev/null +++ b/basic/codeship-pro/codeship-steps.yml @@ -0,0 +1,4 @@ +# starts server and runs all tests +- name: "Run E2E tests" + service: cypress-codeship-test + command: npm run test:ci diff --git a/codeship-services.yml b/codeship-services.yml new file mode 100644 index 000000000..ba0d22677 --- /dev/null +++ b/codeship-services.yml @@ -0,0 +1,7 @@ +cypress-codeship-test: + build: + image: cypress/cypress_codeship_test + dockerfile: Dockerfile + # if we wanted to pass private environment variables like CYPRESS_RECORD_KEY + # we would need to include encrypted env file + # see instructions https://documentation.codeship.com/pro/builds-and-configuration/environment-variables/ diff --git a/codeship-steps.yml b/codeship-steps.yml new file mode 100644 index 000000000..a9ee70887 --- /dev/null +++ b/codeship-steps.yml @@ -0,0 +1,4 @@ +# starts server and runs all tests +- name: "Run E2E tests" + service: cypress-codeship-test + command: npm run test:ci