Revert "v1.0.2 (#8)" (#9)

This reverts commit b91bfa21b3.
This commit is contained in:
Andras Bacsai
2021-03-30 22:15:37 +02:00
committed by GitHub
parent 73d3d43215
commit a1cccd479e
18 changed files with 124 additions and 180 deletions

21
install/update.js Normal file
View File

@@ -0,0 +1,21 @@
require('dotenv').config()
const { program } = require('commander')
const shell = require('shelljs')
const user = shell.exec('whoami', { silent: true }).stdout.replace('\n', '')
program.version('0.0.1')
program
.option('-d, --debug', 'Debug outputs.')
.option('-c, --check', 'Only checks configuration.')
.option('-t, --type <type>', 'Deploy type.')
program.parse(process.argv)
if (user !== 'root') {
console.error(`Please run as root! Current user: ${user}`)
process.exit(1)
}
if (program.type === 'upgrade') {
shell.exec('docker service rm coollabs-coolify_coolify')
shell.exec('set -a && source .env && set +a && envsubst < install/coolify-template.yml | docker stack deploy -c - coollabs-coolify', { silent: !program.debug, shell: '/bin/bash' })
}