Created
April 18, 2019 18:41
-
-
Save webislife/f937409591e67fad34a97ab67f9da7b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
tasks: | |
#Start\stop project | |
up: | |
desc: "Обновление зависимостей проекта" | |
cmds: | |
- yarn install | |
start: | |
desc: "Старт проекта" | |
cmds: | |
- task: up | |
- task: pm2-dev | |
stop: | |
desc: "Остановка проекта" | |
cmds: | |
- node_modules/.bin/pm2 del all | |
#Test\lint section | |
lint: | |
desc: "Run eslint" | |
cmds: | |
- node_modules/.bin/eslint ./src --color --config ./config/.eslintrc.js --fix | |
test-build: | |
desc: "Build тесты проекта, только для тестирования sources" | |
cmds: | |
- node_modules/.bin/mocha ./test/mocha --exit --colors | |
#Docs section | |
doc-sass: | |
desc: "Make frontend sass docs see docs/sass/index.html" | |
cmds: | |
- node_modules/.bin/sassdoc ./src/sass/_context.scss -d ./docs/sass | |
doc-js: | |
desc: "Make frontend js doc see docs/js/index.html" | |
cmds: | |
- node_modules/.bin/esdoc -c config/esdoc.conf.json | |
# PM2 Section | |
start-pm2: | |
cmds: | |
- APP_ENV={{.ENV}} ./node_modules/pm2/bin/pm2 startOrReload config/pm2.config.js --env {{.ENV}} | |
pm2-dev: | |
cmds: | |
- task: start-pm2 | |
vars: {ENV: "development"} | |
pm2-staging: | |
cmds: | |
- task: start-pm2 | |
vars: {ENV: "staging"} | |
pm2-prod: | |
cmds: | |
- task: start-pm2 | |
vars: {ENV: "production"} | |
default: | |
cmds: | |
- task --list | |
# Build Section | |
build: | |
cmds: | |
- export $(node -e "const ENV = require('./config/env.{{.ENV}}.js'); for(const key in ENV) console.log(key + '=' + ENV[key])") && ./node_modules/.bin/webpack --progress --colors --config build/webpack.client.js | |
- export $(node -e "const ENV = require('./config/env.{{.ENV}}.js'); for(const key in ENV) console.log(key + '=' + ENV[key])") && ./node_modules/.bin/webpack --progress --colors --config build/webpack.server.js | |
build-production: | |
desc: "Build bundle in production mode" | |
cmds: | |
- task: build | |
vars: {ENV: "production"} | |
build-development: | |
desc: "Build bundle in development mode" | |
cmds: | |
- task: build | |
vars: {ENV: "development"} | |
build-staging: | |
desc: "Build bundle in staging mode" | |
cmds: | |
- task: build | |
vars: {ENV: "staging"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment