Jenkins Integration
Introduction
Jenkins
is an open source automation server that helps you to automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and continuous delivery.
Using the installation script
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
:
pipeline {
agent any
environment {
XYGENI_TOKEN = credentials('XYGENI_TOKEN')
}
stages {
stage('Install Xygeni scanner') {
steps {
sh """
curl -L https://get.xygeni.io/latest/scanner/install.sh | \
/bin/bash -s -- -t $XYGENI_TOKEN -d $WORKSPACE/scanner
"""
}
}
stage('Scan for issues') {
steps {
sh """
$WORKSPACE/scanner/xygeni scan \
-n $PROJECT_NAME \
--dir $PROJECT_HOME
"""
}
}
}
}
Using the docker image
If it is not possible to install the scanner in the BitBuket host running the pipeline, you may run the docker image instead:
pipeline {
agent any
environment {
XYGENI_TOKEN = credentials('XYGENI_TOKEN')
}
stages {
stage('Scan for issues') {
steps {
sh """"
docker run \
-v $PROJECT_HOME:/app
-v $DD_CONF:/opt/xygeni_scanner/conf \
-t -rm \
xygeni_scanner/xygeni scan \
-n $PROJECT_NAME --dir /app
"""
}
}
}
}
Last updated