The AppMap Analysis CLI provides a ci
subcommand as an all-in-one solution for running a scan on the CI server.
This guide describes how to use the ci
command in a basic, non-parallelized build job.
The steps performed are:
ci
command to:
Modify your build step that runs test cases to generate AppMaps. The specifics of this depend on your language and framework. See the recording test cases reference for details.
ci
commandWe recommend using npx
to run AppMap Analysis in CI.
Basic usage:
$ npx @appland/scanner ci -c appmap-analysis-config.yml -d tmp/appmap
..!.......!..........!..........!..........!..........!....................!!...
....!..........!..........!..........!.....................!..........!.........
...
Creating mapset in app mycorp/myapp-server with 2 AppMaps
Uploading findings
Uploaded 2 findings to https://app.land/scanner_jobs/121
By default, the ci
command will upload scan results to your AppMap account.
To configure AppMap Analysis to upload scan results, you’ll need an AppMap API key. You can
generate a new API key via your account settings page. The API key should be
securely added to the CI job configuration, as the environment variable APPLAND_API_KEY
.
This feature is enabled by default. To disable it, use the --no-upload
command flag.
When using AppMap Analysis in CI you can post findings summary as a commit status and/or a PR comment (currently only GitHub is supported). In order to allow access to your repo you need to create a personal token with following privileges and add it as a GH_TOKEN
env variable to your CI:
repo
for posting PR commentsrepo:status
for posting commit statusesThis feature is disabled by default. To enable it, use the --update-commit-status
command flag.
Pass the --fail
flag to fail the build job if there are any new findings.