Skip to content

Commit

Permalink
feat: added condition to prevent pusher time offset (#5982)
Browse files Browse the repository at this point in the history
* feat: added condition to prevent pusher time offset

* refactor: added end text for multiple exists

* chore: linting
  • Loading branch information
bashleigh authored Jan 26, 2022
1 parent 03522c3 commit c80b8bf
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions packages/cli/src/commands/pipeline/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ export class PipelineCreate extends AbstractCommand {

const pipeline = await this.createPipeline(answers, spinner)

if (pipeline.buildStatus === 'READY_FOR_DEPLOYMENT') {
spinner.info('Existing pipeline reset & updated')
await this.serialisePipelineJson(pipeline)
this.end(spinner, pipeline)
process.exit(0)
}

spinner.start('Connecting to socket...')
const pusher = await this.pusher()

Expand Down Expand Up @@ -231,21 +238,22 @@ export class PipelineCreate extends AbstractCommand {
process.exit(1)
} else if (event.buildStatus === 'READY_FOR_DEPLOYMENT') {
await this.serialisePipelineJson(event)

spinner.succeed('🚀 Successfully architectured')
this.writeLine('')
this.writeLine("Now you're ready to deploy to your pipeline!")
this.writeLine(
`To do so, either use ${chalk.green('reapit pipeline deploy-zip')} or ${chalk.green(
'reapit pipeline deploy-repo',
)}`,
)
this.writeLine('')
this.writeLine(
`You can visit your domain here ${chalk.green(`https://${event.subDomain}.dev.paas.reapit.cloud`)}`,
)
process.exit(0)
this.end(spinner, event)
}
})
}

end(spinner, event) {
spinner.succeed('🚀 Successfully architectured')
this.writeLine('')
this.writeLine("Now you're ready to deploy to your pipeline!")
this.writeLine(
`To do so, either use ${chalk.green('reapit pipeline deploy-zip')} or ${chalk.green(
'reapit pipeline deploy-repo',
)}`,
)
this.writeLine('')
this.writeLine(`You can visit your domain here ${chalk.green(`https://${event.subDomain}.dev.paas.reapit.cloud`)}`)
process.exit(0)
}
}

0 comments on commit c80b8bf

Please sign in to comment.