Integrations

Boost Spotter capabilities, streamline workflows, and efficiently manage development projects. Spotter seamlessly integrates with your work environment. Include it into your CI/CD pipelines with GitLab and GitHub integration or use it with your favorite code editor with Spotter Visual Studio Code extension - and even discover additional functionalities. No matter where you do your best work, Spotter is right by your side.

GitHub Actions

The Steampunk Spotter GitHub Action makes it easy to scan your Ansible content right within your GitHub CI/CD workflows. See DEMO or read tutorial .

When setting up your CI/CD pipeline, simply specify the Steampunk Spotter GitHub Action using the name xlab-steampunk/spotter-github-actions@<version> as a step in your YAML workflow file.

1. Create a new Git repository on GitHub
Name it, for example, “spotter-github-ci” and ensure it’s set as private. You can initialize the repository with a README file.

2. Create a playbook your want to scan
Click the “Add file” icon, select “Create new file”, name it “playbook.yaml”, add playbook content and commit the changes.

3. Configure the API token authentication
Go to Spotter app, open user settings, click on “API tokens” and generate a new token named “github.” Copy the generated token and return to your GitHub repository. Click on “Settings,” search for “Secrets and variables” in the repository settings, expand it, and select action. Select “Add a new repository secret.” Name it “SPOTTER_API_TOKEN,” then paste the copied API token.

4. Configure CI/CD to scan Ansible content
Create a YAML file called “.spotter-ci.yml” in the “.github/workflows” directory and paste this CI configuration into the YAML file:


  yaml  
  name: Steampunk Spotter  
  on: push   
  jobs:   
    spotter-scan:   
      runs-on: ubuntu-latest   
      steps:   
      - name: Checkout repository   
        uses: actions/checkout@master  
- name: Scan Ansible content uses: xlab-steampunk/spotter-action@master with: paths: . include_values: true include_metadata: true ansible_version: 2.14 env: SPOTTER_API_TOKEN: ${{ secrets.SPOTTER_API_TOKEN }}


Run “spotter-scan” to scan your playbook, commit the changes and observe if the CI/CD pipeline starts running.

5. Get Scan Results
See all errors, warnings, and hints found during the scan.

Use other Spotter features in the same way as you would in Spotter CLI, except for the rewrite feature.

For more detailed instructions and examples, visit the Steampunk Spotter page on GitHub Marketplace and the Steampunk Spotter GitHub Action repository .

GitLab

By integrating Steampunk Spotter with GitLab, you can effortlessly view scan results as unit test reports within your CI/CD pipeline. This streamlined process allows you to quickly identify failed checks. Enjoy a seamless experience while keeping track of your code’s health and quality. See DEMO or read tutorial .

1. Create a new Git repository, name the repository “spotter-gitlab-ci” and choose to initialize it with a README file while keeping it private.

2. Create a new Ansible Playbook that you want to scan: click on the plus icon and select “New file,” name the YAML file “playbook.yaml,” and paste the playbook into the file.

3. Configure the API token authentication: open Spotter app, go to the user settings, click on “API tokens” to generate a new token named “gitlab,” then copy the generated API token. Return to your GitLab repository, access the settings, navigate to “CI/CD,” search for “Variables,” and choose “Add variable.” Name it “SPOTTER_API_TOKEN” and paste the API token into the field.

4. Configure and run the CI/CD: use the spotter scan CLI command along with the –format junit_xml –output optional argument that will create a JUnit XML report at the specified location in GitLab.

5. Get scan result - GitLab will display check results as green check marks for successful checks and red crosses for unsuccessful checks. Use other Spotter features in the same way as you would in Spotter CLI, except for the rewrite feature.

VS Code Extension

The integration of Steampunk Spotter with Visual Studio Code enables you to scan Ansible content, spot issues and improve your playbooks directly within your preferred coding environment. Streamline your workflows, boost development speed, and enhance your productivity. Watch DEMO or read blog .

Besides bringing all Spotter features to your favourite code editor, Spotter VSC extention also offers exclusive Assisted Playbook Writing feature.

Simply install the extention via Visual Studio Marketplace or Open VSX Registry . You’ll need a Steampunk Spotter user account and the Steampunk Spotter CLI installed in the console that you typically use with VS Code. After that, you’re good to go and you can start scanning.

For more information on how to install and use Spotter VSC extension, jump to docs.