© 2024 Prancer Enterprise
Blog
Using prancer enterprise command-line interface with Github Actions
Prancer
February 16, 2021

Introduction

Prancer platform comes in three different editions:

  • Prancer Basic: This is the open-source version of the product
  • Prancer Enterprise: a virtual appliance that can be installed on any company's local network
  • Prancer Premium: Prancer SaaS solution, which is also called prancer cloud
To find more information about these editions, you can review our documentation site.

Prancer Basic has its own command-line tool. You can install it from the PyPi repository and start running the platform in its basic capacities. You can find more information on our GitHub page.

Prancer Enterprise / Premium provides you with a client tool that can be installed on any Linux based systems. This enterprise CLI has almost the same capabilities as the web interface of the product. The executable is prutil and can be installed from the PyPi repository.

In this blog post, I want to talk about the Prancer Enterprise CLI prutil and how you can integrate it into your GitHub actions workflows.

GitHub Actions Integration

This is an example of Github actions that executes prancer enterprise command line for compliance tests. Based on how prancer enterprise works, you need to ensure the below conditions are met:

  • Install Python in the build environment
  • Install prancer-cli from PyPi
  • In the step that executes the CLI, define at least these two environment variables:
    • ENTCLI_KEY
    • ENTCLI_SECRET
    • Note: Is highly recommended to define the value of the variables as Secrets

In order to create a Github Action pipeline you need to define a YAML file inside the directory github/workflows from your repository. Let's create an example.yml file on github/workflows with the below content.

name: Prancerent Test
on: push
jobs:
build:
    name: Test prancerent
    runs-on: ubuntu-latest
    steps:
    - name: Set up QEMU
        uses: docker/setup-qemu-action@v1
    - name: Set up Docker Build
        uses: docker/setup-buildx-action@v1
    - name: Set up Python 3.8
        uses: actions/setup-python@v2
        with:
        python-version: "3.8"
    - name: install prancer-cli
        run: pip install prancer-cli==1.0.6
    # You can add here a step to download your source code
    - name: prancer_test
        run:

prutil -h prutil -a create prutil -t default_container env: ENTCLI_KEY: ${{ secrets.ENTCLI_KEY }} ENTCLI_SECRET: ${{ secrets.ENTCLI_SECRET }} SERVER: ${{ secrets.SERVER }}

That's it, the pipeline should be triggered after each push to any of the branches, you can customize it according to your needs. An execution might look something like this:

You can find the complete pipeline script on our github hello world project:

prancer-hello-world/action.yaml at master · prancer-io/prancer-hello-world (github.com)