Skip to content

Commit

Permalink
Merge pull request #114 from secret-tech/develop
Browse files Browse the repository at this point in the history
v1.4.0
  • Loading branch information
01dr authored Mar 29, 2018
2 parents 9ca5421 + ba3252d commit 980516a
Show file tree
Hide file tree
Showing 141 changed files with 3,500 additions and 3,626 deletions.
12 changes: 0 additions & 12 deletions .babelrc

This file was deleted.

Empty file modified .editorconfig
100755 → 100644
Empty file.
36 changes: 0 additions & 36 deletions .eslintrc

This file was deleted.

21 changes: 0 additions & 21 deletions .stylelintrc

This file was deleted.

43 changes: 17 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,27 @@ branches:
only:
- master
- develop
cache:
directories:
- node_modules
install:
- yarn
script:
- export ENV_FILE=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "prod";
else echo "stage"
; fi`
- 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`
- docker build --no-cache -t jincort/frontend-supreme-happiness-develop:${TAG} .
- docker run --rm -v $(pwd):/usr/src/app jincort/frontend-supreme-happiness-develop:${TAG} yarn
- docker run --rm -v $(pwd):/usr/src/app jincort/frontend-supreme-happiness-develop:${TAG} cp -r .env.${ENV_FILE} .env
- docker run --rm -v $(pwd):/usr/src/app jincort/frontend-supreme-happiness-develop:${TAG} yarn build
- docker run --rm -v $(pwd):/usr/src/app jincort/frontend-supreme-happiness-develop:${TAG} yarn run lint
- docker run --rm -v $(pwd):/usr/src/app jincort/frontend-supreme-happiness-develop:${TAG} yarn run test:CI
- export ENV_FILE=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "prod"; else echo
"stage"; fi`
- 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`
- docker build --no-cache -t jincort/frontend-ico-dashboard-develop:${TAG} .
- docker run --rm -v $(pwd):/usr/src/app jincort/frontend-ico-dashboard-develop:${TAG}
/bin/sh -c "yarn && cp -r .env.${ENV_FILE} .env && yarn build && yarn run lint:all"
after_success:
- 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 DOCKERFILE=`if [ "$TRAVIS_BRANCH" == "develop" ]; then echo "Dockerfile.stage";
else echo "Dockerfile.prod" ; fi`
- docker build -f $DOCKERFILE --no-cache -t jincort/frontend-ico-dashboard:${TAG}
.
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- docker build -f Dockerfile.prod --no-cache -t jincort/frontend-supreme-happiness:${TAG} .
- docker push jincort/frontend-supreme-happiness-develop:${TAG}
- docker push jincort/frontend-supreme-happiness:${TAG}
- docker push jincort/frontend-ico-dashboard-develop:${TAG}
- docker push jincort/frontend-ico-dashboard:${TAG}
notifications:
slack:
secure: BwOGI5vLZ0nkbCGTPLBdUT4CH+P7eNPp4BvZBgkkPuZarIgwzViXeqCYsfTcyQ2/8grY3PWEBbX3UtKso+bysH6m/P2B3r0dRRxC21YEQa9g/u+hK+yvDRRtn3ZDAutw0RQAwX8xtXSb+yh2sT18ws9+WLFgmy9GS81WwXa6cf6V6GZZdE4Vt9MKroDIHpu/MPHeeQRn5I08RzqshujvIpEpjic7w0SdBKbdTjmBt0jkWRXd3UtWVEuEI2UDkrFMhX/mdiqtgeMU2h4vT/vuuAPsvDurJ8JkubPd3UFjePoCLlgZvhmTI6zO+RREQxwSfrtg763JFZonKYCoTwSz/2Q2I4WMR97HBwWi2e07shcwmwr6gWEi6dKPysRFmgHfqAcF72mT2trKFObGbEmm6JMxAsi628o/aktTojdbyfNJ3lnUwWDXjo8lSPaxAyrY1wUkDlyeTwhiKQoXUS2up/hH/Mz/CBmW3rJqzW4ypVSckVMEybC7sFqhd/6aIlG7UxfetUwRZ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yZSWRj4WgkkBJIxpNH6FGeUnCFc1eddHcdd30R5nS9Ya/Gs6uhjndBh/q8wFrDC7DJ0e6TV8IEL+nWSdlNYYQ3GtaUI8tYPmvI/4ttPEs4iCa46cKVgE86lcc+f2AjJftNcEbZhXXhZUW5Au8eAZO7s1GD55dD16uFJMvshna3RR8qL2St9QbUX+KQeZa7YPOg+Uvku83/fug9Tm+5JCY+nQ1MVSbyFVzoE+9TVk0qKnIo39wr+oMyAAVZ7TLi+6M009sRg123Sa6edo1wI77CdeS6j4CfydasZvS3V6hAfNEQpdxtVDbAcn7jMd+S5bUz3WAoEOnKcE1GG6SLuFuA73WM=
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM mhart/alpine-node:8

USER root
ARG ENV_FILE=stage

VOLUME /usr/src/app
Expand Down
25 changes: 25 additions & 0 deletions Dockerfile.stage
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM node:8.0.0-alpine

WORKDIR /usr/src/app

ARG APIHOST=http://ico-api.stage.jincor.com
ARG DOMAINARG=http://invest.stage.jincor.com

ENV API_HOST=$APIHOST
ENV DOMAIN=$DOMAINARG

ADD . /usr/src/app/
ADD .env.stage .env

RUN apk add --no-cache --update nginx && \
rm -rf /var/cache/apk/*

RUN yarn && yarn build && \
rm -rf ./src ./node_modules /usr/local/lib/node_modules /usr/local/share/.cache/yarn/ && \
mkdir -p /run/nginx

ADD ./nginx-stage/default.conf /etc/nginx/conf.d/default.conf

ENTRYPOINT ["/usr/sbin/nginx", "-g", "daemon off;"]

EXPOSE 80
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Jincor

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
36 changes: 30 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,42 @@
# Jincor Investor Dashboard Frontend

[![Build Status](https://travis-ci.com/JincorTech/frontend-supreme-happiness.svg?token=zhVTspsPSE9j1Tuwzqe2&branch=develop)](https://travis-ci.com/JincorTech/frontend-supreme-happiness)
[![Build Status](https://travis-ci.org/JincorTech/frontend-ico-dashboard.svg?branch=develop)](https://travis-ci.org/JincorTech/frontend-ico-dashboard)

### Commit hooks

That boilerplate uses pre-commit hooks and run some scripts before making git commit. To see what is started before commit check package.json pre-commit block. Default - `yarn lint:all` and `yarn test`. To ignore the check, use `-n` e.g `git commit -n -m 'Your amazing commit msg'`.

### Environment variables

``cp .env.example .env`` - copy example dotenv file and specify your own values in `.env`

You can use different environment variables. Create `.env.stage`, `.env.prod` and `.env.dev` and copy the file you need.

To access values inside application call `console.log(process.env)`.

### Scripts

``npm install``
``yarn start`` - start application in development mode

``yarn build`` - build application into `/dist` directory

``yarn build:clean`` - remove prev `/dist` and build application

``yarn serve`` - serve `/dist` directory. Requires build application before run

``yarn lint:js`` - run eslint

``yarn lint:css`` - run stylelint

``yarn lint:all`` - run eslint and stylelint concurrently

``npm start`` - start application in development mode
``yarn test`` - run jest

``npm run build`` - build application into `/dist` directory
``yarn test:coverage`` - jest coverage

``npm run eslint`` - run eslint
``yarn test:watch`` - jest in watch mode

``npm run stylelint`` - run stylelint
``yarn analyze`` - analyze webpack bundle

______________________________

Expand Down
12 changes: 9 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#!/bin/bash

set -ex
DEV_IMAGE_NAME="jincort/frontend-supreme-happiness-develop"
PROD_IMAGE_NAME="jincort/frontend-supreme-happiness"
DEV_IMAGE_NAME="jincort/frontend-ico-dashboard-develop"
PROD_IMAGE_NAME="jincort/frontend-ico-dashboard"
TAG="${1}"

docker push ${DEV_IMAGE_NAME}:${TAG}
docker build -f Dockerfile.prod --no-cache -t ${PROD_IMAGE_NAME}:${TAG} .

if [ "$TAG" == "stage" ]; then
docker build -f Dockerfile.stage -t ${PROD_IMAGE_NAME}:${TAG} .
else
docker build -f Dockerfile.prod --no-cache -t ${PROD_IMAGE_NAME}:${TAG} .
fi

docker push ${PROD_IMAGE_NAME}:${TAG}
12 changes: 12 additions & 0 deletions nginx-stage/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
server {
listen 80 default_server;
listen [::]:80 default_server;

root /usr/src/app/dist;

location / {
index index.html index.htm;
autoindex off;
try_files $uri /index.html;
}
}
Loading

0 comments on commit 980516a

Please sign in to comment.