Using Jenkins and irrFuscator - doesn't get past obfuscateing the source - ant

I dont know if anyone out there will have tried using Jenkins / Ant / irrFuscator combo - hopefully someone has and can provide some direction.
The problem is I start a build in jenkins, everything seems to be building fine until I hit the part of my build where the ant file calls irrFuscator. At this point Jenkins still says that it is trying to build the project (the building wheel keeps spinning) but nothing seems to be happening in irrFuscator.
I have checked Task Manager and irrFuscator is taking no cpu time.
If I force quit irrFuscator from Task Manager the build fails - so jenkins knows of irrFuscators existance.
I have run the build outside of jenkins and everything seems to build fine.
Build logs can be provided but there is no useful information there - it just says its waiting.
If anyone has any ideas I would love to hear from you! And if further info is needed please feel free to ask.
Thanks for taking the time to read!

Never used irrFuscator, but first things to check:
Make sure you are running Jenkins in the foreground (and not as a background service). The simplest way to do it is with java -jar jenkins.war [other options] command (refer to this document).
Make sure that you run Jenkins as the same user as you run it when it works outside Jenkins.

Related

How to run Robot Framework/Sikuli test cases with Jenkins?

I am trying to run some automated tests for desktop apps. The code is written in Robot Framework and Sikuli. If I run them from command line, it is okay, but when I try it from Jenkins it is not.
Here is how I try to build in Jenkins
Here is the simple code:
Help
[Tags] help
Capture Screen
Click input_id
This is the result:
As you see it could not see my screen. What should I do to let the "Jenkins process" see my screen?
The issue was, that I installed Jenkins as a Windows service. After I installed via the jenkins.war file, it works.

How can I get the path of a newly built apk in gitlab after the code is checked in, which I need in the command 'curl' to upload it to ADF

I wrote a python script, which uses boto3 to schedule android app UI test on ADF. My next step is to make gitlab CI work. My test suite program is Java Appium with TestNG, not integrated with the android program.
My problem now is how to get the PATH of files(apk and test.zip) in gitlab repo which needed in curl command to upload the newly build apk(builded after new code checked in) and my test suite.
Actually, foremost, am I in the right track?
Can I use curl in gitlab like that?
If so, what's the path I could use? (if you could shortly explain the storage structure(or say namespace?) or give me some reference). Actually, is it just take the project home directory as '/'?
for test suite, its actually easier, if I figure out what's the path, I could just put it in the home directory.
for the newly built apk, I don't actually know where is it. We use the pipeline, I think the apk file is somewhere in the server. Below is the YAML snippet:
archive_project:
stage: archive
script:
- ./gradlew assembleRelease
only:
- master
- search
artifacts:
paths:
- main/build/outputs/
tags:
- android
- gradle
If not, how can I do that? This actually suit if I am not in the right track as well.
So after you check in code, the runner look at the .gitlab_ci.yml, and runs following its instruction. And this process, happens in the server machine(either yours or gitlab's), so everything is basically the same as you in your computer(sure you will need the right environment, just appoint the right image or docker).
so yes, we could use 'curl' there. For the directory structure, if you have the privilege to login your server(thru ssh, for instance), you could get it easily. Or we could just explore it like what we do locally(pwd, ls, cd). So what I did is I have a script which have some "pwd, ls, cd ", and call this script from yml, then I look at the info it print to help figure out the directory structure. Then I got what I want(the path), then problem solved.
Although I didn't use dependencies, but you might want to read it to get more about how to pass artifacts between jobs.
If you are looking for this problem, hope it helps you.

ANY WAY to RUn Debug/ Verbose Mode IN Jenkins, for .HPI plugin

I am having an issue with .HPI(jenkins Plugin) and so far no one is able to help me.
JENKINS .HPI dependencies issue << click on this link
so now i am wondering , is there a way that,
When using my .HPI(jenkins Plugin) in jenkins, I can run it in a debug or verbose mode, so i can see on the Console Output(in jenkins) what is exactly that is going on.
I think i am getting an error cause it is not going to the right .jar ....
when i ran it in eclipse I have no issue. ( i know which jar it is going to in debug mode in eclipse)
if you cannot run the .HPI(jenkins Plugin) in a verbose or debug mode in jenkins , maybe i can run it as a .WAR ? in a verbose or debug mode in jenkins ?
since i have read that .HPI is very similar to a .WAR.
so that way i can see in the output console exactly what .jar it is going to.
If someone can help me or point me in a direction it will be really helpful.
Try a debug from Eclipse! If it's not working, just add some logs to your project and when you run it in Jenkins, take a look at the logs in console ( easy if you start Jenkins from command line). Or, in the Jenkins installation folder there should be some log files.
Next time can you put the question more clear? It's somehow hard to understand what you ask.
Yes, I read your questions. I'm not sure if you'll can see which jar/ lib is chose by Jenkins.
But, about the link,previous question, I had a problem somehow like you with some libraries and tests, when I worked as plugin developer. I'm not sure if I remember correctly, but, just try, create a folder in your project, let's say libs, put the jars in that folder and add the folder to build-path in eclipse and maven should take care of them.
Not sure if it'll work, but you should try. Sorry I can't help you more!

MSBuild - Jenkins - Nuget integration

We are experiencing some weird behavior using Jenkins and MSBuild.
When manually typing into a command line to build a build.xml project:
msbuild build.xml /T:Package /P:PublishProfile=Test /P:Platform="AnyCPU"
/P:VisualStudioVersion=12.0
The build process works exactly as expected (build, packaging, etc.)
However, if I am using Jenkins to do exactly this - that is - open a command line and run this exact command, I get an error saying:
The command ""..\.nuget\NuGet.exe" install
"C:\Jenkins\jobs\.....\workspace\MYPROJECT\packages.config"
-source "" -NonInteractive -RequireConsent -solutionDir "..\ "" exited with code 1
Even if I am using the built-in jenkins plugin to run the command (regardless which parma combination I use), it still doesn't.
I know two of the following sounds like a solution, but they don't work:
Permissions! - My server always runs as admin.
Enabling package restoring on NuGet from VS - Already did!
Any idea will be great!!!
Here is the answer, it took a long time to solve, and thanks to #adarshr I came to realize the problem is because of the difference between the Jenkins runner's user (i.e the jenkins Service) and my user. To resolve this issue I've made Jenkins running as the same user and all good!
Step by step:
Go to Control Panel -> System and Security -> Administrative Tools
Click on the Services shortcut.
Right click on the Jenkins service and select Properties.
Navigate to the Log On tab.
Click on run as this user and fill in your credentials.
Restart Jenkins.
Works like a charm!

jenkins debugging with eclipse

I have built a new "Hello World" plugin for Jenkins and I was able to upload it onto Jenkins and it works successfully. I am now trying to make change to the plugin and debug it on Jenkins. I did this according to the instructions on this tutorial https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial
I tried this command:
mvnDebug hpi:run
and then start to debug from eclipse to the port 8000 which is the port that Jenkins opens up for debugging. The eclipse was able to connect to the correct port and I got the message which seems to be correct:
[info] Jenkins is fully up and running
It seems that everything went OK. Then I go to localhost:8080 to see the plugin but I found nothing there. Can anybody help me with this, please? Thanks.
Ok, about debugging Jenkins plugins, I know that there is a little amount of information. I can tell you how I debug:
Using the tutorial from https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial#Plugintutorial-DebuggingaPlugin
1. stop jenkins service
2. from cmd I run
set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n
and
mvn hpi:run
Note: Build automatically must be unchecked in Eclipse. And after I run mvn hpi:run I try to connect Eclipse to the port using java remote ( or something like this).
The second method that I use is:
1. I installed maven plugin in eclipse
2. Create a run configuration as maven in eclipse
3. Stop jenkins server
4. Run the configuration
5. Access localhost:8080/jenkins
Sorry for not giving the exact steps but I have those configurations on my PC at work...
Also, in my opinion the second method is more stable. I use it frequently when I work with my plugin...

Resources