2021-07-12 12:24:29 -04:00
|
|
|
const services = require('./services')
|
|
|
|
|
|
|
|
console.log('#!/bin/bash')
|
|
|
|
console.log('set -ex')
|
|
|
|
|
|
|
|
switch (process.argv.pop()) {
|
|
|
|
case 'install':
|
2022-02-07 06:46:51 -05:00
|
|
|
console.log('npm ci')
|
2021-07-12 12:24:29 -04:00
|
|
|
break
|
|
|
|
case 'compile':
|
|
|
|
for (const service of services) {
|
2022-02-01 11:39:55 -05:00
|
|
|
console.log('pushd', `services/${service.name}`)
|
2021-07-12 12:24:29 -04:00
|
|
|
switch (service.name) {
|
|
|
|
case 'web':
|
|
|
|
console.log('npm run webpack:production')
|
|
|
|
// drop webpack/babel cache
|
|
|
|
console.log('rm -rf node_modules/.cache')
|
|
|
|
break
|
|
|
|
default:
|
|
|
|
console.log(`echo ${service.name} does not require a compilation`)
|
|
|
|
}
|
|
|
|
console.log('popd')
|
|
|
|
}
|
|
|
|
break
|
|
|
|
default:
|
|
|
|
console.error('unknown command')
|
|
|
|
console.log('exit 101')
|
|
|
|
process.exit(101)
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log('set +x')
|
|
|
|
console.log(
|
|
|
|
'rm -rf /root/.cache /root/.npm $(find /tmp/ -mindepth 1 -maxdepth 1)'
|
|
|
|
)
|