Can Jenkins show the number of fail build \ succesful build? - android-studio

I am working with android studio and got a task to use Jenkins pipeline in order to get the amount of successful or failed builds.
what I am searching for is a gradle script to enter my JenkinsFile in order to see these amount.
Some sort of a counter if that is even possible.
Would appreciate any sort of help, thank you!

Related

Issue with build pipeline

I am trying to implement a CI/CD pipeline as mentioned in this video by "tech with nana".
But I always end up with this error which says -make: command not found.
However, I have written in my pipeline code as explained by her in the video.
How do I fix this?
Check first if your YAML is correctly written.
Typically, -make should be - make (note the space between - and make).
The GitLab pipeline editor can help verify the configuration syntax automatically.

GitLab CI: How to fail on new compiler warnings

We are trying to get an old legacy code base under control while simultaneously developing new features. Currently the code compiles with a hell of a lot of compiler warnings and warnings from static code analyzers. For that reason it is not uncommon that code introducing new warnings reaches production simply because the new warning got lost in the shuffle.
Currently we are using Jenkins for nightly builds and make the build fail on new warnings. However, when Jenkins detects the new warnings the code was already merged a few hours ago. So we would like to not only shorten the feedback cycle but also ensure to only merge changes that do not introduce new warnings.
As far as I know it is possible to trigger a Jenkins build on a push to GitLab. But Jenkins can only compare the count of warnings to the previous build. But we would need to compare to a build of a different branch.
Can GitLab CI or a combination of GitLab EE and Jenkins somehow be configured to detect if a merge request introduces new warnings?
Yes that is possible but that's rather an open-ended question that will depend a lot on how long a build takes and how you will compare the outcomes.
You don't have to run only the checks on the branch you have checked out. You may set up two jobs in parallel that run tests on current branch and the develop branch, pass them as artifacts to a third job and compare them there.
You may want to store the state of a build on your develop branch and download the artifact to your current job and compare it against the local results. You could also store them in a database, on a file server or wherever else it's comfortable.
Finally you may try an external code quality tool like SonarQube which has greater insight into what's new and what's old.
In the meantime tools got developed that allow a workflow which is not perfect but comes quite close.
Jenkins has the Warnings Next Generation Plugin which can compare the warnings found in one Jenkins job to the warnings found in another Jenkins job. So we set up a job to compile our develop branch each time a new commit is pushed to it. We then use the results as baseline. Another job that gets triggered for each merge request in GitLab then uses this baseline to determine the new warnings introduced by the merge request.
This works reasonably well.

Phabricator run Gitlab CI build

I was looking for a solution, how can I start a build from phabricator. Currently we are using triggers for starting builds, but I need to start it when the review is passed in phabricator. Anyone know a solution for this problem?
The flow is the next: We take the task from the Review to the Testing, and this is what need to start the trigger which start the build under Gitlab. It is not necessary do the same, if anyone know an other solution or a best practice I am happy to hear.

Hudson : Scheduling a build without a tag and generate a report

How can I schedule a build without tag over Windows, Linux and WCE in Hudson using a shell script and generate a report that will be sent to a specified server?
And so the conditions are :
1. How can I create the build without creating a new tag?
2. How is it possible to excute .sh over windows and WCE (Windows Mobile), is it simply by going through Cygwin? Moreover, having a cross-platform (3 platforms) build does it mean that I must run the build 3 times?
3. How to generate a report and save it in a directory of a server that I'm authorized to access to?
I know that I asked many questions at once. It is because this is my first use of Hudson and these are kind of details. Moreover, I don't want to make a mistake by creating new tags during my tests. The 1st and 3rd questions are the most important. If anyone gives me the right answer to them, I'll choose it as the right answer.
Thank you a lot.
first, people nowadays mostly use jenkins instead of hudson (open source, better support)
build can be started manually in hudson / jenkins, just click the green arrow. It will create a new build but won't change your repository (unless the last step of your build is creating a tag, in that case, just remove that step for testing)
Usually, .sh scripts run in shell excecutables (ash, sh, bash, csh...) and are not supported of the shell on windows. You'll have to go through cygwin or have a platform specific build command
kind of not clear for me. If you use jenkins to build a matric build (with the matrix axis being your target platform), you'll have automatically a nice report in jenkins itself (status of each build). You can keep artifacts (use post-build action : archive the artifacts) or use another plugin to publish the file you like (exemple : ftp reporting)
Sorry not being able to be more precise, that's how far I understand your questions.

How to keep only red builds in jenkins

How to keep only the failed builds logs in a job history?
I haven't enough disk space to store both successful and failed builds. I'm looking for a simple way to keep all the red one's logs and none of the blue/green on a Linux jenkins. (Perhaps with a Post-build Action?)
The Discard Old Build plugin can do that for you:
From the link:

Resources