Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
tmp/
/artifacts/
.idea
53 changes: 48 additions & 5 deletions packages/virtualization/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,57 @@ function build() {
# Build the virtualization package
#
logmust cd "$WORKDIR/repo/appliance"

local args=()

# Because ant does not read the environment variables of the execution context, we set them as
# parameters only if they exist in the execution context

# Here we check for whether the environment variables are set and pass them along. We check for
# existence instead of emptiness to avoid adding a layer of interpretation.

# We use parameter expansion in the form of ${variable+nothing} which evaluates to the variable
# 'nothing' if 'variable' is not set. Because 'nothing' is not defined it evaluates to "" when 'variable'
# is not set. So [[ "" ]] is what is actually evaluated when 'variable' is not set.

if [[ ${SECRET_DB_USE_JUMPBOX+nothing} ]]; then
args+=("-DSECRET_DB_USE_JUMPBOX=\"$SECRET_DB_USE_JUMPBOX\"")
fi

if [[ ${SECRET_DB_JUMP_BOX_HOST+nothing} ]]; then
args+=("-DSECRET_DB_JUMP_BOX_HOST=\"$SECRET_DB_JUMP_BOX_HOST\"")
fi

if [[ ${SECRET_DB_JUMP_BOX_USER+nothing} ]]; then
args+=("-DSECRET_DB_JUMP_BOX_USER=\"$SECRET_DB_JUMP_BOX_USER\"")
fi

if [[ ${SECRET_DB_JUMP_BOX_PRIVATE_KEY+nothing} ]]; then
args+=("-DSECRET_DB_JUMP_BOX_PRIVATE_KEY=\"$SECRET_DB_JUMP_BOX_PRIVATE_KEY\"")
fi

if [[ ${SECRET_DB_AWS_ENDPOINT+nothing} ]]; then
args+=("-DSECRET_DB_AWS_ENDPOINT=\"$SECRET_DB_AWS_ENDPOINT\"")
fi

if [[ ${SECRET_DB_AWS_PROFILE+nothing} ]]; then
args+=("-DSECRET_DB_AWS_PROFILE=\"$SECRET_DB_AWS_PROFILE\"")
fi

if [[ ${SECRET_DB_AWS_REGION+nothing} ]]; then
args+=("-DSECRET_DB_AWS_REGION=\"$SECRET_DB_AWS_REGION\"")
fi

args+=("-Ddockerize=true")
args+=("-DbuildJni=true")

if [[ -n "$DELPHIX_RELEASE_VERSION" ]]; then
logmust ant -Ddockerize=true -DbuildJni=true \
-DhotfixGenDlpxVersion="$DELPHIX_RELEASE_VERSION" \
-Dbuild.legacy.resources.war=true all package
else
logmust ant -Ddockerize=true -DbuildJni=true all package
args+=("-DhotfixGenDlpxVersion=\"$DELPHIX_RELEASE_VERSION\"")
args+=("-Dbuild.legacy.resources.war=true")
fi

logmust ant "${args[@]}" all-secrets package

#
# Publish the virtualization package artifacts
#
Expand Down