Install SingleAgent in gradle jib build
Step 1: Download the agent locally in any linux machine using the below command.
curl http://43.205.166.134:8880/applicare/standalone?filename=ApplicareSingleAgentLinux >ApplicareSingleAgentLinux.zip
Step 2: Unzip the ApplicareSingleAgentLinux.zip file and remove the ApplicareSingleAgentLinux.zip file.
unzip -o ApplicareSingleAgentLinux.zip -d ApplicareSingleAgentLinux
rm -rf ApplicareSingleAgentLinux.zip
Step 3: Edit the logback.xml file from the ApplicareSingleAgentLinux\logback directory.
Step 4: Comment the existing pattern (line 28) and add the below pattern after that line and save it.
<pattern>%d %-5p [%X{sessionId}] [%X{userId}] %C{1}.%M:%L] %m%n</pattern>
Step 5: Delete the below files in the ApplicareSingleAgentLinux directory.
a. ApplicareSingleAgentLinux/bin/phantomjs
b. ApplicareSingleAgentLinux/jre
c. ApplicareSingleAgentLinux/bin/apache-ant
d. ApplicareSingleAgentLinux/bin/pdk
Step 6: Copy that ApplicareSingleAgentLinux directory and paste it in the home directory of your Gradle jib project.
Step 7: Put below content in build.gradle file inside jib.
extraDirectories {
paths {
path {
// copies the contents of 'ApplicareSingleAgentLinux' into '/extras/ApplicareSingleAgentLinux' on the container
from = file('ApplicareSingleAgentLinux')
into = '/extras/ApplicareSingleAgentLinux'
}
}
container {
jvmFlags = ['-Xverify:none','-javaagent:/extras/ApplicareSingleAgentLinux/applicare-aspects.jar=verbosity=0,logfile=false,norestart-intellitrace=false','-Darcturus_home=/extras/ApplicareSingleAgentLinux','-Djava.library.path=.;/extras/ApplicareSingleAgentLinux/bin']
}
}
Important Note:
If the catalina.home or catalina.base jvm arguments are not available in your application jvm arguments then please add the -Dcatalina.base="" argument in the end of the jvmFlags.
container {
jvmFlags = ['-Xverify:none','-javaagent:/extras/ApplicareSingleAgentLinux/applicare-aspects.jar=verbosity=0,logfile=false,norestart-intellitrace=false','-Darcturus_home=/extras/ApplicareSingleAgentLinux','-Djava.library.path=.;/extras/ApplicareSingleAgentLinux/bin','-Dcatalina.base=""]
}
Please sign in to leave a comment.
Comments
0 comments