Converted deployment scripts to use pipenv instead of pip

This commit is contained in:
VakarisZ 2021-04-15 11:11:11 +03:00 committed by Mike Salvatore
parent c00754a3a4
commit 47f1bd31cc
2 changed files with 23 additions and 11 deletions

View File

@ -139,14 +139,22 @@ fi
${python_cmd} get-pip.py ${python_cmd} get-pip.py
rm 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" log_message "Installing island requirements"
requirements_island="$ISLAND_PATH/requirements.txt" pushd $ISLAND_PATH
${python_cmd} -m pip install -r "${requirements_island}" --user --upgrade || handle_error pipenv install --dev
popd
log_message "Installing monkey requirements" log_message "Installing monkey requirements"
sudo apt-get install -y libffi-dev upx libssl-dev libc++1 sudo apt-get install -y libffi-dev upx libssl-dev libc++1
requirements_monkey="$INFECTION_MONKEY_DIR/requirements.txt" pushd $INFECTION_MONKEY_DIR
${python_cmd} -m pip install -r "${requirements_monkey}" --user --upgrade || handle_error pipenv install --dev
popd
agents=${3:-true} agents=${3:-true}
# Download binaries # Download binaries

View File

@ -126,15 +126,19 @@ function Deploy-Windows([String] $monkey_home = (Get-Item -Path ".\").FullName,
return return
} }
"Installing pipx"
pip install --user -U pipx
pipx ensurepath
pipx install pipenv
"Installing python packages for island" "Installing python packages for island"
$islandRequirements = Join-Path -Path $monkey_home -ChildPath $MONKEY_ISLAND_DIR | Join-Path -ChildPath "\requirements.txt" -ErrorAction Stop Push-Location -Path (Join-Path -Path $monkey_home -ChildPath $MONKEY_ISLAND_DIR) -ErrorAction Stop
& python -m pip install --user -r $islandRequirements pipenv install --dev
Pop-Location
"Installing python packages for monkey" "Installing python packages for monkey"
$monkeyRequirements = Join-Path -Path $monkey_home -ChildPath $MONKEY_DIR | Join-Path -ChildPath "\requirements.txt" Push-Location -Path (Join-Path -Path $monkey_home -ChildPath $MONKEY_DIR) -ErrorAction Stop
& python -m pip install --user -r $monkeyRequirements pipenv install --dev
"Installing python packages for ScoutSuite" Pop-Location
$scoutsuiteRequirements = Join-Path -Path $monkey_home -ChildPath $SCOUTSUITE_DIR | Join-Path -ChildPath "\requirements.txt"
& python -m pip install --user -r $scoutsuiteRequirements
Configure-precommit($monkey_home) Configure-precommit($monkey_home)