test.serial('Main flow using service ZEIT Now', t => { const subCommand = `now plek-integration-test.now.sh --team devoorhoede --app plek-test -- --public`; return promisify(exec)(`${t.context.cliPath} ${subCommand}`) .then(getStdout) .then(t.truthy); });
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; }) })
getProcessMemoryUsage (pid) { return execAsync(`awk '/VmRSS:/{ rss = $2 } END { print rss }' /proc/${pid}/status`) .then(stdout => Number(stdout)) }
exec('git remote update').then(gitVerify).catch(async () => { logger.warn('VERSION', 'Git commit checking failed, falling back to version checking') const SA = require('superagent') const local = require('../../package.json').version const stable = await SA.get('https://raw.githubusercontent.com/TheSharks/WildBeast/master/package.json') logger.log('VERSION', `Latest version: ${JSON.parse(stable.text).version}`) if (local !== JSON.parse(stable.text).version) { logger.warn('VERSION', 'Not up-to-date with remote version, update recommended') } })
yargs.command( 'deploy <command>', 'Run deploy step with custom command', {}, ({ command }) => { deploy( () => exec(command).then(({ stdout, stderr }) => { signale.note(stderr); return stdout; }) ); } );
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) })
}).then(function(result) { return exec('kubectl describe deploy nodejs') .then((res) => {
exec(`${nowBaseCommand} alias ${teamFlag} set ${url} $DOMAIN`) .then(processOutput) .then(() => { return `${url} now points to ${process.env.DOMAIN}` })
exec(getCurrentBranchName).then((branchName) =>
return exec('npm link', { cwd: file.from }).then(() => { return exec('npm link elastic-apm-node', { cwd: file.to
test.serial('Main flow using service Fly', t => { const subCommand = `fly plek-test`; return promisify(exec)(`${t.context.cliPath} ${subCommand}`) .then(getStdout) .then(t.truthy); });
getAvailableMemory () { return execAsync(`awk '/MemAvailable:/{ mem = $2 } END { print mem }' /proc/meminfo`) .then(stdout => Number(stdout)) }
exec(`${nowBaseCommand} alias ${teamFlag} set ${url} $DOMAIN`) .then(processOutput) .then(() => { return `${url} now points to ${process.env.DOMAIN}` })
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) })