Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate folder name #419

Merged
merged 3 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions modules/aws/sonar-base-instance/setup.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function install_tarball() {

echo Installing tarball..
# Installing tarball
sudo tar -xf $TARBALL_FILE -gz -C $APPS_DIR
sudo tar -xf $TARBALL_FILE -gz -C $APPS_DIR --strip-components=2
rm $TARBALL_FILE
sudo chown -R sonarw:sonar $APPS_DIR
}
Expand All @@ -184,7 +184,7 @@ verlt() {

function setup() {
set_instance_fqdn
VERSION=$(ls $APPS_DIR/jsonar/apps -Art | tail -1)
VERSION=$(ls $APPS_DIR -Art | tail -1)
echo Setup sonar $VERSION

password=$(/usr/local/bin/aws secretsmanager get-secret-value --secret-id ${password_secret} --query SecretString --output text)
Expand All @@ -195,7 +195,7 @@ function setup() {
PRODUCT="data-security-fabric"
fi

sudo $APPS_DIR/jsonar/apps/"$VERSION"/bin/sonarg-setup --no-interactive \
sudo "$APPS_DIR/$VERSION/bin/sonarg-setup" --no-interactive \
--accept-eula \
--jsonar-uid-display-name "${display_name}" \
--product "$PRODUCT" \
Expand Down Expand Up @@ -281,7 +281,13 @@ __EOF__
DATA_DIR="${base_directory}/data"
LOGS_DIR="${base_directory}/logs"
LOCAL_DIR="${base_directory}/local"
APPS_DIR="${base_directory}/apps"

APPS_DIR="${base_directory}"
if ! [[ $APPS_DIR =~ ^.*/jsonar/?$ ]]; then
# if does not end with jsonar folder, add jsonar to the end
APPS_DIR="$APPS_DIR/jsonar"
fi
APPS_DIR="$APPS_DIR/apps"

install_deps
create_users_and_groups
Expand Down
14 changes: 10 additions & 4 deletions modules/azurerm/sonar-base-instance/setup.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function install_tarball() {

echo Installing tarball..
# Installing tarball
sudo tar -xf $TARBALL_FILE -gz -C $APPS_DIR
sudo tar -xf $TARBALL_FILE -gz -C $APPS_DIR --strip-components=2
rm $TARBALL_FILE
sudo chown -R sonarw:sonar $APPS_DIR
}
Expand All @@ -185,7 +185,7 @@ verlt() {

function setup() {
set_instance_fqdn
VERSION=$(ls $APPS_DIR/jsonar/apps -Art | tail -1)
VERSION=$(ls "$APPS_DIR" -Art | tail -1)
echo Setup sonar $VERSION

password=$(az keyvault secret show --vault-name ${vault_name} --name ${password_secret} --query 'value' --output tsv)
Expand All @@ -196,7 +196,7 @@ function setup() {
PRODUCT="data-security-fabric"
fi

sudo $APPS_DIR/jsonar/apps/"$VERSION"/bin/sonarg-setup --no-interactive \
sudo "$APPS_DIR/$VERSION/bin/sonarg-setup" --no-interactive \
--accept-eula \
--jsonar-uid-display-name "${display_name}" \
--product "$PRODUCT" \
Expand Down Expand Up @@ -284,7 +284,13 @@ function firewall_open_ports() {
DATA_DIR="${base_directory}/data"
LOGS_DIR="${base_directory}/logs"
LOCAL_DIR="${base_directory}/local"
APPS_DIR="${base_directory}/apps"

APPS_DIR="${base_directory}"
if ! [[ $APPS_DIR =~ ^.*/jsonar/?$ ]]; then
# if does not end with jsonar folder, add jsonar to the end
APPS_DIR="$APPS_DIR/jsonar"
fi
APPS_DIR="$APPS_DIR/apps"

install_deps
firewall_open_ports || true
Expand Down
Loading