Skip to content

Commit

Permalink
Merge pull request #45 from Lercerss/docker-ci
Browse files Browse the repository at this point in the history
[#36] Set up circleCI with docker
  • Loading branch information
Lercerss authored Oct 15, 2019
2 parents 257111c + 968912b commit 5899faf
Show file tree
Hide file tree
Showing 20 changed files with 352 additions and 182 deletions.
42 changes: 42 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: 2
jobs:
build:
machine:
image: ubuntu-1604:201903-01
steps:
- checkout
- run:
name: Build docker image for frontend linting
command: docker build --target=lint -t graphelier-app-lint ./app
- run:
name: Build docker image for frontend testing
command: docker build --target=test -t graphelier-app-test ./app

- run:
name: Build docker image for backend linting
command: docker build --target=lint -t graphelier-service-lint ./core

- run:
name: Build docker image for scripts linting
command: docker build --target=lint -t graphelier-scripts-lint ./core/scripts
- run:
name: Build docker image for scripts testing
command: docker build --target=test -t graphelier-scripts-test ./core/scripts

- run:
name: Run the container for frontend linting
command: docker run graphelier-app-lint
- run:
name: Run the container for frontend testing
command: docker run graphelier-app-test

- run:
name: Run the container for backend linting
command: docker run graphelier-service-lint

- run:
name: Run the container for scripts linting
command: docker run graphelier-scripts-lint
- run:
name: Run the container for scripts testing
command: docker run graphelier-scripts-test
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,45 @@
# Graphelier

[![CircleCI](https://circleci.com/gh/Lercerss/graphelier.svg?style=svg)](https://circleci.com/gh/Lercerss/graphelier)
Displays detailed exchange order book contents

## Running the Application

```sh
docker-compose up
```

## Running the frontend linter with docker

```sh
docker build --target=lint -t graphelier-app-lint ./app
docker run graphelier-app-lint
```

## Running the frontend tests with docker

```sh
docker build --target=test -t graphelier-app-test ./app
docker run graphelier-app-test
```

## Running the backend linter with docker

```sh
docker build --target=lint -t graphelier-service-test ./core
docker run graphelier-service-test
```

## Running the python scripts linter with docker

```sh
docker build --target=lint -t graphelier-scripts-lint ./core/scripts
docker run graphelier-scripts-lint
```

## Running the python scripts' tests with docker

```sh
docker build --target=test -t graphelier-scripts-test ./core/scripts
docker run graphelier-scripts-test
```
16 changes: 10 additions & 6 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
FROM node:10.16.3

FROM node:10.16.3 AS base
WORKDIR /app

COPY package*.json /app/

FROM base AS builder
RUN npm install

COPY . .

EXPOSE 3000

FROM builder AS dev
CMD [ "npm", "start" ]

FROM builder AS test
ENV CI true
CMD [ "npm", "test" ]

FROM builder AS lint
CMD [ "npm", "run", "lint", "src/" ]
93 changes: 47 additions & 46 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,49 @@
{
"name": "app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.4.2",
"@material-ui/styles": "^4.4.1",
"axios": "^0.19.0",
"classnames": "^2.2.6",
"moment": "^2.24.0",
"nano-date": "^4.1.0",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-redux": "^7.1.1",
"react-scripts": "3.1.1",
"redux": "^4.0.4",
"redux-thunk": "^2.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"devDependencies": {
"axios-logger": "^2.2.1",
"babel-eslint": "10.0.2",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"eslint": "^6.4.0",
"react-test-renderer": "^16.10.2"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
"name": "app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.4.2",
"@material-ui/styles": "^4.4.1",
"axios": "^0.19.0",
"classnames": "^2.2.6",
"moment": "^2.24.0",
"nano-date": "^4.1.0",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-redux": "^7.1.1",
"react-scripts": "3.1.1",
"redux": "^4.0.4",
"redux-thunk": "^2.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"lint": "eslint"
},
"eslintConfig": {
"extends": "react-app"
},
"devDependencies": {
"axios-logger": "^2.2.1",
"babel-eslint": "10.0.2",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"eslint": "^6.4.0",
"react-test-renderer": "^16.10.2"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Loading

0 comments on commit 5899faf

Please sign in to comment.