You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
964 B
32 lines
964 B
11 months ago
|
#!/usr/bin/node
|
||
|
|
||
|
import { program } from 'commander'
|
||
|
import chalk from 'chalk'
|
||
|
|
||
|
import { command, execSync, log } from './../helpers/command.js'
|
||
|
|
||
|
/**
|
||
|
* mongodb.js
|
||
|
*
|
||
|
* installing Mongodb 7.0
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
// getting arguments
|
||
|
const destination = program.args[0]
|
||
|
|
||
|
// creating
|
||
|
try {
|
||
|
log(chalk.green('Mongodb > start install'))
|
||
|
command('apt-get install -y gnupg curl')
|
||
|
command('curl -fsSL https://pgp.mongodb.com/server-7.0.asc | gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor')
|
||
|
command('echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list')
|
||
|
command('apt-get update')
|
||
|
command('apt-get install -y mongodb-org mongodb-mongosh')
|
||
|
|
||
|
log(chalk.green('Mongodb > starting Service'))
|
||
|
command('systemctl start mongod')
|
||
|
command('systemctl enable mongod')
|
||
|
} catch(error) {
|
||
|
|
||
|
}
|