Difference between revisions of "Globalyzer CI/CD (Continuous Integration and Continuous Delivery)"

From Lingoport Wiki
Jump to: navigation, search
(Project Definition Format)
Line 41: Line 41:
   
 
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
&lt;!-- All items should be allowed anywhere in the xml as long as the hierarchy
+
<!-- All items are allowed anywhere in the xml as long as the
is preserved -->
+
hierarchy is preserved -->
<gzproject>
+
<gzproject>
<login>
+
<login>
  +
<server> </server> <!-- must match .globalyzerrc setting -->
<username></username>
 
  +
<username></username> <!-- must be specified in .globalyzerrc -->
<password></password>
 
  +
<password></password> <!-- must be specified in .globalyzerrc -->
<server></server>
 
  +
<!-- if .globalyzerrc is present -->
<use-local-rulesets></use-local-rulesets> &lt;!-- optional. May be 'true' or 'false' --&gt;
 
  +
<use-local-rulesets></use-local-rulesets> <!-- optional. May be 'true' or 'false' -->
&lt;!-- if true, you need a Globalyzer.license --&gt;
 
  +
<!-- if true, you need a Globalyzer.license -->
&lt;!-- Optional Parameters --&gt;
 
  +
<!-- Optional Parameters (Delete this section if not using them) -->
 
<optional>
 
<optional>
<proxy-user></proxy-user>
+
<!-- If using, host and port must be filled out -->
  +
<proxy-user> </proxy-user>
 
<proxy-password></proxy-password>
 
<proxy-password></proxy-password>
<proxy-host></proxy-host>
+
<proxy-host> </proxy-host> <!-- required if using proxy -->
<proxy-port></proxy-port>
+
<proxy-port> </proxy-port> <!-- required if using proxy -->
<optional>
+
</optional>
</login>
+
</login>
  +
<project-path></project-path> &lt;!-- May instead be specified from command line --&gt;
 
  +
<!-- Paths may be absolute, or relative -->
<project-name></project-name>
 
<report-path></report-path> &lt;!-- May instead be specified from command line --&gt;
+
<project-path></project-path> <!-- may be specified via command line -->
<report-type></report-type>
+
<project-name></project-name>
  +
<data-dictionary-location></data-dictionary-location> &lt;!-- optional -->
 
<filter-with-dictionary></filter-with-dictionary> &lt;!-- optional. May be 'true' or 'false' -->
+
<report-path></report-path> <!-- may be specified via command line -->
<scan-timeout>500</scan-timeout> &lt;!-- optional. Max value 600 (seconds) -->
+
<report-type></report-type> <!-- See 'Report Information' -->
  +
<generate-partial-results></generate-partial-results> &lt;!-- optional. May be 'true' or 'false' -->
 
<save-history></save-history> &lt;!-- optional. May be 'true' or 'false' -->
+
<data-dictionary-location></data-dictionary-location> <!-- optional -->
  +
<filter-with-dictionary></filter-with-dictionary> <!-- optional. May be 'true' or 'false' -->
<scans>
 
  +
  +
<scan-timeout>500</scan-timeout> <!-- optional. Max value 600 (seconds) -->
  +
<generate-partial-results></generate-partial-results> <!-- optional. May be 'true' or 'false' -->
  +
<save-history></save-history> <!-- optional. May be 'true' or 'false' -->
  +
  +
  +
<scans>
 
<scan>
 
<scan>
&lt;!-- create and execute a single scan with this info -->
+
<!-- create and execute a single scan with this info -->
<scan-name></scan-name>
+
<scan-name> </scan-name>
<ruleset-name></ruleset-name>
+
<ruleset-name> </ruleset-name> <!-- must match existing -->
<ruleset-owner></ruleset-owner>
+
<ruleset-owner></ruleset-owner>
 
</scan>
 
</scan>
 
<scan>
 
<scan>
&lt;!-- create and execute a single scan with this info -->
+
<!-- create and execute a single scan with this info -->
<scan-name></scan-name>
+
<scan-name> </scan-name>
<ruleset-name></ruleset-name>
+
<ruleset-name> </ruleset-name> <!-- must match existing -->
<ruleset-owner></ruleset-owner>
+
<ruleset-owner></ruleset-owner>
<use-machine-learning>true</use-machine-learning> &lt;!-- optional. May be 'true' or 'false' -->
+
<!-- optional -->
<encoding>UTF-8</encoding> &lt;!-- optional. Encoding of files to scan -->
+
<use-machine-learning>true</use-machine-learning> <!-- May be 'true' or 'false' -->
  +
<!-- if true, you must have generated -->
&lt;!-- optional: specify files/directories to scan -->
 
  +
<!-- machine learning zip files -->
<scan-items>
 
  +
<!-- from the Workbench -->
<item></item>
 
<item></item>
+
<!-- optional -->
</scan-items>
+
<encoding>UTF-8</encoding> <!-- encoding of files to scan -->
&lt;!-- optional -->
+
<!-- optional -->
  +
<scan-items> <!-- may be overridden via command line -->
<comments>
 
&lt;!-- customize Globalyzer recognized comments -->
+
<item></item> <!-- delete me if blank -->
<todo>SPECIAL_GLOBALYZER_TODO_COMMENT</todo>
+
<item></item> <!-- delete me if blank -->
<ignore-next-line>GBLYZR_IGNORE_NEXT_LINE</ignore-next-line>
+
</scan-items>
<start-ignore>GLOBALYZER_START_IGNORE</start-ignore>
+
<!-- optional -->
<end-ignore>GBL_END_IGNORE</end-ignore>
+
<comments>
</comments>
+
<!-- customize Globalyzer recognized comments -->
  +
<todo>SPECIAL_GLOBALYZER_TODO_COMMENT</todo>
&lt;!-- optional -->
 
  +
<ignore-next-line>GBLYZR_IGNORE_NEXT_LINE</ignore-next-line>
<checks>
 
  +
<start-ignore>GLOBALYZER_START_IGNORE</start-ignore>
&lt;!-- specify which issue types to detect -->
 
<embedded-strings>true</embedded-strings>
+
<end-ignore>GBL_END_IGNORE</end-ignore>
<locale-sensitive-methods>false</locale-sensitive-methods>
+
</comments>
<general-patterns>true</general-patterns>
+
<!-- optional -->
<static-file-references>false</static-file-references>
+
<checks>
</checks>
+
<!-- specify which issue types to detect -->
  +
<embedded-strings>true</embedded-strings>
  +
<locale-sensitive-methods>false</locale-sensitive-methods>
  +
<general-patterns>true</general-patterns>
  +
<static-file-references>false</static-file-references>
  +
</checks>
 
</scan>
 
</scan>
</scans>
+
</scans>
</gzproject>
+
</gzproject>

Revision as of 21:54, 12 June 2019

What is Globalyzer Lite and Globalyzer CI/CD?

Globalyzer Lite is the product that allows users to scan code and create reports without having to use the Globalyzer Workbench or set up a database. In the Lingoport Continuous Globalization Server, Globalyzer Lite (Globalyzer CI/CD) is an integral part of the process to create reports that are displayed in the Lingoport Dashboard showing the number of internationalization issues detected.

GlobalyzerDashboard.png

Using Globalyzer Lite in a Continuous Globalization System

If the Lingoport Continuous Globalization System was installed and configured using the Stack Installer or Stack Updater, then Globalyzer Lite has already been integrated into the system.

  1. Check in a project definition file into source control.
  2. On-board a Jenkins project for the code base using one of the Globalyzer Lite templates like Lingoport.SampleLite or Lingoport.SampleLiteLRM.
  3. Check the Lingoport Dashboard and verify that the results are shown.

Globalyzer Lite is easy to integrate into other Continuous Integration (CI) systems as well.

  1. Check in a project definition file into source control (or, if you prefer, place one in the Jenkins server's filesystem).
  2. Run the following from Jenkins' shell:
    java -jar globalyzer-lite.jar -f "${WORKSPACE}/GlobalyzerProjectDefinitionFile.xml" --project-path "${WORKSPACE}" --report-path "globalyzer-lite-reports"
  3. Use the Lingoport Dashboard to display the results from the generated reports.

You may also pass the reports to your own reporting system.

Using Globalyzer Lite from a command line

Globalyzer Lite can be executed from a command prompt or shell via the following command:

java -jar globalyzer-lite.jar some_location/YourProjectDefinitionFile.xml

After Globalyzer Lite finishes each scan, a relevant Globalyzer report is created at the location specified in the Project Definition's report path.

Lite also allows for altering the following parameters via command line options:

  • The Project Path
  • The Report Path
  • The Files/Directories to scan
  • The location of the Globalyzer License (if using Local Rule Sets)

Project Definition Format

Here is the template for a project definition file. For the full instructions to setup a project definition file, see our help page.

  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<gzproject>
   <login>
       <server>  </server>    
       <username></username>  
       <password></password>  
       <use-local-rulesets></use-local-rulesets>  
       <optional>
           <proxy-user>    </proxy-user>
           <proxy-password></proxy-password>
           <proxy-host>    </proxy-host>  
           <proxy-port>    </proxy-port>  
       </optional>
   </login>
   <project-path></project-path> 
   <project-name></project-name>
   <report-path></report-path>   
   <report-type></report-type>   
   <data-dictionary-location></data-dictionary-location> 
   <filter-with-dictionary></filter-with-dictionary> 
   <scan-timeout>500</scan-timeout>  
   <generate-partial-results></generate-partial-results> 
   <save-history></save-history> 


   <scans>
       <scan>
           <scan-name>    </scan-name>
           <ruleset-name> </ruleset-name>  
           <ruleset-owner></ruleset-owner>
       </scan>
       <scan>
           <scan-name>    </scan-name>
           <ruleset-name> </ruleset-name>  
           <ruleset-owner></ruleset-owner>
           <use-machine-learning>true</use-machine-learning> 
           <encoding>UTF-8</encoding> 
           <scan-items>         
               <item></item>    
               <item></item>    
           </scan-items>
           <comments>
               <todo>SPECIAL_GLOBALYZER_TODO_COMMENT</todo>
               <ignore-next-line>GBLYZR_IGNORE_NEXT_LINE</ignore-next-line>
               <start-ignore>GLOBALYZER_START_IGNORE</start-ignore>
               <end-ignore>GBL_END_IGNORE</end-ignore>
           </comments>
           <checks>
             <embedded-strings>true</embedded-strings>
             <locale-sensitive-methods>false</locale-sensitive-methods>
             <general-patterns>true</general-patterns>
             <static-file-references>false</static-file-references>
           </checks>
       </scan>
   </scans>
</gzproject>