16
16
17
17
set -euo pipefail
18
18
19
- WXS_PATH=" /project/internal/buildscripts/packaging/msi/splunk-otel-collector.wxs"
20
- OTELCOL=" /project/bin/otelcol_windows_amd64.exe"
21
- AGENT_CONFIG=" /project/cmd/otelcol/config/collector/agent_config.yaml"
22
- GATEWAY_CONFIG=" /project/cmd/otelcol/config/collector/gateway_config.yaml"
23
- FLUENTD_CONFIG=" /project/internal/buildscripts/packaging/fpm/etc/otel/collector/fluentd/fluent.conf"
24
- FLUENTD_CONFD=" /project/internal/buildscripts/packaging/msi/fluentd/conf.d"
25
- SUPPORT_BUNDLE_SCRIPT=" /project/internal/buildscripts/packaging/msi/splunk-support-bundle.ps1"
26
- SPLUNK_ICON=" /project/internal/buildscripts/packaging/msi/splunk.ico"
27
- OUTPUT_DIR=" /project/dist"
19
+ # This script builds the Splunk OpenTelemetry MSI from the project available at ${PROJECT_DIR}.
20
+ PROJECT_DIR=${PROJECT_DIR:-/ project}
21
+ WORK_DIR=${WORK_DIR:-/ work}
22
+
23
+ WXS_PATH=" ${PROJECT_DIR} /internal/buildscripts/packaging/msi/splunk-otel-collector.wxs"
24
+ OTELCOL=" ${PROJECT_DIR} /bin/otelcol_windows_amd64.exe"
25
+ AGENT_CONFIG=" ${PROJECT_DIR} /cmd/otelcol/config/collector/agent_config.yaml"
26
+ GATEWAY_CONFIG=" ${PROJECT_DIR} /cmd/otelcol/config/collector/gateway_config.yaml"
27
+ FLUENTD_CONFIG=" ${PROJECT_DIR} /internal/buildscripts/packaging/fpm/etc/otel/collector/fluentd/fluent.conf"
28
+ FLUENTD_CONFD=" ${PROJECT_DIR} /internal/buildscripts/packaging/msi/fluentd/conf.d"
29
+ SUPPORT_BUNDLE_SCRIPT=" ${PROJECT_DIR} /internal/buildscripts/packaging/msi/splunk-support-bundle.ps1"
30
+ SPLUNK_ICON=" ${PROJECT_DIR} /internal/buildscripts/packaging/msi/splunk.ico"
31
+ OUTPUT_DIR=" ${PROJECT_DIR} /dist"
28
32
JMX_METRIC_GATHERER_RELEASE=" 1.29.0"
29
33
30
34
usage () {
31
35
cat << EOH >&2
32
36
usage: ${BASH_SOURCE[0]} [OPTIONS] VERSION
33
37
34
38
Description:
35
- Build the Splunk OpenTelemetry MSI from the project available at /project .
39
+ Build the Splunk OpenTelemetry MSI from the project available at ${PROJECT_DIR} .
36
40
By default, the MSI is saved as '${OUTPUT_DIR} /splunk-otel-collector-VERSION-amd64.msi'.
37
41
38
42
OPTIONS:
@@ -133,7 +137,7 @@ parse_args_and_build() {
133
137
fi
134
138
135
139
set -x
136
- build_dir=" /work /build"
140
+ build_dir=" ${WORK_DIR} /build"
137
141
files_dir=" ${build_dir} /msi"
138
142
msi_name=" splunk-otel-collector-${version} -amd64.msi"
139
143
@@ -155,21 +159,21 @@ parse_args_and_build() {
155
159
jmx_metrics_jar=" ${build_dir} /opentelemetry-java-contrib-jmx-metrics.jar"
156
160
157
161
# kludge to satisfy relative path in splunk-otel-collector.wxs
158
- mkdir -p /work /internal/buildscripts/packaging/msi
159
- cp " ${splunk_icon} " " /work /internal/buildscripts/packaging/msi/splunk.ico"
162
+ mkdir -p ${WORK_DIR} /internal/buildscripts/packaging/msi
163
+ cp " ${splunk_icon} " " ${WORK_DIR} /internal/buildscripts/packaging/msi/splunk.ico"
160
164
161
- cd /work
165
+ cd ${WORK_DIR}
162
166
configFilesWsx=" ${build_dir} /configfiles.wsx"
163
- heat dir " $files_dir " -srd -sreg -gg -template fragment -cg ConfigFiles -dr INSTALLDIR -out " ${configFilesWsx// \/ / \\ } "
167
+ heat dir " $files_dir " -srd -sreg -gg -template fragment -cg ConfigFiles -dr INSTALLDIR -out " ${configFilesWsx} "
164
168
165
169
configFilesWixObj=" ${build_dir} /configfiles.wixobj"
166
- candle -arch x64 -out " ${configFilesWixObj// \/ / \\ } " " ${configFilesWsx// \/ / \\ } "
170
+ candle -arch x64 -out " ${configFilesWixObj} " " ${configFilesWsx} "
167
171
168
172
collectorWixObj=" ${build_dir} /splunk-otel-collector.wixobj"
169
- candle -arch x64 -out " ${collectorWixObj// \/ / \\ } " -dVersion=" $version " -dOtelcol=" $otelcol " -dJmxMetricsJar=" $jmx_metrics_jar " " ${WXS_PATH// \/ / \\ } "
173
+ candle -arch x64 -out " ${collectorWixObj} " -dVersion=" $version " -dOtelcol=" $otelcol " -dJmxMetricsJar=" $jmx_metrics_jar " " ${WXS_PATH} "
170
174
171
175
msi=" ${build_dir} /${msi_name} "
172
- light -ext WixUtilExtension.dll -sval -out " ${msi// \/ / \\ } " -b " ${files_dir// \/ / \\ } " " ${collectorWixObj// \/ / \\ } " " ${configFilesWixObj// \/ / \\ } "
176
+ light -ext WixUtilExtension.dll -sval -out " ${msi} " -b " ${files_dir} " " ${collectorWixObj} " " ${configFilesWixObj} "
173
177
174
178
mkdir -p $output
175
179
cp " ${msi} " " ${output} /${msi_name} "
0 commit comments