You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

 

If you are using CircleCI to automate your pipeline process, you can easily add Kiuwan analysis as a integrated step of the process, letting you to act accordingly to Kiuwan results.

To integrate Kiuwan in your CircleCI pipeline you just need to follow some basic steps.

 

Step 1 : Environment Variables

First, you need to create a couple of Environment Variables to establish your Kiuwan credentials (username and password).

These variables will be used by Kiuwan Local Analyzer to authenticate to Kiuwan server. You can do it at Settings >>> Projects >> Configuration >> Environment Variables.

  • KIUWAN_USER
  • KIUWAN_PASSWD

You can use whatever name you wish for those variables, just be sure you use those variable names in the config file (see below).

 

Step 2: Add Kiuwan to config.yml

Next, you need to create at your GitHub repository a directory named .circleci and place a config file named config.yml with the following contents.

(you can download a sample config.yml file here )
config.yml
#
# Check https://circleci.com/docs/2.0/language-java/ for more details
#
version: 2
jobs:
 build:
    docker:
       # IMPORTANT : specify any image but allways use Java 1.8 !!
       - image: circleci/openjdk:8-jdk
 
    working_directory: ~/repo
    steps:
       - checkout

       # Download and install Kiuwan Local Analyzer
       - run: 
           name: Download and Install KLA
           command: |
               wget https://www.kiuwan.com/pub/analyzer/KiuwanLocalAnalyzer.zip -P ${HOME}
               unzip ${HOME}/KiuwanLocalAnalyzer.zip -d ${HOME}
               chmod +x ${HOME}/KiuwanLocalAnalyzer/bin/*.sh
 
       # Executes Kiuwan Local Analyzer 
       # Visit https://www.kiuwan.com/docs/display/K5/Code+analysis+using+the+downloaded+agent for a full description of command line options
       - run:
           name: Run Kiuwan baseline analysis
           command: ${HOME}/KiuwanLocalAnalyzer/bin/agent.sh -n ${CIRCLE_PROJECT_REPONAME} -s ${HOME}/repo -l "Circle CI ${CIRCLE_BUILD_NUM}" -c -wr --user ${KIUWAN_USER} --pass ${KIUWAN_PASSWD} exclude.patterns="./KiuwanLocalAnalyzer/**,**/*.min.js,**/*.Designer.vb,**/*Reference.vb,**/*Service.vb,**/*Silverlight.vb,**/*.designer.vb,**/*reference.vb,**/*service.vb,**/*silverlight.vb,**/*.Designer.cs,**/*Reference.cs,**/*Service.cs,**/*Silverlight.cs,**/*.designer.cs,**/*reference.cs,**/*service.cs,**/*silverlight.cs,**/.*,**/Pods/BuildHeaders/**/*.h,**/Pods/Headers/**/*.h include.patterns=**/**" ignore=architecture

 

Now, Kiuwan will be a integrating part of your CircleCI pipeline.

Visit Kiuwan Local Analyzer documentation page for any doubt and feel free to contact Kiuwan Technical Support

 

 

 

  • No labels