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

OTEL-2289 fix ocb component build script #31941

Merged
merged 3 commits into from
Dec 10, 2024
Merged
Changes from 2 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
12 changes: 12 additions & 0 deletions test/otel/testdata/ocb_build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@ OTELCOL_PID=0

mkdir -p /tmp/otel-ci
trap 'rm -rf /tmp/otel-ci && kill $OTELCOL_PID' EXIT
current_dir=$(pwd)
replaces="/tmp/otel-ci/replaces"
# Get path of all datadog modules, in sorted order, without the initial dot
dd_mods=$(find . -type f -name "go.mod" -exec dirname {} \; | sort | sed 's/.//')
echo "replaces:" >> "$replaces"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my version of the script I had this intermediary replaces file because I potentially had multiple ocb builds to do, but here you can probably pipe the replace statements directly into /tmp/otel-ci/builder-config.yaml.

for mod in $dd_mods; do
echo "- github.com/DataDog/datadog-agent$mod => $current_dir$mod" >> "$replaces"
done

cp ./test/otel/testdata/builder-config.yaml /tmp/otel-ci/
cat "$replaces" >> /tmp/otel-ci/builder-config.yaml
echo "added all datadog-agent modules to ocb builder-config replacements"

cp ./test/otel/testdata/collector-config.yaml /tmp/otel-ci/
cp ./tools/ci/retry.sh /tmp/otel-ci/
chmod +x /tmp/otel-ci/retry.sh
Expand Down
Loading