Skip to content

Commit fc448b8

Browse files
committed
(feature) improve env command
1 parent 1ea38d3 commit fc448b8

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

publish.psd1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
git checkout nightly
2+
git add .
3+
git commit -m "(<type>) <message>"
4+
5+
yarn publish

src/commands/env.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,36 @@ export default class Env extends Base {
8181
const dockerComposerContent = this.readFile(Path.join(back, 'docker-compose.yml.example'))
8282
await this.writeFileNoOverride(dockerComposeFile, dockerComposerContent)
8383

84-
cli.action.start('# configuring backend', 'please wait', {stdout: true})
8584
try {
8685
const options = {cwd: back}
8786
const docker = (command: string) => this.execute(
8887
`docker exec ${short}-nginx bash -c "su -c '${command}' application"`,
8988
options
9089
)
9190

91+
cli.action.start('# initializing containers', 'please wait', {stdout: true})
9292
await this.execute('docker-compose up -d', options)
93+
cli.action.stop('containers running')
94+
95+
cli.action.start('# installing dependencies', 'please wait', {stdout: true})
9396
await docker('composer install')
97+
cli.action.stop('dependencies installed')
98+
99+
cli.action.start('# generating keys', 'please wait', {stdout: true})
94100
await docker('php artisan key:generate')
95101
await docker('php artisan jwt:secret --force')
102+
cli.action.stop('keys generated')
103+
104+
cli.action.start('# migration the database', 'please wait', {stdout: true})
96105
await docker('php artisan migrate:fresh')
106+
cli.action.stop('database ready')
107+
108+
cli.action.start('# stopping containers', 'please wait', {stdout: true})
97109
await this.execute('docker-compose down', options)
110+
cli.action.stop('containers stopped')
98111
} catch (error) {
99112
this.error(error)
100113
}
101-
cli.action.stop('all done')
102114

103115
this.positive(`
104116
To run the backend in dev mode use

0 commit comments

Comments
 (0)