Skip to content

Commit

Permalink
Include default /etc/splunk/zeroconfig_node.conf in deb/rpm packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyc-splunk committed Aug 28, 2023
1 parent 6859631 commit c9c53da
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions instrumentation/packaging/fpm/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ LIBSPLUNK_INSTALL_PATH="${INSTALL_DIR}/libsplunk.so"
JAVA_AGENT_INSTALL_PATH="${INSTALL_DIR}/splunk-otel-javaagent.jar"
JAVA_CONFIG_REPO_PATH="${FPM_DIR}/zeroconfig_java.conf"
JAVA_CONFIG_INSTALL_PATH="/etc/splunk/zeroconfig_java.conf"
NODE_CONFIG_REPO_PATH="${FPM_DIR}/zeroconfig_node.conf"
NODE_CONFIG_INSTALL_PATH="/etc/splunk/zeroconfig_node.conf"
EXAMPLES_INSTALL_DIR="${INSTALL_DIR}/examples"
EXAMPLES_DIR="${FPM_DIR}/examples"

Expand Down Expand Up @@ -102,6 +104,10 @@ setup_files_and_permissions() {
cp -f "$JAVA_CONFIG_REPO_PATH" "$buildroot/$JAVA_CONFIG_INSTALL_PATH"
sudo chmod 644 "$buildroot/$JAVA_CONFIG_INSTALL_PATH"

mkdir -p "$buildroot/$(dirname $NODE_CONFIG_INSTALL_PATH)"
cp -f "$NODE_CONFIG_REPO_PATH" "$buildroot/$NODE_CONFIG_INSTALL_PATH"
sudo chmod 644 "$buildroot/$NODE_CONFIG_INSTALL_PATH"

mkdir -p "$buildroot/$INSTALL_DIR"
cp -rf "$EXAMPLES_DIR" "$buildroot/$INSTALL_DIR/"
sudo chmod -R 644 "$buildroot/$EXAMPLES_INSTALL_DIR"
Expand Down
1 change: 1 addition & 0 deletions instrumentation/packaging/fpm/deb/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ sudo fpm -s dir -t deb -n "$PKG_NAME" -v "$VERSION" -f -p "$OUTPUT_DIR" \
--depends sed \
--depends grep \
--config-files "$JAVA_CONFIG_INSTALL_PATH" \
--config-files "$NODE_CONFIG_INSTALL_PATH" \
"$buildroot/"=/

dpkg -c "${OUTPUT_DIR}/${PKG_NAME}_${VERSION}_${ARCH}.deb"
1 change: 1 addition & 0 deletions instrumentation/packaging/fpm/rpm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ sudo fpm -s dir -t rpm -n "$PKG_NAME" -v "$VERSION" -f -p "$OUTPUT_DIR" \
--depends sed \
--depends grep \
--config-files "$JAVA_CONFIG_INSTALL_PATH" \
--config-files "$NODE_CONFIG_INSTALL_PATH" \
"$buildroot/"=/

rpm -qpli "${OUTPUT_DIR}/${PKG_NAME}-${VERSION}-1.${ARCH}.rpm"
1 change: 1 addition & 0 deletions instrumentation/packaging/fpm/zeroconfig_node.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NODE_OPTIONS=-r @splunk/otel/instrument
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
LIBSPLUNK_PATH = "/usr/lib/splunk-instrumentation/libsplunk.so"
JAVA_CONFIG_PATH = "/etc/splunk/zeroconfig_java.conf"
CUSTOM_JAVA_CONFIG_PATH = TESTS_DIR / "instrumentation" / "libsplunk-java-test.conf"
NODE_CONFIG_PATH = "/etc/splunk/zeroconfig_node.conf"
SAMPLE_JAVA_SYSTEMD_CONF_PATH = "/usr/lib/splunk-instrumentation/examples/systemd/00-splunk-otel-javaagent.conf"
SAMPLE_NODE_SYSTEMD_CONF_PATH = "/usr/lib/splunk-instrumentation/examples/systemd/00-splunk-otel-js.conf"
CUSTOM_SYSTEMD_CONF_PATH = TESTS_DIR / "instrumentation" / "systemd-test.conf"
Expand All @@ -59,6 +60,7 @@
NODEJS_AGENT_PATH,
LIBSPLUNK_PATH,
JAVA_CONFIG_PATH,
NODE_CONFIG_PATH,
SAMPLE_JAVA_SYSTEMD_CONF_PATH,
SAMPLE_NODE_SYSTEMD_CONF_PATH,
]
Expand Down

0 comments on commit c9c53da

Please sign in to comment.