From 47f1bd31ccc90dcf14fb20d6bbcc916198b6f737 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Thu, 15 Apr 2021 11:11:11 +0300 Subject: [PATCH] Converted deployment scripts to use pipenv instead of pip --- deployment_scripts/deploy_linux.sh | 16 ++++++++++++---- deployment_scripts/deploy_windows.ps1 | 18 +++++++++++------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/deployment_scripts/deploy_linux.sh b/deployment_scripts/deploy_linux.sh index 072e14af8..7e9debba2 100755 --- a/deployment_scripts/deploy_linux.sh +++ b/deployment_scripts/deploy_linux.sh @@ -139,14 +139,22 @@ fi ${python_cmd} get-pip.py rm get-pip.py +log_message "Installing pipenv" +${python_cmd} -m pip install --user -U pipx +${python_cmd} -m pipx ensurepath +source ~/.profile +pipx install pipenv + log_message "Installing island requirements" -requirements_island="$ISLAND_PATH/requirements.txt" -${python_cmd} -m pip install -r "${requirements_island}" --user --upgrade || handle_error +pushd $ISLAND_PATH +pipenv install --dev +popd log_message "Installing monkey requirements" sudo apt-get install -y libffi-dev upx libssl-dev libc++1 -requirements_monkey="$INFECTION_MONKEY_DIR/requirements.txt" -${python_cmd} -m pip install -r "${requirements_monkey}" --user --upgrade || handle_error +pushd $INFECTION_MONKEY_DIR +pipenv install --dev +popd agents=${3:-true} # Download binaries diff --git a/deployment_scripts/deploy_windows.ps1 b/deployment_scripts/deploy_windows.ps1 index 3438c554b..20f600f51 100644 --- a/deployment_scripts/deploy_windows.ps1 +++ b/deployment_scripts/deploy_windows.ps1 @@ -126,15 +126,19 @@ function Deploy-Windows([String] $monkey_home = (Get-Item -Path ".\").FullName, return } + "Installing pipx" + pip install --user -U pipx + pipx ensurepath + pipx install pipenv + "Installing python packages for island" - $islandRequirements = Join-Path -Path $monkey_home -ChildPath $MONKEY_ISLAND_DIR | Join-Path -ChildPath "\requirements.txt" -ErrorAction Stop - & python -m pip install --user -r $islandRequirements + Push-Location -Path (Join-Path -Path $monkey_home -ChildPath $MONKEY_ISLAND_DIR) -ErrorAction Stop + pipenv install --dev + Pop-Location "Installing python packages for monkey" - $monkeyRequirements = Join-Path -Path $monkey_home -ChildPath $MONKEY_DIR | Join-Path -ChildPath "\requirements.txt" - & python -m pip install --user -r $monkeyRequirements - "Installing python packages for ScoutSuite" - $scoutsuiteRequirements = Join-Path -Path $monkey_home -ChildPath $SCOUTSUITE_DIR | Join-Path -ChildPath "\requirements.txt" - & python -m pip install --user -r $scoutsuiteRequirements + Push-Location -Path (Join-Path -Path $monkey_home -ChildPath $MONKEY_DIR) -ErrorAction Stop + pipenv install --dev + Pop-Location Configure-precommit($monkey_home)