@@ -56,14 +56,57 @@ function build() {
56
56
# Build the virtualization package
57
57
#
58
58
logmust cd " $WORKDIR /repo/appliance"
59
+
60
+ local args=()
61
+
62
+ # Here we check for whether the environment variables are set and pass them along. We check for
63
+ # existence instead of emptiness to avoid adding a layer of interpretation.
64
+
65
+ # We use parameter expansion in the form of ${variable+nothing} which evaluates to the variable
66
+ # 'nothing' if 'variable' is not set. Because 'nothing' is not defined it evaluates to "" when 'variable'
67
+ # is not set. So [[ "" ]] is what is actually evaluated when 'variable' is not set.
68
+
69
+ if [[ ${SECRET_DB_USE_JUMPBOX+nothing} ]]; then
70
+ args+=(" -DSECRET_DB_USE_JUMPBOX=$SECRET_DB_USE_JUMPBOX " )
71
+ fi
72
+
73
+ if [[ ${SECRET_DB_JUMP_BOX_HOST+nothing} ]]; then
74
+ args+=(" -DSECRET_DB_JUMP_BOX_HOST=$SECRET_DB_JUMP_BOX_HOST " )
75
+ fi
76
+
77
+ if [[ ${SECRET_DB_JUMP_BOX_USER+nothing} ]]; then
78
+ args+=(" -DSECRET_DB_JUMP_BOX_USER=$SECRET_DB_JUMP_BOX_USER " )
79
+ fi
80
+
81
+ if [[ ${SECRET_DB_JUMP_BOX_PRIVATE_KEY+nothing} ]]; then
82
+ if [[ ! -f " $SECRET_DB_JUMP_BOX_PRIVATE_KEY " ]]; then
83
+ die " Jumpbox private key not found."
84
+ fi
85
+ args+=(" -DSECRET_DB_JUMP_BOX_PRIVATE_KEY=$SECRET_DB_JUMP_BOX_PRIVATE_KEY " )
86
+ fi
87
+
88
+ if [[ ${SECRET_DB_AWS_ENDPOINT+nothing} ]]; then
89
+ args+=(" -DSECRET_DB_AWS_ENDPOINT=$SECRET_DB_AWS_ENDPOINT " )
90
+ fi
91
+
92
+ if [[ ${SECRET_DB_AWS_PROFILE+nothing} ]]; then
93
+ args+=(" -DSECRET_DB_AWS_PROFILE=$SECRET_DB_AWS_PROFILE " )
94
+ fi
95
+
96
+ if [[ ${SECRET_DB_AWS_REGION+nothing} ]]; then
97
+ args+=(" -DSECRET_DB_AWS_REGION=$SECRET_DB_AWS_REGION " )
98
+ fi
99
+
100
+ args+=(" -Ddockerize=true" )
101
+ args+=(" -DbuildJni=true" )
102
+
59
103
if [[ -n " $DELPHIX_RELEASE_VERSION " ]]; then
60
- logmust ant -Ddockerize=true -DbuildJni=true \
61
- -DhotfixGenDlpxVersion=" $DELPHIX_RELEASE_VERSION " \
62
- -Dbuild.legacy.resources.war=true all package
63
- else
64
- logmust ant -Ddockerize=true -DbuildJni=true all package
104
+ args+=(" -DhotfixGenDlpxVersion=$DELPHIX_RELEASE_VERSION " )
105
+ args+=(" -Dbuild.legacy.resources.war=true" )
65
106
fi
66
107
108
+ logmust ant " ${args[@]} " all-secrets package
109
+
67
110
#
68
111
# Publish the virtualization package artifacts
69
112
#
0 commit comments