Skip to content

Commit

Permalink
Merge pull request #2427 from LD4P/build_tweaks
Browse files Browse the repository at this point in the history
Build tweaks
  • Loading branch information
jermnelson authored Sep 4, 2020
2 parents 3eb93c4 + b899874 commit 1042c2c
Show file tree
Hide file tree
Showing 6 changed files with 416 additions and 236 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN /bin/bash -c 'chown -R circleci dist node_modules'
USER circleci

# Install dependencies
RUN npm install
RUN npm install --no-optional

# Build the app *within* the container because environment variables are fixed at build-time
RUN npm run build
Expand Down
28 changes: 4 additions & 24 deletions Dockerfile.cypress
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
FROM cypress/browsers:node14.7.0-chrome84
FROM cypress/included:4.12.1

# Rolling our own instead of using cypress-provided images because want to use
# additional libraries.
COPY cypress /cypress
COPY cypress.json cypress.json

# This is the directory the user in the circleci/node image can write to
# WORKDIR /home/circleci

# Everything that isn't in .dockerignore ships
COPY . .

RUN mkdir node_modules

# Allow circleci user to run npm build
#USER root
#RUN /bin/bash -c 'chown -R circleci node_modules'

# Build and run app using non-privileged account
#USER circleci

# Install dependencies
RUN npm install

RUN npm run cypress-verify

ENTRYPOINT ["npm", "run", "cypress-run"]
ENTRYPOINT ["cypress", "run", "--headless", "-b", "chrome"]
6 changes: 1 addition & 5 deletions cypress/integration/end2end.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import shortid from 'shortid'

describe('End-to-end test', () => {
// Avoid characters that will cause search to bomb, like -.
shortid.characters('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@_')
const title = shortid.generate()
const title = `title-${new Date().toISOString()}`

it('Opens the app', () => {
cy.visit(Cypress.env('EDITOR_URL') || 'http://localhost:8000/')
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ services:
# dockerfile: Dockerfile-setup
depends_on:
- mongo
- pipeline
restart: "no"
# Uncomment to use Mongo-Express to monitor Mongo. Do not commit docker-compose.yml.
# mongo-express:
Expand All @@ -87,4 +86,3 @@ services:
NO_AUTH: "true"
depends_on:
- mongo
- pipeline
Loading

0 comments on commit 1042c2c

Please sign in to comment.