2019-03-03 22:51:52 +00:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
var { exec } = require('./utils/exec');
|
|
|
|
var fs = require('fs');
|
|
|
|
|
|
|
|
async function main() {
|
|
|
|
console.log('Build authelia-example-backend docker image.')
|
|
|
|
await exec('docker build -t authelia-example-backend example/compose/nginx/backend');
|
|
|
|
|
2019-03-24 14:15:49 +00:00
|
|
|
console.log('Build authelia-duo-api docker image.')
|
|
|
|
await exec('docker build -t authelia-duo-api example/compose/duo-api');
|
|
|
|
|
2019-03-03 22:51:52 +00:00
|
|
|
if (!fs.existsSync('/tmp/kind')) {
|
|
|
|
console.log('Install Kind for spawning a Kubernetes cluster.');
|
|
|
|
await exec('wget https://github.com/clems4ever/kind/releases/download/0.1.0-cmic1/kind-linux-amd64 -O /tmp/kind && chmod +x /tmp/kind');
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!fs.existsSync('/tmp/kubectl')) {
|
|
|
|
console.log('Install Kubectl for interacting with Kubernetes.');
|
|
|
|
await exec('wget https://storage.googleapis.com/kubernetes-release/release/v1.13.0/bin/linux/amd64/kubectl -O /tmp/kubectl && chmod +x /tmp/kubectl');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
main().catch((err) => {
|
|
|
|
console.error(err);
|
|
|
|
process.exit(1);
|
|
|
|
})
|