CI/CD Integration - Viper with Linux Image for Azure DevOps
Steps to create Pipeline
Take the following steps to configure vFunction Viper to analyze the application’s binaries in the Azure DevOps pipeline:
- Create a vFunction Service account and a vFunction Yaml for use with Viper
- Log into Azure DevOps
- Navigate to the root of the repository
- Create a custom Pipeline after the Application has been built (post-build)
- Add the vFunction variables VF_HOST, VF_APPNAME, VF_CONF, VF_USER, VF_PASSWORD to this pipeline. Add the vFunction script steps to this pipeline to download and run the vFunction Viper scripts:
trigger:
branches:
include:
- main
exclude:
- feature_branches
pool:
vmImage: 'ubuntu-latest'
variables:
- name: VF_HOST
### Modify VF_SERVER to the URL for your vFunction Server
value: 'VF_SERVER'
- name: VF_APPNAME
### Modify APPLICATION_NAME to match the name used in the VF Server UI of the Application
value: 'APPLICATION_NAME'
- name: VF_CONF
### Modify BASE_DIR to the path of the viper-conf.yaml
value: 'BASE_DIR/viper-conf.yaml'
- name: VF_USER
### Modify the SERVICE_ACCOUNT_ID with the username created in the VF Server UI
value: 'SERVICE_ACCOUNT_ID'
- name: VF_PASSWORD
### Modify the SERVICE_ACCOUNT_PASSWORD with the password created in the VF Server UI
value: 'SERVICE_ACCOUNT_PASSWORD'
stages:
- stage: vFunctionContinuousViper
displayName: "Run Viper and Upload JSON to VF Server"
jobs:
- job: "Download Viper-CLI"
steps:
### Modify VF_SERVER to the URL for your vFunction Server
- script: curl -LO VF_SERVER/downloads/vfunction-tools/viper-cli.zip
- job: "Unzip Viper-CLI"
steps:
- script: jar -xvf viper-cli.zip
- job: "Create Full Graph JSON and upload to VF Server"
steps:
- script: bash viper-run-ci.sh