Skip to content

Commit a09912a

Browse files
authored
Update README and default configs (#67)
* Update README and default configs * Dashboard updates, npm update, allow custom ports for dev * Add --rm to migration run
1 parent 4cf072f commit a09912a

File tree

13 files changed

+86
-5890
lines changed

13 files changed

+86
-5890
lines changed

.env

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
DOCKER_COMPOSE_REDIS_PORT=6379
2+
DOCKER_COMPOSE_MONGODB_PORT=27017
3+
DOCKER_COMPOSE_GITBOOK_PORT=4000
4+
DOCKER_COMPOSE_GITBOOK_LIVERELOAD_PORT=35729
5+
REACT_APP_ROOT_PORT=3000
6+
REACT_APP_API_ROOT_PORT=3001
7+
REACT_APP_WEBHOOKS_ROOT_PORT=3002
8+
REACT_APP_WS_ROOT_PORT=3003

Dockerfile

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ RUN mkdir -p $APP_PATH
88
WORKDIR $APP_PATH
99

1010
RUN apk -U add alpine-sdk libgit2-dev git gcc nodejs
11-
RUN npm install -g yarn
1211
COPY ./dashboard/package.json $APP_PATH/dashboard/package.json
13-
COPY ./dashboard/yarn.lock $APP_PATH/dashboard/yarn.lock
1412
COPY ./server/configs/codeflow.yml /etc/codeflow.yml
15-
RUN cd $APP_PATH/dashboard/ && yarn install
13+
RUN cd $APP_PATH/dashboard/ && npm install
1614
COPY . /go/src/github.com/checkr/codeflow
1715

1816
WORKDIR $APP_PATH/server

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.PHONY: up server dashboard build
22

33
up:
4-
docker-compose run server /bin/sh -c 'cd server/ && go run main.go --config ./configs/codeflow.dev.yml migrate up'
4+
docker-compose run --rm server /bin/sh -c 'cd server/ && go run main.go --config ./configs/codeflow.dev.yml migrate up'
55
docker-compose up -d redis mongo
66
docker-compose up server dashboard
77

README.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@
22

33
Extendable deployment pipeline
44

5-
# Local Development
5+
# Local Development with Docker
66
Install [Docker Compose](https://docs.docker.com/compose/install/)
77

8-
Copy `server/codeflow.yml` to `server/codeflow.dev.yml`
8+
### Create DEV configs
9+
```
10+
$ cp server/codeflow.yml server/codeflow.dev.yml
11+
$ cp dashboard/.env dashboard/.env.development
12+
```
913

10-
To start the server and all dependencies run:
14+
### To start the server and all dependencies run:
1115
```
1216
$ make up
1317
```
18+
1419
Check `Makefile` to see what's happening under the hood.
1520

1621
Local dashboard will be started on [http://localhost:3000](http://localhost:3000)

dashboard/.env

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
NODE_ENV=
1+
NODE_ENV=development
22
REACT_APP_OKTA_CLIENT_ID=
33
REACT_APP_OKTA_URL=
44
REACT_APP_OKTA_LOGO=

dashboard/README.md

+6-8
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ It correctly bundles React in production mode and optimizes the build for the be
2222
The build is minified and the filenames include the hashes.<br>
2323
Your app is ready to be deployed!
2424

25-
### `npm run eject`
25+
### Updating npm packages
26+
```
27+
$ npm outdated
28+
$ npm outdated --depth=0 | grep -v Package | awk '{print $1}' | xargs -I% npm install %@latest --save
29+
```
30+
or [npm-check-updates](https://www.npmjs.com/package/npm-check-updates)
2631

27-
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
28-
29-
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
30-
31-
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
32-
33-
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

dashboard/package.json

+39-32
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,47 @@
44
"license": "MIT",
55
"private": true,
66
"devDependencies": {
7-
"babel-eslint": "^7.1.1",
8-
"eslint": "^3.12.2",
9-
"eslint-config-react-app": "^0.5.0",
10-
"react-dev-utils": "^0.3.0",
11-
"redux-devtools": "^3.3.1",
12-
"redux-devtools-dock-monitor": "^1.1.1",
13-
"redux-devtools-log-monitor": "^1.0.11",
14-
"redux-logger": "^2.6.1"
7+
"babel-eslint": "7.1.1",
8+
"eslint": "3.12.2",
9+
"eslint-config-react-app": "0.5.0",
10+
"react-dev-utils": "0.3.0",
11+
"redux-devtools": "3.3.1",
12+
"redux-devtools-dock-monitor": "1.1.1",
13+
"redux-devtools-log-monitor": "1.0.11",
14+
"redux-logger": "2.6.1"
1515
},
1616
"dependencies": {
17-
"bootstrap": "^4.0.0-alpha.5",
18-
"circular-json": "^0.3.1",
19-
"lodash": "^4.16.1",
20-
"moment": "^2.15.1",
21-
"ncp": "^2.0.0",
22-
"node-static": "^0.7.9",
23-
"pushstate-server": "^2.1.0",
24-
"query-string": "^4.2.3",
25-
"react": "^15.3.2",
26-
"react-addons-css-transition-group": "^15.4.1",
27-
"react-addons-transition-group": "^15.4.1",
28-
"react-dom": "^15.3.2",
29-
"react-fontawesome": "^1.2.0",
30-
"react-redux": "^4.4.5",
31-
"react-router": "^3.0.0",
32-
"react-router-redux": "^4.0.5",
33-
"react-scripts": "^0.7.0",
34-
"reactstrap": "^3.4.0",
35-
"redux": "^3.5.2",
36-
"redux-api-middleware": "^1.0.2",
37-
"redux-form": "^6.2.0",
38-
"redux-thunk": "^2.1.0",
39-
"replacestream": "^4.0.2",
40-
"underscore": "^1.8.3"
17+
"babel-eslint": "7.2.1",
18+
"bootstrap": "4.0.0-alpha.5",
19+
"circular-json": "0.3.1",
20+
"eslint": "3.18.0",
21+
"eslint-config-react-app": "0.6.2",
22+
"lodash": "4.17.4",
23+
"moment": "2.18.1",
24+
"ncp": "2.0.0",
25+
"node-static": "0.7.9",
26+
"pushstate-server": "3.0.0",
27+
"query-string": "4.3.2",
28+
"react": "15.4.2",
29+
"react-addons-css-transition-group": "15.4.2",
30+
"react-addons-transition-group": "15.4.2",
31+
"react-dev-utils": "0.5.2",
32+
"react-dom": "15.4.2",
33+
"react-fontawesome": "1.5.0",
34+
"react-redux": "5.0.3",
35+
"react-router": "3.0.3",
36+
"react-router-redux": "4.0.8",
37+
"react-scripts": "0.9.5",
38+
"reactstrap": "4.3.0",
39+
"redux": "3.6.0",
40+
"redux-api-middleware": "1.0.2",
41+
"redux-devtools": "3.3.2",
42+
"redux-devtools-log-monitor": "1.2.0",
43+
"redux-form": "6.6.1",
44+
"redux-logger": "3.0.1",
45+
"redux-thunk": "2.2.0",
46+
"replacestream": "4.0.2",
47+
"underscore": "1.8.3"
4148
},
4249
"scripts": {
4350
"lint": "eslint server.js src",

dashboard/src/config.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ import _ from 'underscore'
44

55
const loadConfig = () => {
66
let config = {}
7+
78
if (process.env.NODE_ENV === 'development') {
89
config = {
9-
"REACT_APP_ROOT": "http://localhost:3000",
10-
"REACT_APP_API_ROOT": "http://localhost:3001",
11-
"REACT_APP_WS_ROOT": "ws://localhost:3003",
12-
"REACT_APP_WEBHOOKS_ROOT": "http://localhost:3002",
10+
"REACT_APP_ROOT": "http://localhost:"+process.env.REACT_APP_ROOT_PORT,
11+
"REACT_APP_API_ROOT": "http://localhost:"+process.env.REACT_APP_API_ROOT_PORT,
12+
"REACT_APP_WS_ROOT": "ws://localhost:"+process.env.REACT_APP_WS_ROOT_PORT,
13+
"REACT_APP_WEBHOOKS_ROOT": "http://localhost:"+process.env.REACT_APP_WEBHOOKS_ROOT_PORT,
1314
"REACT_APP_OKTA_CLIENT_ID": process.env.REACT_APP_OKTA_CLIENT_ID,
1415
"REACT_APP_OKTA_URL": process.env.REACT_APP_OKTA_URL,
1516
"REACT_APP_OKTA_LOGO": process.env.REACT_APP_OKTA_LOGO,

dashboard/src/store/configureStore.dev.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createStore, applyMiddleware, compose } from 'redux'
22
import thunk from 'redux-thunk'
3-
import createLogger from 'redux-logger'
3+
import { createLogger } from 'redux-logger'
44
import rootReducer from '../reducers'
55
import DevTools from '../containers/DevTools'
66
import { apiMiddleware } from 'redux-api-middleware'

0 commit comments

Comments
 (0)