Skip to content

Commit

Permalink
Merge pull request #14 from Sakuten/feature/13-auto-install
Browse files Browse the repository at this point in the history
Change: Improvement of development environment
  • Loading branch information
coord-e authored Jul 8, 2018
2 parents 42e1efe + fb2759e commit 776544c
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
build:
dockerfile: Dockerfile.dev
context: ${FRONTEND_DIR}
command: "start"
ports:
- "${PORT}:${PORT}"
- "8081:8081"
Expand All @@ -24,6 +25,7 @@ services:
- "REACT_APP_API_SERVER=http://${API_HOST}:${API_PORT}"
- "PORT=${PORT}"
- "HOST=0.0.0.0"
- "SHELL=/bin/sh"
working_dir: "/code"
volumes:
- "${FRONTEND_DIR}:/code"
Expand All @@ -41,7 +43,7 @@ services:
- FLASK_APP=app.py
- FLASK_ENV=development
- FLASK_DEBUG=1
command: "--port ${API_PORT} --host 0.0.0.0"
command: "bash -c 'pipenv run start:dep & flask run --port ${API_PORT} --host 0.0.0.0'"
working_dir: "/code"
volumes:
- "${BACKEND_DIR}:/code"
Expand Down
2 changes: 1 addition & 1 deletion frontend
Submodule frontend updated 57 files
+1 −1 .eslintrc
+59 −0 .github/ISSUE_TEMPLATE.md
+34 −0 .github/PULL_REQUEST_TEMPLATE.md
+18 −0 .travis.yml
+3 −2 Dockerfile.dev
+5 −0 config/setupTests.js
+22 −0 netlify.toml
+15 −5 package.json
+5 −0 src/api/operation/__mocks__/applyLottery.js
+8 −0 src/api/operation/__mocks__/authenicate.js
+5 −0 src/api/operation/__mocks__/cancelLottery.js
+56 −0 src/api/operation/__mocks__/getClassrooms.js
+232 −0 src/api/operation/__mocks__/getLotteries.js
+24 −0 src/api/operation/__mocks__/getStatus.js
+6 −0 src/api/operation/__mocks__/index.js
+8 −0 src/api/operation/applyLottery.js
+12 −0 src/api/operation/authenicate.js
+8 −0 src/api/operation/cancelLottery.js
+3 −0 src/api/operation/getClassrooms.js
+3 −0 src/api/operation/getLotteries.js
+9 −0 src/api/operation/getStatus.js
+6 −0 src/api/operation/index.js
+0 −0 src/api/request.js
+2 −2 src/component/ApplicationList.js
+2 −2 src/component/ClassroomSelect.js
+2 −2 src/component/ErrorList.js
+2 −2 src/component/LotterySelect.js
+63 −0 src/component/__tests__/ApplicationList.spec.js
+65 −0 src/component/__tests__/ClassroomSelect.spec.js
+33 −0 src/component/__tests__/ErrorList.spec.js
+91 −0 src/component/__tests__/LotterySelect.spec.js
+253 −0 src/component/__tests__/__snapshots__/ApplicationList.spec.js.snap
+194 −0 src/component/__tests__/__snapshots__/ClassroomSelect.spec.js.snap
+132 −0 src/component/__tests__/__snapshots__/ErrorList.spec.js.snap
+211 −0 src/component/__tests__/__snapshots__/LotterySelect.spec.js.snap
+0 −9 src/container/App.test.js
+2 −2 src/container/ApplicationView.js
+4 −4 src/container/LoginView.js
+46 −0 src/container/__tests__/App.spec.js
+59 −0 src/container/__tests__/ApplicationView.spec.js
+46 −0 src/container/__tests__/LoginView.spec.js
+98 −0 src/container/__tests__/__snapshots__/App.spec.js.snap
+168 −0 src/container/__tests__/__snapshots__/ApplicationView.spec.js.snap
+84 −0 src/container/__tests__/__snapshots__/LoginView.spec.js.snap
+39 −0 src/event/__tests__/application.spec.js
+42 −0 src/event/__tests__/credential.spec.js
+13 −0 src/event/__tests__/index.spec.js
+3 −13 src/event/application.js
+9 −19 src/event/credential.js
+41 −0 src/store/__tests__/application.spec.js
+56 −0 src/store/__tests__/credential.spec.js
+28 −0 src/store/__tests__/error.spec.js
+11 −0 src/store/__tests__/index.spec.js
+7 −11 src/store/application.js
+4 −11 src/store/credential.js
+1 −0 src/util/responsify.js
+1,466 −550 yarn.lock
12 changes: 12 additions & 0 deletions lint/Dockerfile.backend
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3.6-stretch

WORKDIR /code
COPY Pipfile /code

RUN pip install pipenv \
&& pipenv install --dev


ENTRYPOINT ["pipenv", "run"]

CMD ["fix"]
21 changes: 21 additions & 0 deletions lint/Dockerfile.frontend
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:8.11.2-stretch

ADD https://github.com/yarnpkg/yarn/releases/download/v1.7.0/yarn-v1.7.0.tar.gz /opt/yarn.tgz

WORKDIR /code
COPY package.json /code

RUN cd /opt \
&& tar xf yarn.tgz \
&& ln -s yarn-1.7.0/bin/yarn /bin/yarn \
&& cd /code \
&& yarn install --modules-folder /node_modules \
&& mkdir -p /node_modules/.bin \
&& for f in node_modules/.bin/*; do ln -sf "$(echo $(readlink $f) | sed -e 's|../../../node_modules/|../|g')" "/node_modules/.bin/$(basename $f)"; done \
&& rm -rf node_modules

ENV PATH="/node_modules/.bin:${PATH}"

ENTRYPOINT ["yarn", "run"]

CMD ["fix"]
16 changes: 16 additions & 0 deletions lint/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: "3"
services:
frontend:
build:
dockerfile: ../lint/Dockerfile.frontend
context: ../${FRONTEND_DIR}
command: "fix"
volumes:
- "../${FRONTEND_DIR}:/code"
backend:
build:
dockerfile: ../lint/Dockerfile.backend
context: ../${BACKEND_DIR}
command: "fix"
volumes:
- "../${BACKEND_DIR}:/code"

0 comments on commit 776544c

Please sign in to comment.