Skip to content

Commit

Permalink
Updated installation script to install a specific version of the soft…
Browse files Browse the repository at this point in the history
…ware. (#159)

* Version passing

* Added sanity check and installation for jq and notebook

* Corrected variable name

* Updated

* Updated installation instructions
  • Loading branch information
asa1997 authored May 20, 2024
1 parent 433775f commit a70fc52
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ BeSman is designed to work with linux machines. So, if you are a windows user, y

curl -L https://raw.githubusercontent.com/Be-Secure/BeSman/dist/dist/get.besman.io | bash


If you want to install a specific version, use the following command, replacing X.Y.Z with the desired version:

export BESMAN_VERSION=X.Y.Z
curl -L https://raw.githubusercontent.com/Be-Secure/BeSman/dist/dist/get.besman.io | bash

2. Source the files into memory

source $HOME/.besman/bin/besman-init.sh
Expand Down
29 changes: 28 additions & 1 deletion scripts/tmpl/get.besman.io.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,25 @@ export BESMAN_SERVICE="https://raw.githubusercontent.com"
# BESMAN_DIST_BRANCH=${BESMAN_DIST_BRANCH:-REL-${BESMAN_VERSION}}

BESMAN_NAMESPACE="@BES_NAMESPACE@"
BESMAN_VERSION="@BES_VERSION@"
BESMAN_VERSION="${BESMAN_VERSION:-@BES_VERSION@}"

BESMAN_ENV_REPOS="$BESMAN_NAMESPACE/besecure-ce-env-repo"
# BESMAN_DIST_BRANCH=${BESMAN_DIST_BRANCH:-REL-${BESMAN_VERSION}}

if [[ -z $(command -v jq) ]]
then
echo "Installing jq"
sudo apt update && sudo apt install jq -y
fi

echo "Checking version number"
releases=$(curl -s --silent "https://api.github.com/repos/$BESMAN_NAMESPACE/BESMAN/releases" | jq -r '.[].tag_name')

if ! echo "$releases" | grep -q "^$BESMAN_VERSION$"; then
echo "Version $BESMAN_VERSION is not a valid release in repository $repo."
exit 1
fi

if [[ -z "$BESMAN_DIR" ]]; then
export BESMAN_DIR="$HOME/.besman"
fi
Expand Down Expand Up @@ -188,6 +203,18 @@ if [[ -z $(which gh) ]]; then

fi

if [[ -z $(command -v pip) ]]
then
echo "Installing pip"
sudo apt install python3-pip -y
fi

if [[ -z $(command -v jupyter) ]]
then
echo "Installing jupyter notebook"
python3 -m pip install notebook
fi

if [[ "$solaris" == true ]]; then
echo "Looking for gsed..."
if [ -z $(which gsed) ]; then
Expand Down

0 comments on commit a70fc52

Please sign in to comment.