FUJITSU Software Agile+ Relief V1.1.1
CI Tool Collaboration Function Manual
AGR-0002-E1Z0(20) July 2020
ii
Preface Agile+ Relief can cooperate with CI (Continuous Integration) Tool. In this book, it explains the required settings and procedures to run Agile+ Relief in CI Tool. Refer to [Agile+ Relief Manual] for the error message output and command option of Agile+ Relief while refer to each of [Command manual] for that of Agile+ Relief C and Agile+ Relief J. For how to get Agile+ Relief Maven plugin and information about its running environment, please refer to the following download site. https://www.fujitsu.com/en/group/fst/products/a-relief/download.html
iii
[High Risk Activity]
This Product is designed, developed and manufactured as contemplated for general use, including without limitation, general office use, personal use, household use, and ordinary industrial use, but is not designed, developed and manufactured as contemplated for use accompanying fatal risks or dangers that, unless extremely high safety is secured, could lead directly to death, personal injury, severe physical damage or other loss (hereinafter "High Safety Required Use"), including without limitation, nuclear reaction control in nuclear facility, aircraft flight control, air traffic control, mass transport control, medical life support system, missile launch control in weapon system. You shall not use this Product without securing the sufficient safety required for the High Safety Required Use. If you wish to use this Product for High Safety Required Use, please consult with our sales representatives in charge before such use. Microsoft, Windows, Windows Server are registered trademarks of Microsof t Corporation in the United States and other countries. The names of other products and services referred to in this document are trademarks of their respective developers and manufacturers.
Particular technologies disclosed in this document may be subject to the Foreign Exchange and Foreign Trade Control Law. Export of this document or any part thereof , or supply of this document or any part thereof to a foreign resident, must be undertaken only in compliance with the provisions of the law.
FUJITSU SOFTWARE TECHNOLOGIES LIMITED Notes
- Transmission or copying of this document in whole or in part is prohibited.
- The content of this document is subject to change without prior notice.
All rights reserved, Copyright(C) 2019-2020 FUJITSU SOFTWARE TECHNOLOGIES LIMITED.
iv
Contents 1 CI Tool Collaboration Function ................................................1
1.1 CI Tool ................................................................1 1.2 Running OS ...........................................................1 1.3 JDK / JRE .............................................................1 1.4 Structure of the software .................................................1
2 Preparation ...............................................................2 2.1 Install of Agile+ Relief ....................................................2 2.2 Install of Agile+ Relief Maven plugin ........................................2 2.2.1 Configuration of plugin............................................2 2.2.2 Install...........................................................2
2.3 Setting................................................................5 2.3.1 Configure Jenkins System...........................................5
3 Execution/Conf irmation .....................................................9 3.1 Setting of build .........................................................9 3.2 Jenkins Job...........................................................11 3.3 Build ................................................................17 3.4 Conf irmation of build result ..............................................18
4 Error Message............................................................21 5 Appendix ................................................................22
5.1 Agile+ Relief Maven plugin reference ......................................22 5.1.1 Property.........................................................22 5.1.2 Output Result ....................................................22
1
1 CI Tool Collaboration Function Quality status can be checked continuously by setting and executing Agile+ Relief in Jenkins job. Moreover, Agile+ Relief can be executed via Maven f rom Jenkins job by using Agile+ Relief Maven plugin that Agile+ Relief provided. 1.1 CI Tool
CI Tool Collaboration Function works with the following CI Tools. Jenkins
Besides, if you want to run Agile+ Relief from Maven which has been linked with Jenkins, the
following tools must be installed in advance on the system where Jenkins is running. Apache Maven
For Details, please refer to the download site recorded in "Preface". 1.2 Running OS
It can run on Windows and Red Hat Enterprise Linux. For Details, please refer to the download site recorded in "Preface".
1.3 JDK / JRE
For Details, please refer to the download site recorded in "Preface". 1.4 Structure of the sof tware
When using Agile+ Relief from Jenkins in source analysis mode, Agile+ Relief and Agile+ Relief C/C++ or Agile+ Relief J must be installed on the same PC.
Agile+ Relief, Agile+ Relief C/C++ and Agile+ Relief J are supported by the following products. Agile+ Relief floating license version Agile+ Relief C/C++ floating license version Agile+ Relief J floating license version
For Details, please refer to the download site recorded in "Preface".
2
2 Preparation
2.1 Install of Agile+ Relief
Install the Agile+ Relief according to software manual. Agile+ Relief J requires JDK as a working environment. Please install it first and set the environment variable JAVA_HOME to JDK installation path.
2.2 Install of Agile+ Relief Maven plugin
Agile+ Relief Maven plugin is offered as one of CI Tool Collaboration Functions. When calling batch execution command of Agile+ Relief from Maven, please install it.
2.2.1 Conf iguration of plugin
Download and install Agile+ Relief Maven plugin f rom 'CI Tool Collaboration plugin' on the download site in "Preface".
Download the self-extracting executable 'agileplusrelief-plugin.exe', copy it to any location,
and run it to create a 'agileplusrelief-plugin' folder. The Content of the folder 'agileplusrelief-plugin' is as follows.
Folder name Description maven Folder which Agile+ Relief Maven plugin is
stored
The Content of the folder 'maven' is as follows. File name Description
agileplusrelief-maven-plugin-1.0.jar Agile+ Relief Maven plugin 2.2.2 Install
Install Agile+ Relief Maven plugin in Maven. Please install Maven before installing Agile+ Relief Maven Plugin.
1. Move to the installation target folder of Agile+ Relief Maven plugin (under the
'agileplusrelief -plugin¥maven' folder created by the execution of agileplusrelief-plugin.exe) by using the command line.
2. Execute the mvn command and install Agile+ Relief Maven plugin. Examples of mvn command for each installation target (local repository / remote repository) are shown as below.
3
[In the case of Install in Maven local repository] The following parameters are specified for the mvn command.
Parameter Description install:install-file Goal phrase to install plugin in local repository -Df ile=agileplusrelief-maven-plugin-1.0.jar File name of Agile+ Relief Maven plugin -DgroupId=com.fujitsu.jp.fst. agileplusrelief.maven Root package name of Agile+ Relief Maven -DartifactId=agileplusrelief- maven-plugin Name of Agile+ Relief Maven plugin
-Dversion=1.0 Version of Agile+ Relief Maven plugin -Dpackaging=jar Format of Agile+ Relief Maven plugin -DgeneratePom=true Setting whether to generate POM
Example : Commands that installs Agile+ Relief Maven plugin (version 1.0) in Maven local repository
mvn install:install-file -Df ile=agileplusrelief-maven-plugin-1.0.jar -DgroupId=com.fujitsu.jp.fst.agileplusrelief.maven -DartifactId=agileplusrelief-maven-plugin -Dversion=1.0 -Dpackaging=jar -DgeneratePom=true
4
[In the case of Install in the Maven remote repository]
The following parameters are specified for the mvn command. Parameter Description
deploy:deploy-file Goal phrase to install plugin in remote repository
-Durl="Repository URL" URL of remote repository that installs plugin -DrepositoryId="Repository ID" ID of remote repository that installs plugin -Dfile=agileplusrelief -maven-plugin-1.0.jar File name of Agile+ Relief Maven plugin -DgroupId=com.fujitsu.jp.fst. agileplusrelief.maven Root package name of Agile+ Relief Maven -DartifactId=agileplusrelief- maven-plugin Name of Agile+ Relief Maven plugin -Dversion=1.0 Version of Agile+ Relief Maven plugin -Dpackaging=jar Format of Agile+ Relief Maven plugin -DgeneratePom=true Setting whether to generate POM
Example : Commands that installs Agile+ Relief Maven plugin (version 1.0) in Maven remote repository
mvn deploy:deploy-file -Durl=http://xx.xxx.xxx.xxx/repository -DrepositoryId=my-repository -Df ile=agileplusrelief-maven-plugin-1.0.jar -DgroupId=com.fujitsu.jp.fst.agileplusrelief.maven -DartifactId=agileplusrelief-maven-plugin -Dversion=1.0 -Dpackaging=jar -DgeneratePom=true
5
2.3 Setting
The following explains a setting necessary to use Agile+ Relief in Jenkins. 2.3.1 Conf igure Jenkins System
Set Agile+ Relief license management server information and the information needed to run Agile+ Relief in Jenkins system. 1. Click [Manage Jenkins] of a lef t pane of the dashboard.
2. Click [Configure System].
6
3. Check [Environment variables] of [Global properties].
4. Click [Add] Button of [List of variables].
7
5. Set [Name] and [Value].
The following describes the environment variables to set. * There is a possibility that Agile+ Relief cannot be executed f rom Jenkins depending on the operating environment when each environment variable is not set.
Setting of License Server
Set the license server of Agile+ Relief.
Setting to prevent pop-up of license verification from appearing
Set preventing pop-up of Agile+ Relief's license verification from appearing.
name FLEXLM_BATCH value 1
name FST_LICENSE_FILE
value
port@host - port : Port number
Specify the Port that the license server of Agile+ Relief uses. Port number can be omitted if you do not specify the port number for the license server.
- host : License management server IP address or host name Always add and specify '@' at the front even when the port number is omitted.
8
Setting of environment variables Set the location of the execution command of Agile+ Relief.
name AR_HOME value Installation folder of Agile+ Relief
[When parsing the source program of C/C++]
name EPOMDIR value Windows :
Agile+ Relief InstallFolder¥PGRelief¥Analyze¥EPOM Linux :
Agile+ Relief InstallDirectory/FFSTpgr/FFSTpgr/Analyze/EPOM
name PATH (Only Linux) value Agile+ Relief InstallDirectory/FFSTpgr/FFSTpgr/Analyze/EPOM
name LD_LIBRARY_PATH (Only Linux) value Agile+ Relief InstallDirectory/FFSTpgr/FFSTpgr/Analyze/EPOM/lib
[When parsing the source program of Java]
name PGRJ_HOME value Agile+ Relief InstallFolder¥PGReliefJava
9
3 Execution/Confirmation
3.1 Setting of build
Describe the setting necessary for the execution of Agile+ Relief in Maven, the Windows batch command or Shell command according to the build environment. The setting example is as follows.
* Please use other than Shell script, when the source program of Java with using analyze mode of Agile+ Relief.
Maven
Describe the setting of Agile+ Relief in POM File (pom.xml). The following is example for [C:¥Program Files¥Jenkins¥workspace]. is set workpace.
Details of the Agile+ Relief Maven Properties are described to 5.1.1 Property.
: <properties> <arInstallDirectory>C:¥Program Files¥AgilePlus¥Relief </arInstallDirectory> <pgrj.dir>C:¥Program Files¥AgilePlus¥PGReliefJava</pgrj.dir> </properties> : <build> <plugins> : <!-- Agile+ Relief Maven Plugin --> <plugin> <groupId>com.fujitsu.jp.fst.agileplusrelief.maven</groupId> <artifactId>agileplusrelief-maven-plugin</artifactId> <version>1.0</version> <!-- Add the Property when you use option --> <configuration> <pgsFile>D:¥ARQM¥pgsFile¥test.pgs</pgsFile> <!-- <arOption> </arOption> --> <arOutputDirectory>C:¥Program Files¥Jenkins¥workspace¥HtmlOut </arOutputDirectory> </configuration> <executions> <execution> <!-- Phase of Agile+ Relief --> <phase>verify</phase> <goals> <!-- Goal of Agile+ Relief (Requirement) --> <goal>agileplusrelief</goal> </goals> </execution> </executions> </plugin> : </plugins> </build> :
10
Windows batch command
Describe the batch execution command (arqm) of Agile+ Relief in Windows batch file. The following is example for [C:¥Program Files¥Jenkins¥workspace]. is set workpace..
Note: Line feeder is found in the description, while do not change the line order for actual command execution.
Specify the batch execution command (arqm) provided by Agile+ Relief. Please specify the folder under the workspace of Jenkins as the output folder. Details of the batch execution command (arqm) are described to "Agile+ Relief Manual".
Shell
Describe the batch execution command (arqm) of Agile+ Relief in Shell script.
The following is example for [/home/Jenkins/workspace]. is set workpace.
Note: Line feeder is found in the description, while do not change the line order for actual command execution.
Specify the batch execution command (arqm) provided by Agile+ Relief. Please specify the folder under the workspace of Jenkins as the output folder. Details of the batch execution command (arqm) are described to [Agile+ Relief Manual].
"C:¥Program Files¥AgilePlus¥Relief¥arqm.exe" -o "C:¥Program Files¥Jenkins¥workspace¥HtmlOut" "D:¥ARQM¥pgsFile¥test.pgs"
"/opt/FFSTaplus/FFSTarqm/arqm" -o "/home/Jenkins/workspace/HtmlOut" "/home/ARQM/pgsFile/test.pgs"
11
3.2 Jenkins Job
Set a job in the build job of freestyle project 1. Click [New Item].
2. Enter the job name and click [Freestyle project].
12
3. Click [Add build step] of the Build section.
4. Click the added build step.
* Select the build Step set by 3.1 Setting of build. * [Execute shell] cannot be used when using source analyze mode of Agile+ Relief to
analyze the source program of Java.
13
5. Set according to the build procedure.
A) Invoke top-level Maven targets Specify [Goals]. Specify either the following for [Goals].
- Phase set to POM f ile (pom.xml) of 3.1 Setting of build - Goal that Agile+ Relief Maven plugin of fers (agileplusrelief)
B) Execute Windows batch command Specify [Command]. Specify the Windows batch f ile made by 3.1 Setting of build by using the call
command. The following is the sample when the Windows batch file is [C:¥Program Files¥Jenkins¥workspace¥analyze.bat].
14
C) Execute Shell command Specify [Command]. Specify the Shell file made by 3.1 Setting of build by using the call command. The
following is the sample when the Shell file is [/home/Jenkins/workspace/analyze.sh].
15
6. Click [Add post-build action] of the Post-build Actions section.
7. Click [Archive the artifacts].
16
8. Setting interface of [Archive the artifacts] Specify the folder in which the execution result (quality status result f ile) of Agile+ Relief will
be saved with the relative path of the Jenkins workspace in the menu [Files to archive] of [Post-build Actions].
The execution result (quality status result file) of Agile+ Relief is output to the folder generated by the f ile name (*) [Project Structure Definition File] or [Project Structure Def inition List File] in the folder which is specif ied by the -o option of the batch execution command (arqm).
In the case of the sample in "3.1 Setting of build", set [Files to archive] as [HtmlOut/test/]. * The folder [test] is created when project structure definition file is [test.pgs].
17
3.3 Build
Execute the build Job of Jenkins. Do either of the following Operations on the dashboard of Jenkins.
When executing from the dashboard
Click the Build execution icon of the target Job.
When executing from the project view
Click [Build Now] of a lef t pane af ter clicking the Job of the target.
18
3.4 Conf irmation of build result
The build result is displayed on the dashboard of Jenkins. Confirm the build of the Job displayed in [All] view has succeeded after clicking the Job of the
target, and confirm the result of quality status. 1. Open the dashboard of Jenkins.
2. Click the target Job displayed in [All] view.
19
3. Click build of the target after confirming that the executed build was successful f rom [Build History] on the left pane.
4. Click [Build Artifacts].
20
5. Click [(all f iles in zip)] on the result saving view.
6. A [save] dialog box will appear, specify any folder and save. 7. Unzip the saved zip file. 8. Open the extracted file (index.htm) by Browser, confirm that the execution result (quality
status results) is displayed.
21
4 Error Message Error message related to Agile+ Relief Maven plugin
Error message format Agile+ Relief Maven Plugin Error: Error Message
Message list
ErrorMessage Description Measure pgsfile @1 is not exist. @1: Name of pgsfile
Project structure definition file or project structure definition listing file is not existing.
Please add project structure definition file or project structure def inition listing file.
Install directory @1 is not exist. @1:Folder
The installation folder of Agile+ Relief does not exist.
- Set the installation folder of Agile+ Relief correctly. - Set environment variable AR_HOME correctly.
Check command @1 is not exist. @1: arqm.exe
Arqm.exe command does not exist in the installation folder of Agile+ Relief.
- Confirm the installation of Agile+ Relief . - Set the installation folder of Agile+ Relief correctly.
Failed to execute Agile+ Relief.
It is an error of the Agile+ Relief command execution.
Confirm the Content of the Agile+ Relief output file. agileplusrelief_result.txt
Unsafe command line string.
An illegal Character is included in the command line text. ;|&`()$<>*?{}[]!
Do not contain these Characters in the command line text.
Plugin execute error.
It failed in the execution of the Agile+ Relief Maven plugin.
Confirm the Content of the Agile+ Relief output file. arqm_result.txt
22
5 Appendix
5.1 Agile+ Relief Maven plugin reference
The following is the information of Agile+ Relief Maven plugin. Information groupId com.fujitsu.jp.fst.agileplusrelief.maven artifactId agileplusrelief-maven-plugin version 1.0 phase verify goal agileplusrelief
5.1.1 Property
The property can be set to POM File (pom.xml) by the <configuration> tag. Set it if necessary. Name Type Description Default value
pgsFile File Project Structure Definition File or Project Structure Def inition Listing File
‐
arOptions List The option string passed to batch execution command (arqm) directly.
There is no specification
arOutput Directory
File The output folder for the execution result of Agile+ Relief (Correspond to the "-o" option of the batch execution command (arqm))
The Folder of build target of Maven project (Default property: ${project.build.directory})
5.1.2 Output Result
When the execution of Agile+ Relief ends, the following files are output. Name of folder Content Output folder The same name as pgs f ile
Output result of batch execution command (arqm)
The Folder specified by arOutputDirectory property of POM File
File name Content Output folder arqm_result.txt Output log of batch
execution command (arqm)
The Folder specified by arOutputDrectory property of POM File