it('should deploy the manifests', function() { var manifest_directory = path.normalize(path.join(path.dirname(__filename), '..', '/deploy')) const exec = util.promisify(require('child_process').exec); return exec('kubectl apply -f '+manifest_directory) .then((res) => { // console.log(util.inspect(res)); expect(res.stdout).to.not.be.null; expect(res.stderr).to.be.empty; }, (err) => { expect(err).to.be.null; }) })
Promise.resolve().then(async () => { if (!username) { throw new Error('missing postgres username as first argument') } await exec(`dropdb republik`) .then(r => console.log(r.stdout, r.stderr)) .catch(e => {}) await exec(`createdb republik`) .then(r => console.log(r.stdout, r.stderr)) const DATABASE_URL = `postgres://${username}@localhost:5432/republik` await exec(`pg_dump postgres://${username}@localhost:5432/postgres | psql ${DATABASE_URL}`) .then(r => console.log(r.stdout, r.stderr)) }) .then(() => { process.exit(0) })
expect(res.stderr).to.be.empty; }, (err) => { expect(err).to.be.null;
Promise.resolve().then(async () => { if (!username) { throw new Error('missing postgres username as first argument') } await exec(`dropdb republik`) .then(r => console.log(r.stdout, r.stderr)) .catch(e => {}) await exec(`createdb republik`) .then(r => console.log(r.stdout, r.stderr)) const DATABASE_URL = `postgres://${username}@localhost:5432/republik` await exec(`pg_dump postgres://${username}@localhost:5432/postgres | psql ${DATABASE_URL}`) .then(r => console.log(r.stdout, r.stderr)) }) .then(() => { process.exit(0) })