Skip to content

Commit

Permalink
Closes #24
Browse files Browse the repository at this point in the history
  • Loading branch information
01dr committed Oct 31, 2017
1 parent 8d79990 commit d78dbc7
Show file tree
Hide file tree
Showing 34 changed files with 9,451 additions and 12,952 deletions.
5 changes: 1 addition & 4 deletions .babelrc
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"presets": [
["env", {
"modules": false,
"targets": { "browsers": ["ie >= 10", "> 5%"] }
}]
["env"]
],
"plugins": [
"react-hot-loader/babel",
Expand Down
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
File renamed without changes.
2 changes: 2 additions & 0 deletions .env.stage
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
API_HOST=http://139.162.132.212:3000
DOMAIN=https://invest.jincor.com
27 changes: 1 addition & 26 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"extends": "airbnb-base",
"parser": "babel-eslint",
"env": {
"browser": true,
Expand All @@ -8,29 +7,5 @@
},
"plugins": [
"react"
],
"rules": {
"comma-dangle": 0,
"import/imports-first": 0,
"global-require": 0,
"class-methods-use-this": 0,
"arrow-body-style": [2, "as-needed"],
"arrow-parens": ["error", "always"],
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
"no-debugger": 0,
"no-console": 0,
"new-cap": 0,
"strict": 0,
"no-param-reassign": ["error", { "props": false }],
"no-underscore-dangle": 0,
"no-use-before-define": 0,
"import/no-named-as-default": 0,
"no-shadow": 0,
"eol-last": 0,
"quotes": [2, "single"],
"jsx-quotes": [0, "prefer-single"],
"react/jsx-no-undef": 1,
"react/jsx-uses-react": 1,
"react/jsx-uses-vars": 1
}
]
}
29 changes: 21 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
language: node_js
node_js:
- '6'
sudo: false
sudo: required
services:
- docker
branches:
only:
- master
- develop
cache:
directories:
- node_modules
before_install:
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- chmod ugo+x ./build.sh
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "production"; elif ["$TRAVIS_BRANCH"
== "develop"]; then echo "stage"; else echo "dev-$(git rev-parse --short HEAD)"
; fi`
- export ENV_FILE=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "prod";
else echo "stage"
; fi`
- "./build.sh $TAG $ENV_FILE"
install:
- npm install
- yarn
script:
- npm run eslint
- npm run stylelint
- npm run build
- docker build --no-cache -t frontend-supreme-happiness .
- docker run --rm frontend-supreme-happiness yarn run lint
- docker run --rm frontend-supreme-happiness yarn run test:CI
notifications:
slack:
secure: BwOGI5vLZ0nkbCGTPLBdUT4CH+P7eNPp4BvZBgkkPuZarIgwzViXeqCYsfTcyQ2/8grY3PWEBbX3UtKso+bysH6m/P2B3r0dRRxC21YEQa9g/u+hK+yvDRRtn3ZDAutw0RQAwX8xtXSb+yh2sT18ws9+WLFgmy9GS81WwXa6cf6V6GZZdE4Vt9MKroDIHpu/MPHeeQRn5I08RzqshujvIpEpjic7w0SdBKbdTjmBt0jkWRXd3UtWVEuEI2UDkrFMhX/mdiqtgeMU2h4vT/vuuAPsvDurJ8JkubPd3UFjePoCLlgZvhmTI6zO+RREQxwSfrtg763JFZonKYCoTwSz/2Q2I4WMR97HBwWi2e07shcwmwr6gWEi6dKPysRFmgHfqAcF72mT2trKFObGbEmm6JMxAsi628o/aktTojdbyfNJ3lnUwWDXjo8lSPaxAyrY1wUkDlyeTwhiKQoXUS2up/hH/Mz/CBmW3rJqzW4ypVSckVMEybC7sFqhd/6aIlG7UxfetUwRZ6cXyryryq7iiqiIDN9dxt6EpDgiWICkANq+b8MRQfJMBZcBQC391mN5X9EzxTjVShvs1+nSvX95es/QIs2D4lICQ5jruA+t4GgiDVuPvwYBq+HJxJmAylhdPA7g5iZTPi17UHWcfS2gC7TldTv3I41YCoh4CYKd5pY=
env:
global:
- secure: ggjzSXKOAnZvCul+A4AbK997NhFQF8K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mn0/cLcFL1JG/auoaSh5nPxkX9fZrhvQx/vY00spgT/Qu36iij3OVxD5fjQAGqTrxuIv+gw6vT5OisSw05DP7bi8kafVsja6CTlVAryWxLlOneos/93NNTYveyJT9sEWJugVxGOJegLHcLH75u/V0iGeW9L/p+ypmTyC8nKPFzrIg/VVOwbgK3Teb5Evy4HGIBblzirrdB7kOMNsL5NWrz2E/HLKAL39F7gp/NgLU0VVpd0H5AlQufIMN4R8D9j4NQ=
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM mhart/alpine-node:8

ARG ENV_FILE=stage

WORKDIR /usr/src/app
ADD . /usr/src/app/
RUN cp -r .env.${ENV_FILE} .env

RUN yarn
RUN yarn run build
8 changes: 8 additions & 0 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM mhart/alpine-node:8

WORKDIR /usr/src/app
ADD . /usr/src/app/
RUN cp -r .env.prod .env

RUN yarn
RUN yarn run build
9 changes: 9 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -ex
IMAGE_NAME="jincort/frontend-supreme-happiness"
TAG="${1}"
ENV_FILE="${2}"

docker build --build-arg ENV_FILE=${ENV_FILE} -t ${IMAGE_NAME}:${TAG} .
docker push ${IMAGE_NAME}:${TAG}
Loading

0 comments on commit d78dbc7

Please sign in to comment.