From 62f7bfe9b17755760a2ea43ece1fdc27df91b2fe Mon Sep 17 00:00:00 2001 From: Wildan M Date: Fri, 8 Nov 2024 19:51:48 +0700 Subject: [PATCH] Add dnf userland install --- package-lock.json | 4 ++-- package.json | 2 +- src/executor/runnercode.js | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2cd5ba3..3ee866a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "domcloud-bridge", - "version": "0.67.0", + "version": "0.68.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "domcloud-bridge", - "version": "0.67.0", + "version": "0.68.0", "license": "MIT", "dependencies": { "cli": "^1.0.1", diff --git a/package.json b/package.json index 6ffe1dc..075d158 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "domcloud-bridge", - "version": "0.67.0", + "version": "0.68.0", "description": "Deployment runner for DOM Cloud", "main": "app.js", "engines": { diff --git a/src/executor/runnercode.js b/src/executor/runnercode.js index 6e4e733..04a3ba0 100644 --- a/src/executor/runnercode.js +++ b/src/executor/runnercode.js @@ -16,6 +16,22 @@ export async function runConfigCodeFeatures(key, value, writeLog, domaindata, ss await writeLog("$> Restarting passenger processes"); await writeLog(await logmanExec.restartPassenger(domaindata)); break; + case 'yum': + case 'dnf': + await writeLog("$> Setting up environment for yum installation"); + await writeLog(await logmanExec.restartPassenger(domaindata)); + await sshExec(`sed -i '/~/usr/lib64//d' ~/.bashrc`, false); + await sshExec(`pathman add ~/usr/bin`); + await sshExec(`echo "export LD_LIBRARY_PATH=~/usr/lib64/:$LD_LIBRARY_PATH" >> ~/.bashrc`) + if (value != "") { + await writeLog("$> Installing packages via yum"); + await sshExec(`mkdir -p ~/Downloads; pushd ~/Downloads`, false); + await sshExec(`dnf download ${value} --resolve -y`); + await sshExec(`rpm2cpio *.rpm | cpio -idmD ~`); + await sshExec(`popd`, false); + } + await sshExec(`. ~/.bashrc`, false) + break; case 'docker': if (value === '' || value === 'on') { await writeLog("$> Enabling docker features");