Skip to content

Commit

Permalink
Add OCI package building (#4344)
Browse files Browse the repository at this point in the history
* OCI package building

* fix paths

* correct tarball name

* use --prefix

* minor cleanup

* Add internal publishing

* copy/paste error
  • Loading branch information
randomanderson authored May 23, 2024
1 parent 3db62e3 commit 3544dc0
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,35 @@ package-arm:
- ../.gitlab/build-deb-rpm.sh
- find . -iregex '.*\.\(deb\|rpm\)' -printf '%f\0' | xargs -0 dd-pkg lint

package-oci:
extends: .package-oci
stage: package
script:
- ../.gitlab/build_oci_package.sh

oci-internal-publish:
extends: .oci-internal-publish
stage: package
needs: [ package-oci ]
rules:
- when: on_success
variables:
FLAVOR: datadog-apm-library-js

oci-internal-test-ecr-publish:
stage: package
needs: [ oci-internal-publish ]
rules:
- when: on_success
trigger:
project: DataDog/public-images
branch: main
strategy: depend
variables:
IMG_SOURCES: registry.ddbuild.io/ci/remote-updates/datadog-apm-library-js:pipeline-${CI_PIPELINE_ID}-1
IMG_DESTINATIONS: apm-library-js-package:pipeline-${CI_PIPELINE_ID}
IMG_REGISTRIES: agent-qa

.release-package:
stage: deploy
variables:
Expand Down
26 changes: 26 additions & 0 deletions .gitlab/build_oci_package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -e

cd ..

npm pack

mkdir -p packaging/sources

npm install --prefix ./packaging/sources/ dd-trace-*.tgz

rm packaging/sources/*.json # package.json and package-lock.json are unneeded

jq --raw-output '.version' package.json > packaging/sources/version

cd packaging

export VERSION=$(<sources/version)

datadog-package create \
--version="$VERSION" \
--package="datadog-apm-library-js" \
--archive=true \
--archive-path="datadog-apm-library-js-$VERSION.tar" \
./sources

0 comments on commit 3544dc0

Please sign in to comment.