v1.0.12 - Sveltekit migration (#44)

Changed the whole tech stack to SvelteKit which means:
- Typescript 
- SSR
- No fastify :(
- Beta, but it's fine!

Other changes:
- Tailwind -> Tailwind JIT
- A lot more
This commit is contained in:
Andras Bacsai
2021-05-14 21:51:14 +02:00
committed by GitHub
parent cccb9a5fec
commit 23a4ebb74a
229 changed files with 7781 additions and 11333 deletions

View File

@@ -1,55 +1,36 @@
require('dotenv').config()
const { program } = require('commander')
const fastify = require('fastify')()
const { schema } = require('../api/schema')
const shell = require('shelljs')
const user = shell.exec('whoami', { silent: true }).stdout.replace('\n', '')
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.version('0.0.1');
program
.option('-d, --debug', 'Debug outputs.')
.option('-c, --check', 'Only checks configuration.')
.option('-t, --type <type>', 'Deploy type.')
.option('-d, --debug', 'Debug outputs.')
.option('-c, --check', 'Only checks configuration.')
.option('-t, --type <type>', 'Deploy type.');
program.parse(process.argv)
program.parse(process.argv);
const options = program.opts()
if (options.check) {
checkConfig().then(() => {
console.log('Config: OK')
}).catch((err) => {
console.log('Config: NOT OK')
console.error(err)
process.exit(1)
})
} else {
if (user !== 'root') {
console.error(`Please run as root! Current user: ${user}`)
process.exit(1)
}
shell.exec(`docker network create ${process.env.DOCKER_NETWORK} --driver overlay`, { silent: !options.debug })
shell.exec('docker build -t coolify -f install/Dockerfile .')
if (options.type === 'all') {
shell.exec('docker stack rm coollabs-coolify', { silent: !options.debug })
} else if (options.type === 'coolify') {
shell.exec('docker service rm coollabs-coolify_coolify')
} else if (options.type === 'proxy') {
shell.exec('docker service rm coollabs-coolify_proxy')
}
if (options.type !== 'upgrade') {
shell.exec('set -a && source .env && set +a && envsubst < install/coolify-template.yml | docker stack deploy -c - coollabs-coolify', { silent: !options.debug, shell: '/bin/bash' })
}
const options = program.opts();
if (user !== 'root') {
console.error(`Please run as root! Current user: ${user}`);
process.exit(1);
}
function checkConfig () {
return new Promise((resolve, reject) => {
fastify.register(require('fastify-env'), {
schema,
dotenv: true
})
.ready((err) => {
if (err) reject(err)
resolve()
})
})
shell.exec(`docker network create ${process.env.DOCKER_NETWORK} --driver overlay`, {
silent: !options.debug
});
shell.exec('docker build -t coolify -f install/Dockerfile .');
if (options.type === 'all') {
shell.exec('docker stack rm coollabs-coolify', { silent: !options.debug });
} else if (options.type === 'coolify') {
shell.exec('docker service rm coollabs-coolify_coolify');
} else if (options.type === 'proxy') {
shell.exec('docker service rm coollabs-coolify_proxy');
}
if (options.type !== 'upgrade') {
shell.exec(
'set -a && source .env && set +a && envsubst < install/coolify-template.yml | docker stack deploy -c - coollabs-coolify',
{ silent: !options.debug, shell: '/bin/bash' }
);
}