# CircleCI Integration

### &#x20;Introduction <a href="#introduction" id="introduction"></a>

`CircleCI` is a continuous integration and continuous delivery platform that can be used to implement DevOps practices.

{% hint style="info" %}
The following configuration examples show how to install & run the scanner using an API Token stored as a secret named `XYGENI_TOKEN`. See [Generate Xygeni API Token for Scanner](https://docs.xygeni.io/xygeni-administration/profile#generate_token_for_scanner-1) or ask your Xygeni administrator to generate it.

See [Private keys and secrets](https://circleci.com/docs/env-vars/#private-keys-and-secrets) for details about how to add the token as a secret in CircleCI.
{% endhint %}

### Using the installation script <a href="#using_the_installation_script" id="using_the_installation_script"></a>

You may automatically install the scanner using the installation script available from `https://get.xygeni.io/latest/scanner/TYPE`, with TYPE either `bash` or `powershell`:

```yaml
jobs:
  build:
    steps:
      - run:
        name: Install Xygeni scanner
        command: >
          curl -L https://get.xygeni.io/latest/scanner/install.sh |
          /bin/bash -s -- -o -t $XYGENI_TOKEN

      - run:
        name: Scan for issues
        command: >
          $HOME/xygeni_scanner/xygeni scan
            -n $PROJECT_NAME
            --dir $PROJECT_HOME
```

{% hint style="info" %}
See [installation script](https://docs.xygeni.io/xygeni-administration/platform-administration/integrations/integrate-scanner-cli-into-ci-cd-systems/broken-reference) for more details.

Please refer to the [scanner documentation](https://docs.xygeni.io/xygeni-scanner-cli/xygeni-cli-overview) for full details on the scanner command line options and configuration.
{% endhint %}

### Using the docker image <a href="#using_the_docker_image" id="using_the_docker_image"></a>

If it is not possible to install the scanner in the CircleCI host running the job, you may run the docker image instead:

```yaml
jobs:
  build:
    steps:
      - run:
        name: Scan for issues
        command: >
          docker run
            -v $PROJECT_HOME:/app
            -v $DD_CONF:/opt/xygeni_scanner/conf
            -t -rm
            xygeni_scanner/xygeni scan -n $PROJECT_NAME --dir /app
```

{% hint style="info" %}
See [Xygeni Scanner docker image](https://docs.xygeni.io/xygeni-scanner-cli/xygeni-cli-overview/xygeni-cli-docker-image) for more details.
{% endhint %}
