vodafoneitaly-maven-plugin
Summary
- Description
- Usage 1. SQ and MD templates
- Editing MS Word documents 1. Placeholders 1. Known issues
- SQ Documents
- Where to get help
- Contribution guidelines
- Contributor list
- Credits, Inspiration, Alternatives
Description
A Maven plugin useful to handle Vodafone Italy processes.
Actually it is able to create a kit for Canvass.
Usage
Add this to your pom:
<plugin>
<groupId>com.github.sixro</groupId>
<artifactId>vodafoneitaly-maven-plugin</artifactId>
<version>0.6-SNAPSHOT</version>
<executions>
<execution>
<id>canvass-kit</id>
<goals>
<goal>canvass-kit</goal>
</goals>
</execution>
</executions>
</plugin>
then in your properties define plugin properties:
<vodafoneitaly.canvass.system>Merlino</vodafoneitaly.canvass.system>
<vodafoneitaly.canvass.version>1.0.0</vodafoneitaly.canvass.version>
<vodafoneitaly.canvass.date>${project.version}</vodafoneitaly.canvass.date>
<vodafoneitaly.canvass.sgst>ST28633</vodafoneitaly.canvass.sgst>
<vodafoneitaly.canvass.releasePhase>Eccezione2</vodafoneitaly.canvass.releasePhase>
As you can see, we suggest to use the project.version for the vodafoneitaly.canvass.date. To explain the reason of that look at this example.
Imagine you have a project with this header:
<project [...]>
<modelVersion>4.0.0</modelVersion>
<groupId>myGroupId</groupId>
<artifactId>myArtifactId</artifactId>
<version>20140720</version>
<packaging>pom</packaging>
...
your deployment server will have:
myGroupId/myArtifactId/20140720/myArtifactId-20140720-Eccezione2.zip
where the version is 20140720 and the vodafoneitaly.canvass.releasePhase is used as a classifier.
Under build define a name with releasePhase:
...
<build>
<finalName>Kit${vodafoneitaly.canvass.releasePhase}</finalName>
...
Create a kit directory under src/main and under it create following subdirectories:
KitForOperations
|
+- yourSystem
| |
| +- DOCS
| | |
| | +- Delivery
| |
| +- SOFTWARE
|
+- SCRIPT
|
+- ORACLE
|
+- yourDatabase1
|
+- yourDatabase2
|
[...]
where yourSystem is the name of your system known by Vodafone and yourDatabase1 and others are your databases for which you release SQL scripts.
Copy softwares you need to release under KitForOperations/yourSystem/SOFTWARE.
Copy SQL scripts you need to release under databases directory found under KitForOperations/SCRIPT/ORACLE/.
Copy all your documents you need to release under KitForOperations/yourSystem/DOCS/Delivery. E.g. the RN.docx and the HO.docx. Do not copy MD and SQ(s) because they will be generated by the plugin. If you name your file without any number (e.g. RN.docx), your document name will be renamed with standard naming rule (e.g. RN-system-Vversion-date.docx). You can put in your documents placeholders like canvassSystem, canvassDate, etc... that will be replaced by the plugin on the destination folder.
Launch on your command line:
mvn clean install
You should find under target/vodafoneitaly/canvass-kit-exploded an exploded version of the kit, and under target/vodafoneitaly/canvass-kit a compressed kit with expected name.
In the exploded directory you'll find that the plugin:
- has copied all SQL scripts updating line ending in DOS mode and changing the first row as required by Vodafone DBA (obsolete CVS Id)
- has generated all
SQfiles needed for all SQL scripts found underKitForOperations/yourSystem/DOCS/Delivery - has generated
MDfile underKitForOperations/yourSystem/DOCS/Deliverylisting all files found underKitForOperations/yourSystem/SOFTWARE, calculatingcksum, etc... - has copied all MS Word files found in
kitdirectory (recursive) updating all placeholders found in them - has copied all other files found in
kitdirectory (recursive) - has generated
md5files
SQ and MD templates
The plugin has SQ and MD templates within itself. If you need to change them, set properties:
vodafoneitaly.canvass.kit.sq.templatevodafoneitaly.canvass.kit.md.template
Editing MS Word documents
Placeholders
You can use following placeholders in your MS Word documents:
canvassSystem: the value of the propertyvodafoneitaly.canvass.systemcanvassVersion: the value of the propertyvodafoneitaly.canvass.versioncanvassDate: the value of the propertyvodafoneitaly.canvass.datecanvassIsoDate: a version ofcanvassDatein ISO 8601 format (e.g.2014-07-20)canvassSgst: the value of the propertyvodafoneitaly.canvass.sgstcanvassReleasePhase: the value of the propertyvodafoneitaly.canvass.releasePhasecanvassKitSoftwaresSubdirectory: the subdirectory of softwares (e.g.KitForOperations/yourSystem/SOFTWARE)canvassKitDocsSubdirectory: the subdirectory of softwares (e.g.KitForOperations/yourSystem/DOCS/Delivery)canvassKitTargetFile: the target file of the kitcanvassKitTargetFileName: the target filename of the kitcanvassKitDoc1Filename: the name of the first document (docx,doc,xlsandxlsx) filename. This represents the first column of the table found in the section "List of documents" of theRN(Release Notes) document. You have alsocanvassKitDoc1Documentfor the second column,canvassKitDoc1Versionfor the third,canvassKitDoc1Extensionfor the fourth andcanvassKitDoc1Titlefor the last one. You have these properties for a maximum of 10 documents. Simply change1with the desired number (e.g.canvassKitDoc10Version).canvassKitDocFilenames: a comma separated list of all document filenamescanvassKitDocumentsSq1Filename: the firstSQfilename generated. You have a maximum of 5SQplaceholders so if you need the fifth usecanvassKitDocumentsSq5FilenamecanvassKitDocumentsSqFilenames: a comma separated list of allSQfilenames
and all other properties you define in specific section of your pom. E.g. if you define a property java.version like here:
...
<properties>
...
<java.version>1.6</java.version>
...
</properties>
...
you could use a new placeholder called javaVersion.
Known issues
There are known issues with placeholders in MS Word:
- if you edit a placeholder, it is possible that it won't be replaced by the plugin. Try to select the placeholder entirely, activate a style (e.g. bold) and deactivate it
- if a placeholder is inside a table and it is on more than one page, it won't be replaced by the plugin. You need to change the table option that permit to broke rows between pages.
SQ Documents
SQ documents are filled using all SQL scripts found.
The plugin reads all "metadata" found in the beginning of the script and use them to fullfil the excel.
There are some rules to follow:
- if you need to specify a
duration(default1 minuto), add it at the end of theDESCRIPTIONmetadata between square parenthesis. E.g.DESCRIPTION : my description [1 ora] - the
versionand theupdatedDate(used in the first row) are found inVERSIONmetadata. The more recent version has to be on the same line of the metadata and the format isVERSION - UPDATE_DATE TEXT.
Here an example:
REM $Id$
/*****************************************************************
**** ****
**** PACKAGE TEMPLATE ****
**** ****
******************************************************************
SCRIPT NAME : SYS00027.sql
AUTHOR : Rossi, Mario (02 99.32.221)
RESPONSIBLE : Rossi, Mario (02 99.32.221)
SG/ST : ST11111
BUG/OTHER :
SYSTEM : Sysolator
MODULE :
VERSION : 1.7 - 04/07/2014 This is a recent version
1.6 - 05/12/2013 This is an older version
DESCRIPTION : My description [3 ore]
CONSTRAINT :
WARNING :
DATABASE : SYSDB
SCHEMA : SYSSCHEMA
*****************************************************************
*****************************************************************/
set time on
set timing on
set echo on
set linesize 132
...
Where to get help
To get help, open an issue. In the future I hope to provide help using something else...
Contribution guidelines
To write this plugin I'm following this manual. You can find project notes here.
All contributions are welcome. The project uses a MIT License (as you can see in the root of the project). All you need to do is fork the project and send me a pull-request. Thanks!
Contributor list
Credits, Inspiration, Alternatives
The main reason I created this tool, is to create quickly kit for Vodafone Italy Canvass.
Besides, there are so many things to remember in order to create a valid kit that I need to recreate it at least twice.
I thought that a lot of those things was the perfect food for a computer and this is the result.