IBM/dbb

PublishLoadModules Jar files- groovyx.net.http.RestClient error

Opened this issue · 9 comments

Hi ,

I'm trying to publish the artifacts to nexus repository once the build is completed, Document mentioned it requires some jar which are mentioned in ArtifactoryHelpers.groovy. we tried without adding any jar while we build we got error like "unable to resolve groovyx.net.http.RestClient" - Is this issue is related to missing of jar ?

*In case to import the jar files to <dbb_install_dir>/lib , is that requires all jar files which are mentioned in ArtifactoryHelpers.groovy in binary format?

Please help me to resolve this.

Hi,
groovyx.net.http.RestClient is not included in DBB, you need to download http-builder + dependencies which contains it and add it to your lib download.

Hi Dennis,

we have downloaded the required jar files, while trying to move to <dbb_install_dir>/lib , here the lib folder is read only file in that case how to use those jars? how to point to those jar files when the PublishLoadModule.groovy is executed as part of build.groovy ? Please help us with this.

Hi,
You can add a classpath option to the groovyz command. This will be prepended to the groovyz classpath when executed. Assuming that you uploaded the jar files to /etc/dbb/lib/you would code the command as:

$DBB_HOME/bin/groovyz -cp /etc/dbb/lib/* DownloadLoadModule.groovy

Hi @drbruce-git

I understand the concept but I don't know where to provide $DBB_HOME/bin/groovyz -cp /etc/dbb/lib/* DownloadLoadModule.groovy , is that we need to give in jenkins ? because if i need to publish the module and later i need to download it . could you please specific that where i need to give this command .

Hi,

There is a reference in the README in the publishLoadModule folder. Sadly, this sample was developed before zAppBuild was released. Do you run zAppBuild?

For MortgageV1 you could include the script sample at:
https://github.com/IBM/dbb/blob/master/Build/MortgageApplication/build/build.groovy#L177
you would need to code something like:

if (properties.error == "CLEAN"){
Class publishLoadModuleScript = new GroovyClassLoader(getClass().getClassLoader()).parseClass(new File("./PublishLoadModule.groovy"));
GroovyObject publishLoadModule = (GroovyObject) publishLoadModuleScript.newInstance();
publishLoadModule.run()
}

From my perspective, the high level workflow should be as follows - to have loosely coupling of the steps:

  1. Invoke build.groovy to perform the build step.
  2. Extend the pipeline and add a new step to invoke the PublishLoadModule.groovy script. The existing script would need to be extended to take workDir as a command line property and reads the BuildReport.json - like in build.groovy - --workDir ${WORKSPACE}/work (depending how you use it). You can have a look here, how the properties are read: https://github.com/IBM/dbb/blob/master/Pipeline/CreateUCDComponentVersion/dbb-ucd-packaging.groovy#L43

When deploying to the target environment download.sh provides a sample to include that.

What is your strategy for packaging and deployment? Any tools already set?

hi @dennis-behm

Thanks for your valuable suggestion, we tried the same as you suggested. we have created the separate Job in Jenkins which invokes PublishLoadModule.groovy. Here once the build.groovy is completed it will trigger the jenkins job which invokes PublishLoadModule.groovy here the jar files path are specified in class path and working directory and loadDatasets are specified in the script parameter. Below is the error we got.

/usr/lpp/IBM/dbb/groovy-2.4.12/bin/groovy -cp /v/ibmuser/groovynexus/:/usr/lpp/IBM/dbb/lib/:/usr/include/java_classes/* /u/ibmuser/dvmjenkins/workspace/FINTECHAPP/Build/PublishLoadModules/PublishLoadModule.groovy --workDir /u/ibmuser/dvmjenkins/BUILD-286
--loadDatasets=DBB.NEW.LOAD
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, /u/ibmuser/dvmjenkins/workspace/FINTECHAPP/Build/PublishLoadModules/PublishLoadModule.groovy: 41: unexpected token: def @ line 41, column 9.
def (dataset, member) = output.dataset.split("\(|\)")
^

1 error

Build step 'Execute Groovy script' marked build as failure
Finished: FAILURE

Please help us how to resolve this.
we have used UCD for deployment but now we are trying to push the load modules using the groovy script.

hi @Nagaraj1995 the above is a coding issue on

def (dataset, member) = output.dataset.split("\(|\)")

You need to assign a variable ...
Where you able to resolve this?

hi @dennis-behm
I understand there is coding issue but not sure what is the variable need to be defined, though I am new to groovy. could you please help me with what need to be defined ? any sample code ? Please help me to close this issue.

@Nagaraj1995
It is difficult to help, without understanding the context of your work. Can you please reach out to me via email dennis.behm(at)de.ibm.com ?