Skip to content

Commit

Permalink
fix build errors
Browse files Browse the repository at this point in the history
Signed-off-by: Eliott Bouhana <[email protected]>
  • Loading branch information
eliottness committed Jan 9, 2025
1 parent 700c3dc commit ee2309e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 25 deletions.
20 changes: 2 additions & 18 deletions utils/build/docker/golang/install_ddtrace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,15 @@ else
go get -v -d -u gopkg.in/DataDog/dd-trace-go.v1
fi

# Install orchestrion
if [ -n "$INSTALL_ORCHESTRION" ]; then
if [ -e "/binaries/orchestrion" ]; then
echo "Install from folder /binaries/orchestrion"
go mod edit -replace github.com/DataDog/orchestrion=/binaries/orchestrion
go -C /binaries/orchestrion build -o "$(go env GOPATH)/bin/orchestrion" .
elif [ -e "/binaries/orchestrion-load-from-go-get" ]; then
echo "Install from go get -d $(cat /binaries/orchestrion-load-from-go-get)"
go install "$(cat /binaries/orchestrion-load-from-go-get)"
else
echo "Installing production orchestrion"
go install github.com/DataDog/orchestrion@latest
fi
fi


# Downloading a newer version of the tracer may require to resolve again all dependencies
go mod tidy

# Read the library version out of the version.go file
lib_mod_dir=$(go list -f '{{.Dir}}' -m gopkg.in/DataDog/dd-trace-go.v1)
version=$(sed -nrE 's#.*"v(.*)".*#\1#p' $lib_mod_dir/internal/version/version.go) # Parse the version string content "v.*"
echo $version > SYSTEM_TESTS_LIBRARY_VERSION
echo "$version" > SYSTEM_TESTS_LIBRARY_VERSION

rules_mod_dir=$(go list -f '{{.Dir}}' -m github.com/DataDog/appsec-internal-go)
rules_mod_dir="$(go list -f '{{.Dir}}' -m github.com/DataDog/appsec-internal-go)"


echo "dd-trace-go version: $(cat /app/SYSTEM_TESTS_LIBRARY_VERSION)"
23 changes: 23 additions & 0 deletions utils/build/docker/golang/install_orchestrion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -euv

if [ -e "/binaries/orchestrion" ]; then
echo "Install from folder /binaries/orchestrion"
go mod edit -replace github.com/DataDog/orchestrion=/binaries/orchestrion
go -C /binaries/orchestrion build -o "$(go env GOPATH)/bin/orchestrion" .
elif [ -e "/binaries/orchestrion-load-from-go-get" ]; then
echo "Install from go get -d $(cat /binaries/orchestrion-load-from-go-get)"
go install "$(cat /binaries/orchestrion-load-from-go-get)"
else
echo "Installing production orchestrion"
go install github.com/DataDog/orchestrion@latest
fi

orchestrion pin

output="$(orchestrion version)"
version="${output#"orchestrion "}"
echo "$version" > SYSTEM_TESTS_ORCHESTRION_VERSION

echo "orchestrion version: $(cat /app/SYSTEM_TESTS_ORCHESTRION_VERSION)"
10 changes: 3 additions & 7 deletions utils/build/docker/golang/net-http-orchestrion.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@ RUN go mod download && go mod verify
COPY utils/build/docker/golang/app /app

# download the proper tracer version
COPY utils/build/docker/golang/install_ddtrace.sh binaries* /binaries/
RUN INSTALL_ORCHESTRION=true /binaries/install_ddtrace.sh
COPY utils/build/docker/golang/install_*.sh binaries* /binaries/
RUN /binaries/install_ddtrace.sh && /binaries/install_orchestrion.sh

ENV DD_ORCHESTRION_IS_GOMOD_VERSION=true

RUN orchestrion pin

RUN orchestrion go build -v -tags appsec -o weblog ./net-http-orchestrion
RUN DD_ORCHESTRION_IS_GOMOD_VERSION=true orchestrion go build -v -tags appsec -o weblog ./net-http-orchestrion

# ==============================================================================

Expand Down

0 comments on commit ee2309e

Please sign in to comment.