@datadog/datadog-ci
TypeScript icon, indicating that this package has built-in type declarations

2.34.0 • Public • Published

Datadog CI

NPM Version Continuous Integration License NodeJS Version

Execute commands from your Continuous Integration (CI) and Continuous Delivery (CD) pipelines to integrate with existing Datadog products.

See the Usage section for a list of available commands.

How to install the CLI

The package is under @datadog/datadog-ci and can be installed through NPM or Yarn:

# NPM
npm install --save-dev @datadog/datadog-ci

# Yarn
yarn add --dev @datadog/datadog-ci

If you need datadog-ci as a CLI tool instead of a package, you can run it with npx or install it globally:

# npx
npx @datadog/datadog-ci [command]

# NPM install globally
npm install -g @datadog/datadog-ci

# Yarn v1 add globally
yarn global add @datadog/datadog-ci

For more ways to install the CLI, see this section.

Usage

Usage: datadog-ci <command> [<subcommand>] [options]

The following values are available for each <command> and (optionally) <subcommand>.

See each command's linked README for more details, or click on 📚 to see the related documentation page.

cloud-run

dsyms

flutter-symbols

unity-symbols

git-metadata

junit

lambda

measure

  • Add measures to a CI Visibility Pipeline trace or Job span in Datadog. 📚

react-native

sarif

sbom

sourcemaps

stepfunctions

synthetics

tag

  • Add custom tags to a CI Visibility Pipeline trace or Job span in Datadog. 📚

trace

Beta commands

The following are beta commands, you can enable them with with DD_BETA_COMMANDS_ENABLED=1:

deployment

dora

gate

More ways to install the CLI

Standalone binary (beta)

If installing NodeJS in the CI is an issue, standalone binaries are provided with releases. linux-x64, darwin-x64 (macOS), and win-x64 (Windows) are supported. These standalone binaries are in beta and their stability is not guaranteed.

To install:

Linux

curl -L --fail "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_linux-x64" --output "/usr/local/bin/datadog-ci" && chmod +x /usr/local/bin/datadog-ci

MacOS

curl -L --fail "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_darwin-x64" --output "/usr/local/bin/datadog-ci" && chmod +x /usr/local/bin/datadog-ci

Windows

Invoke-WebRequest -Uri "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_win-x64.exe" -OutFile "datadog-ci.exe"

Then, you can run datadog-ci commands normally:

datadog-ci version

Container image

To run datadog-ci from a container, you can use the datadog/ci image available in Dockerhub as well as the public Amazon ECR and Google GC registries.

docker pull datadog/ci

This example demonstrates how to run a command using the container and passing in the API and App keys:

export DD_API_KEY=$(cat /secret/dd_api_key)
export DD_APP_KEY=$(cat /secret/dd_app_key)
docker run --rm -it -v $(pwd):/w -e DD_API_KEY -e DD_APP_KEY datadog/ci synthetics run-tests -p pub-lic-id1

Building your own container image

You can build an image using the provided Dockerfile:

cd container
docker build --tag datadog-ci .

Optionally, you can use the VERSION build argument to build an image for a specific version:

docker build --build-arg "VERSION=v1.14" --t datadog-ci .

Development

Before contributing to this open source project, read our CONTRIBUTING.md.

License

Apache License, v2.0

Dependencies (46)

Dev Dependencies (41)

Package Sidebar

Install

npm i @datadog/datadog-ci

Weekly Downloads

871,725

Version

2.34.0

License

Apache-2.0

Unpacked Size

2.07 MB

Total Files

488

Last publish

Collaborators

  • datadog
  • datadog-publish