@adp-psych/container-tools
Version:
Tools for using containers for psychology experiments
62 lines (52 loc) • 1.74 kB
JavaScript
/*
* Copyright (C) 2021 Anthony Di Pietro
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* @file Installs [Wave](https://github.com/wave-k8s/wave)
* to a [Kubernetes](https://kubernetes.io/) cluster
* using [Helm](https://helm.sh/).
*
* @requires install-wave
* @author Anthony Di Pietro <anthony.dipietro@research.uwa.edu.au>
* @copyright © 2021 Anthony Di Pietro
* @license AGPL-3.0-or-later
*/
const installWave = require('../lib/install-wave.js');
const BINARY_NAME = 'install-wave';
const DEFAULT_WAVE_VERSION = '2.0.0';
const usage = () => {
console.error(`Usage: ${BINARY_NAME} [version]`);
console.error('');
console.error(`Example: ${BINARY_NAME} 2.0.0`);
};
const main = async () => {
const version = process.argv[2] ?? DEFAULT_WAVE_VERSION;
if (version === '--help' || version === '-h') {
usage();
} else {
try {
await installWave(version);
} catch (error) {
/* eslint-disable require-atomic-updates --
* False positive. */
process.exitCode = error;
/* eslint-enable require-atomic-updates --
* Reenabling. */
}
}
};
main();