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