This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Integration Dimensions and PMD

Hello.

I want share my post-script to integrate Dimensions and PMD.

PMD is a tool for source code analyzer. It finds unused variables, empty catch blocks, unnecessary object creation, etc.

Its post-script run after deploy source files and run PMD tool, capture the PMD log result and attach it into Dimensions Change Request deployed.

Its is a .cmd (.bat) file for Windows.

It is my contribution to the Comunity.

)CM archivo de log del deploy
)SET LOGNAME=dep_asegcalidad_%DMDJQJOBID..log
)SET LOG=D:\Aseguramiento_Calidad\aplicaciones\empresas\logs\%LOGNAME.
)CM archivo de log del analisis de codigo
)SET ANALISISNAME=aseg_calidad_%DMDJQJOBID..html
)SET LOGANALISIS=D:\Aseguramiento_Calidad\aplicaciones\empresas\logs\%ANALISISNAME.

echo =============== INICIO DEL PROCESO DE POSTSCRIPT =============== >> %LOG.
echo Fecha: %DMDAY./%DMMONTH./%DMYEAR.-%DMHOUR.:%DMMINUTE.:%DMSECOND. >> %LOG.
echo Job: %DMDJQJOBID. >> %LOG.


)IF %DMJOBTYPE. = DEPLOY
)CM SOLO SE EJECUTA SI EL PROCESO ES UN DEPLOY. SI ES ROLLBACK NO SE EJECUTA ANALISIS

)REP DMREQUEST
echo CR: %DMREQUEST. >> %LOG.
)ENDR


)REP DMDIR DMFILENAME
echo Archivo: %DMDIR.%DMFILENAME. >> %LOG.
)ENDR
echo =============== FIN DEL PROCESO DE POSTSCRIPT =============== >> %LOG.

 


echo =============== INCIO DEL PROCESO DE ANALISIS DE CODIGO FUENTE =============== >> %LOG.
CALL pmd -d D:\Aseguramiento_Calidad\aplicaciones\empresas\aseg_calid\ -R rulesets/java/quickstart.xml -no-cache -f html -reportfile %LOGANALISIS.
echo =============== FIN DEL PROCESO DE ANALISIS DE CODIGO FUENTE =============== >> %LOG.

echo =============== INICIO DEL PROCESO DE ATTACHMENT =============== >> %LOG.
)CM attachment de archivo de log al CR
CALL dmcli -param "D:\Aseguramiento_Calidad\aplicaciones\dimparam.txt" -cmd "UC %DMREQUEST. /ADD_ATTACHMENTS=([USER_FILE= %LOG., FILENAME=%LOGNAME.])"
)CM attachment de archivo de resultado del analisis al CR
CALL dmcli -param "D:\Aseguramiento_Calidad\aplicaciones\dimparam.txt" -cmd "UC %DMREQUEST. /ADD_ATTACHMENTS=([USER_FILE= %LOGANALISIS., FILENAME=%ANALISISNAME.])"
echo =============== FIN DEL PROCESO DE ATTACHMENT =============== >> %LOG.

)ENDIF


exit 0

 

Cesar.

 

Tags: