consterror="docker/docker-compose has not been installed, please follow instructions at: https://docs.budibase.com/self-hosting/hosting-methods/docker-compose#installing-docker"
constdocker=awaitlookpath("docker")
@ -48,28 +56,25 @@ async function init() {
console.log("Stopping.")
return
}
constpromises=[]
for(leturlofFILE_URLS){
constfileName=url.split("/").slice(-1)[0]
promises.push(downloadFile(url,`./${fileName}`))
}
awaitPromise.all(promises)
awaitdownloadFiles()
awaitenvFile.make()
}
asyncfunctionstart(){
awaitcheckDockerConfigured()
checkInitComplete()
console.log(info("Starting services, this may take a moment."))
constport=envFile.get("MAIN_PORT")
awaithandleError(async()=>{
awaitcompose.upAll({cwd:"./",log:false})
})
console.log(chalk.green(`Services started, please go to http://localhost:${port} for next steps.`))
console.log(success(`Services started, please go to http://localhost:${port} for next steps.`))
}
asyncfunctionstatus(){
awaitcheckDockerConfigured()
checkInitComplete()
console.log(info("Budibase status"))
awaithandleError(async()=>{
constresponse=awaitcompose.ps()
console.log(response.out)
@ -79,23 +84,31 @@ async function status() {
asyncfunctionstop(){
awaitcheckDockerConfigured()
checkInitComplete()
console.log(info("Stopping services, this may take a moment."))
awaithandleError(async()=>{
awaitcompose.stop()
})
console.log(success("Services have been stopped successfully."))
}
asyncfunctionupdate(){
awaitcheckDockerConfigured()
checkInitComplete()
if(awaitconfirmation("Do you wish to update you docker-compose.yaml and envoy.yaml?")){
awaitdownloadFiles()
}
awaithandleError(async()=>{
conststatus=awaitcompose.ps()
constparts=status.out.split("\n")
constisUp=parts[2]&&parts[2].indexOf("Up")!==-1
awaitcompose.stop()
console.log(chalk.cyan("Beginning update, this may take a few minutes."))
if(isUp){
console.log(info("Stopping services, this may take a moment."))
awaitcompose.stop()
}
console.log(info("Beginning update, this may take a few minutes."))