Skip to content

Commit

Permalink
Update gitlab build to build fleet installer
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlock committed Feb 10, 2025
1 parent 4a002db commit 8f8c907
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 26 deletions.
12 changes: 8 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ build:
-e SIGN_WINDOWS=true `
-e NUGET_CERT_REVOCATION_MODE=offline `
registry.ddbuild.io/images/mirror/datadog/dd-trace-dotnet-docker-build:latest `
Info Clean BuildTracerHome BuildProfilerHome BuildNativeLoader BuildDdDotnet PackageTracerHome ZipSymbols SignDlls SignMsi
Info Clean BuildTracerHome BuildProfilerHome BuildNativeLoader BuildDdDotnet BuildFleetInstaller PackageTracerHome ZipSymbols SignDlls SignMsi
- mkdir artifacts-out
- xcopy /e/s build-out\${CI_JOB_ID}\*.* artifacts-out
- remove-item -recurse -force build-out\${CI_JOB_ID}
Expand Down Expand Up @@ -96,18 +96,22 @@ 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
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(-prerelease)?$/' # Manually triggered as artifacts are from the Github release
when: manual
allow_failure: false
- when: delayed # Artifacts come from Azure pipeline, wait a reasonable time before polling
start_in: 15 minutes
- when: on_success # Artifacts come from Azure pipeline, but as we already depend on build, we already have a delayed start
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
58 changes: 36 additions & 22 deletions .gitlab/prepare-oci-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,46 @@ 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

if [ "$ARCH" != "amd64" ]; then
echo "Unsupported architecture: win-$ARCH"
exit 0
fi

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 -r ../artifacts/windows/Datadog.FleetInstaller/. sources/installer/

fi

echo -n $VERSION > sources/version

0 comments on commit 8f8c907

Please sign in to comment.