Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules
.gitignore
README.md
build
node_modules
.env.example
docker-compose.yml
41 changes: 19 additions & 22 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,47 @@
kind: pipeline #to generate pipeline
type: docker # means it uses docker
name: webUIDroneTest #name of pipleline
kind: pipeline
type: docker
name: DroneCITest

steps:
- name: waveentry-server
image: owncloudci/nodejs:14
detach: true
environment:
DB_HOST: database
DB_NAME: wavedb
DB_HOST: mongodatabase
DB_PORT: 27017
DB_NAME: waveentrydatabase
SERVER_PORT: 3001
JWT_SECRET: abcd1234
DB_PORT: 27017
detach: true
commands:
- git clone https://github.com/SagarGi/wave-entry-server.git /waveentry-server
- cd /waveentry-server
- npm ci # same as npm install used in CI
- git clone https://github.com/SagarGi/wave-entry-server.git /waveentryserver
- cd /waveentryserver
- npm ci
- npm start

- name: waveentry-forntend
- name: waveentryUI
image: owncloudci/nodejs:14
detach: true
environment:
REACT_APP_SERVER_URL: http://waveentry-server:3001
REACT_APP_SERVER_URI: http://waveentry-server:3001
commands:
- npm ci
- npm start
detach: true

- BROWSER=none npm start
- name: wait
image: owncloudci/wait-for:latest
commands:
- wait-for -it waveentry-server:3001 -t 300
- wait-for -it waveentry:3000 -t 300
- wait-for -it waveentryUI:3000 -t 300

- name: e2eTest
- name: acceptanceTest
image: owncloudci/nodejs:14
environment:
SERVER_URL: http://waveentry-server:3001
WEB_URL: http://waveentry:3000

WEB_URL: http://waveentryUI:3000
commands:
- npm run test:e2e tests/acceptance/features
- npm run test:e2e ./tests/acceptance/features/

# services runs before the steps starts executing
services:
- name: database
- name: mongodatabase
image: mongo

trigger:
Expand Down
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
FROM node:14

ENV REACT_APP_SERVER_URI=http://localhost:3001

WORKDIR /app/waveentry
WORKDIR /srv/app

COPY . .

EXPOSE 3000

RUN npm i

CMD ["npm" , "start"]
CMD ["npm", "start"]

3 changes: 1 addition & 2 deletions cucumber.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ setDefaultTimeout(60 * 1000);

BeforeAll(async function () {
global.browser = await chromium.launch({
slowMo: config.slowMo,
headless: config.headless,
// headless: false,
channel: "chrome",
});

Expand Down
29 changes: 29 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
services:
db:
image: mongo
# container_name: mongodb
ports:
- "2700:27017"

server:
image: waveentryserver2
environment:
DB_HOST: db
DB_PORT: 27017
SERVER_PORT: 3002
JWT_SECRET: abcd1234
# command: npm run db:seed
ports:
- "3030:3002"
depends_on:
- db

web:
image: wave-entry-web
ports:
- "3000:3000"
environment:
- REACT_APP_SERVER_URI=http://localhost:3005
depends_on:
- server
- db
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"test:e2e": "cucumber-js --require cucumber.config.js --require tests/acceptance/stepDefinitions/**/*.js --format @cucumber/pretty-formatter"
"test:e2e": "cucumber-js --require cucumber.config.js --require tests/acceptance/stepDefinitions/**/*.js --format @cucumber/pretty-formatter",
"setup:browsers": "npx playwright install-deps && npx playwright install chromium"
},
"eslintConfig": {
"extends": [
Expand Down