Skip to content

Commit

Permalink
Debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
rbamos committed Jul 12, 2024
1 parent 3ca41f3 commit e29d4c9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,24 @@
MIN_OS_VERSION="12.4.0"
kernel_name=$(uname -s)

sudo rm -f /tmp/leapp-setup.log

# If the utils.sh file is not present, download & run it
if [[ ! -e "utils.sh" ]]; then
eval "$(curl -Ls 'https://raw.githubusercontent.com/panorama-ed/leapp-setup/main/utils.sh')"
else
. ./utils.sh
fi

echo "$LINENO" >> /tmp/leapp-setup.log

if [[ "$kernel_name" != 'Darwin' ]] && [[ "$kernel_name" != 'Linux' ]]; then
red_echo "This script is only supported on MacOS and Linux."
exit
fi

echo "$LINENO" >> /tmp/leapp-setup.log

if [[ "$kernel_name" == 'Darwin' ]]; then
CURRENT_OS_VERSION=$(sw_vers -productVersion)
# use version sorting to check if the current version is less than $MIN_OS_VERSION
Expand All @@ -29,17 +35,22 @@ if [[ "$kernel_name" == 'Darwin' ]]; then
fi
fi

echo "$LINENO" >> /tmp/leapp-setup.log

if [[ "${CONFIGURE}" != "0" ]] && [[ -z "${INTEGRATION_PORTAL_URL}" ]]; then
red_echo "INTEGRATION_PORTAL_URL must be provided"
exit
fi

echo "$LINENO" >> /tmp/leapp-setup.log

if [[ "${CONFIGURE}" != "0" ]] && [[ -z "${LEAPP_ROLES}" ]]; then
red_echo "LEAPP_ROLES must be provided"
exit
fi

echo "$LINENO" >> /tmp/leapp-setup.log

# Install Homebrew if not installed
# This may optionally install the Xcode CLT if it is not already installed.
if ! which brew > /dev/null ; then
Expand Down Expand Up @@ -71,6 +82,8 @@ if ! which brew > /dev/null ; then
fi
fi

echo "$LINENO" >> /tmp/leapp-setup.log

if [[ "$kernel_name" == "Darwin" ]]; then
# The AWS CLI requires python
brew install python
Expand All @@ -83,17 +96,23 @@ elif [[ "$kernel_name" == "Linux" ]]; then
sudo apt install -y awscli
fi

echo "$LINENO" >> /tmp/leapp-setup.log

# If using an M1 machine, add a symlink for the AWS credential files to where Leapp expects them
if [[ "$kernel_name" == "Darwin" ]] && [[ $(uname -m) == 'arm64' ]]; then
sudo ln -s /opt/homebrew/bin/aws /usr/local/bin/aws
fi

echo "$LINENO" >> /tmp/leapp-setup.log

# If the app store version of filezilla is installed, it expects the .aws credentials
# to be in the filezilla installation directory. Add a symlink there.
if [[ "$kernel_name" == "Darwin" ]] && [ -d ~/Library/Containers/org.filezilla-project.filezilla.sandbox ]; then
ln -s ~/.aws ~/Library/Containers/org.filezilla-project.filezilla.sandbox/Data/.aws
fi

echo "$LINENO" >> /tmp/leapp-setup.log

# Install session manager plugin
if [[ "$kernel_name" == "Darwin" ]]; then
brew install --cask session-manager-plugin
Expand All @@ -104,6 +123,8 @@ elif [[ "$kernel_name" == "Linux" ]] && ! dpkg -l session-manager-plugin; then
rm session-manager-plugin.deb
fi

echo "$LINENO" >> /tmp/leapp-setup.log

# Install Leapp CLI
if [[ "$kernel_name" == "Darwin" ]]; then
brew install Noovolari/brew/leapp-cli
Expand All @@ -124,13 +145,19 @@ else [[ "$kernel_name" == "Linux" ]]
# brew install Noovolari/brew/leapp-cli
fi

echo "$LINENO" >> /tmp/leapp-setup.log

if [[ "${CONFIGURE}" == "0" ]]; then
exit
fi

echo "$LINENO" >> /tmp/leapp-setup.log

# If the config.sh file is not present, download & run it
if [[ ! -e "config.sh" ]]; then
eval "$(curl -Ls 'https://raw.githubusercontent.com/panorama-ed/leapp-setup/main/config.sh')"
else
. ./config.sh
fi

echo "$LINENO" >> /tmp/leapp-setup.log

0 comments on commit e29d4c9

Please sign in to comment.