@adp-psych/container-tools
Version:
Tools for using containers for psychology experiments
50 lines (45 loc) • 1.56 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 Creates a
* [DigitalOcean domain](https://docs.digitalocean.com/products/networking/dns/)
* using [doctl](https://docs.digitalocean.com/reference/doctl/).
*
* @module module:create-digitalocean-domain
* @requires console-exec
* @author Anthony Di Pietro <anthony.dipietro@research.uwa.edu.au>
* @copyright © 2021 Anthony Di Pietro
* @license AGPL-3.0-or-later
*/
const {consoleSpawn} = require('./console-exec.js');
/**
* Creates a DigitalOcean domain using doctl.
*
* @static
* @param {String} domainName - The domain name.
* @example
* createDigitaloceanDomain('example.com'); // Creates the DigitalOcean domain.
*/
const createDigitaloceanDomain = async (domainName) => {
await consoleSpawn('doctl', [
'compute',
'domain',
'create',
domainName,
]);
};
module.exports = createDigitaloceanDomain;