-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
melhorias de build, script de build com commander para melhor automat…
…ização
- Loading branch information
1 parent
9967bdf
commit d4916d4
Showing
7 changed files
with
64 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
NODE_ENV=development | ||
PORT=3000 | ||
PORT=3003 | ||
|
||
DB_HOST=localhost | ||
DB_VENDOR=postgres | ||
DB_SCHEMA=API | ||
DB_NAME=mydb | ||
DB_USER=joaopaulo | ||
DB_USER=jpts | ||
DB_PASS=postgres |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
node_modules | ||
coverage | ||
# variaveis de produção | ||
.env | ||
*.log |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env node | ||
const { exec } = require('child_process') | ||
const program = require("commander"); | ||
program | ||
.version(require('./package.json').version) | ||
.option('-p, --production', 'Build de produção') | ||
.option('-d, --development', 'Build de desenvolvimento') | ||
.option('-t, --test', 'Roda os testes') | ||
.parse(process.argv); | ||
|
||
if(program.production){ | ||
exec('cp .env.example .env') | ||
const npm = exec('yarn run production') | ||
npm.stdout.on('data', data=>{ | ||
console.log(data.toString()) | ||
}) | ||
npm.stderr.on('data', data=>{ | ||
console.log(data.toString()) | ||
}) | ||
npm.on('close', code=>{ | ||
console.log(code.toString()) | ||
}) | ||
|
||
} | ||
if(program.development){ | ||
exec('cp .env.example .env') | ||
const npm = exec('yarn run dev') | ||
npm.stdout.on('data', data=>{ | ||
console.log(data.toString()) | ||
}) | ||
npm.stderr.on('data', data=>{ | ||
console.log(data.toString()) | ||
}) | ||
npm.on('close', code=>{ | ||
console.log(code.toString()) | ||
}) | ||
} | ||
if(program.test){ | ||
//copia as varias que voce quer para serem executadas | ||
exec('cp .env.example .env') | ||
const npm = exec('yarn run test-integration-jest') | ||
npm.stdout.on('data', data=>{ | ||
console.log(data.toString()) | ||
}) | ||
npm.stderr.on('data', data=>{ | ||
console.log(data.toString()) | ||
}) | ||
npm.on('close', code=>{ | ||
console.log(code.toString()) | ||
}) | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -788,7 +788,7 @@ combined-stream@^1.0.5, combined-stream@~1.0.5: | |
dependencies: | ||
delayed-stream "~1.0.0" | ||
|
||
[email protected], commander@^2.9.0: | ||
[email protected], commander@^2.11.0, commander@^2.9.0: | ||
version "2.11.0" | ||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" | ||
|
||
|