Skip to content

Commit

Permalink
[builds] fix build_in_docker scripts (#5688)
Browse files Browse the repository at this point in the history
* ignore bin/obj folders in docker

* fix powershell syntax error

* stop the ps1 script on errors

* no need to change directory

* oops
  • Loading branch information
lucaspimentel authored Jun 13, 2024
1 parent 1c5f274 commit 5435901
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 3 additions & 0 deletions tracer/build/_build/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/bin/
**/obj/
**/*.user
5 changes: 2 additions & 3 deletions tracer/build_in_docker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ Param(
[string[]]$BuildArguments
)

# in case we are being run from outside this directory
Set-Location $PSScriptRoot
$ErrorActionPreference = "Stop"

$ROOT_DIR="$PSScriptRoot/.."
$BUILD_DIR="$ROOT_DIR/tracer/build/_build"
Expand All @@ -18,7 +17,7 @@ $IMAGE_NAME="dd-trace-dotnet/alpine-base"
"$BUILD_DIR"

&docker run -it --rm `
--mount type=bind,source="$ROOT_DIR",target=/project `
--mount "type=bind,source=$ROOT_DIR,target=/project" `
--env NugetPackageDirectory=/project/packages `
--env artifacts=/project/tracer/bin/artifacts `
--env DD_INSTRUMENTATION_TELEMETRY_ENABLED=0 `
Expand Down
6 changes: 2 additions & 4 deletions tracer/build_in_docker.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/usr/bin/env bash
set -euox pipefail

# in case we are being run from outside this directory
cd "$(dirname "$0")"

ROOT_DIR="$(dirname $(pwd))"
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
ROOT_DIR="$(dirname -- "$SCRIPT_DIR" )"
BUILD_DIR="$ROOT_DIR/tracer/build/_build"
IMAGE_NAME="dd-trace-dotnet/alpine-base"

Expand Down

0 comments on commit 5435901

Please sign in to comment.