Skip to content

Commit

Permalink
Faff with the build
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlock committed Jan 30, 2025
1 parent fd8609a commit 4035883
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 26 deletions.
7 changes: 6 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ download-single-step-artifacts:
image: registry.ddbuild.io/docker:20.10.13-gbi-focal
timeout: 45m
tags: [ "arch:amd64" ]
needs: []
needs:
- job: build
optional: true
artifacts: true
rules:
- if: $DOTNET_PACKAGE_VERSION
when: on_success
Expand All @@ -98,6 +101,8 @@ download-single-step-artifacts:
script:
- .gitlab/download-single-step-artifacts.sh
- cp tracer/build/artifacts/requirements.json artifacts/requirements.json
# We currently only copy the windows artifacts if we're _not_ building a tag, because we don't want to push these images to prod yet
- if [ -z "$CI_COMMIT_TAG" ]; then cp -r artifacts-out artifacts/windows; fi
artifacts:
expire_in: 2 weeks
paths:
Expand Down
53 changes: 31 additions & 22 deletions .gitlab/prepare-oci-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,41 @@ if [ -z "$ARCH" ]; then
ARCH=amd64
fi

if [ "$OS" != "linux" ]; then
echo "Only linux packages are supported. Exiting"
exit 0
fi
if [ "$OS" == "linux" ]; then
if [ "$ARCH" == "amd64" ]; then
SUFFIX=""
elif [ "$ARCH" == "arm64" ]; then
SUFFIX=".arm64"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi

if [ "$ARCH" == "amd64" ]; then
SUFFIX=""
elif [ "$ARCH" == "arm64" ]; then
SUFFIX=".arm64"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi
SRC_TAR="../artifacts/datadog-dotnet-apm-$PACKAGE_VERSION${SUFFIX}.tar.gz"

SRC_TAR="../artifacts/datadog-dotnet-apm-$PACKAGE_VERSION${SUFFIX}.tar.gz"
if [ ! -f $SRC_TAR ]; then
echo "$SRC_TAR was not found!"
exit 1
fi

if [ ! -f $SRC_TAR ]; then
echo "$SRC_TAR was not found!"
exit 1
fi
mkdir -p sources

mkdir -p sources
# extract the tarball, making sure to preserve the owner and permissions
tar --same-owner -pxvzf $SRC_TAR -C sources

# extract the tarball, making sure to preserve the owner and permissions
tar --same-owner -pxvzf $SRC_TAR -C sources
cp ../artifacts/requirements.json sources/requirements.json

echo -n $VERSION > sources/version
elif [ "$OS" == "windows" ]; then

cp ../artifacts/requirements.json sources/requirements.json
# unzip the tracer home directory, and remove the xml files
mkdir -p sources/library
unzip ../artifacts/windows/windows-tracer-home.zip -d sources/library
find sources/library -type f -name "*.xml" -delete

# Copy the fleet installer to the sub-directory
mkdir -p sources/installer
cp ../artifacts/windows/Datadog.FleetInstaller sources/installer/

fi

echo -n $VERSION > sources/version
16 changes: 13 additions & 3 deletions tracer/build/_build/Build.Steps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -743,10 +743,11 @@ async Task DownloadWafVersion(string libddwafVersion = null, string uncompressFo
.DependsOn(PublishNativeTracerUnix)
.DependsOn(PublishNativeTracerOsx);

Target BuildMsi => _ => _
Target BuildFleetInstaller => _ => _
.Unlisted()
.Description("Builds the .msi files from the repo")
.After(BuildTracerHome, BuildProfilerHome, BuildNativeLoader, BuildDdDotnet)
.Description("Builds the fleet installer binary files from the repo")
.After(Clean, Restore)
.Before(SignDlls)
.OnlyWhenStatic(() => IsWin)
.Executes(() =>
{
Expand All @@ -755,7 +756,16 @@ async Task DownloadWafVersion(string libddwafVersion = null, string uncompressFo
.SetProject(SharedDirectory / "src" / "Datadog.FleetInstaller" / "Datadog.FleetInstaller.csproj")
.SetConfiguration(BuildConfiguration)
.SetOutput(ArtifactsDirectory / "Datadog.FleetInstaller"));
});

Target BuildMsi => _ => _
.Unlisted()
.Description("Builds the .msi files from the repo")
.After(BuildTracerHome, BuildProfilerHome, BuildNativeLoader, BuildDdDotnet)
.DependsOn(BuildFleetInstaller) // TEMP workaround to avoid needing to change gitlab image
.OnlyWhenStatic(() => IsWin)
.Executes(() =>
{
// We don't produce an x86-only MSI any more
var architectures = ArchitecturesForPlatformForTracer.Where(x => x != MSBuildTargetPlatform.x86);

Expand Down

0 comments on commit 4035883

Please sign in to comment.