Gradle is not executing multiple tasks - jenkins

https://docs.gradle.org/current/userguide/command_line_interface.html#_executing_multiple_tasks
I know gradle allows to execute multi-tasks in order.
In my case, gradle stopped when it finishes the first tasks
my command is like:
gradle taskA taskB taksC
It just skip everything after taskA.
My gradle is 4.1

Related

How to pass cucumber runner class in Jenkins?

I have two runners file in my cucumber framework, 1. The main runner.java which executes all of my feature files and 2. FailedRunner which only needs to be triggered when the first runner reports any failures.
Now the current execution method I am using is
gradle clean build -Denv=QA -Dcucumber.filter.tags=#QA
Now, I would Also like to pass my runner file name so that, I can create a upstream/downstream job to run the failedRunner class for retries for MainRunner file.
Thanks

Running parallel stages on node with one executor

Suppose that I have one jenkins node with one executor and I have to run i.e. tests and build stages in parallel.
node("jenkinsNodeWithOneExecutor") {
parallel {
test: {echo "run test" ... }
build: {echo "run build" ...}
}
}
How this will work? In the logs I see that that it runs parallel. Is it possible? I thought that every parallel task needs own executor...
PS. When trying to run job twice: Waiting for next available executor on ...
When you run a job in parallel the job will branch off and create two different jobs which will (ideally) execute simultaneously.
In your example you'd actually have three jobs: the original job, the "test" job, and the "build" job. You would need three executors available to process the script in parallel. If you're running the initial job on the same node you're trying to run parallel jobs on and you only have one executor this job would always hang indefinitely waiting for an executor that will never be available. If you're running the original job on another node it'd process your jobs sequentially since you only have one executor.
Are you sure you want to run your tests in parallel with your build? Typically tests have a dependency on whatever you've built. This would run the tests at the same time as the build and your build artifacts may not be available yet.

Why does my Gradle Jenkins plugin try to pass my command line switches before the tasks

I'm trying to run my tests in Jenkins with Gradle. I have a gradle task called 'test' and I specify which tests to run with --tests
Using the Jenkins Gradle plugin, I've specified the Switches (--tests ) and Tasks ('test') but when the build actually runs it puts the --tests stuff before the tasks which doesn't work at all. I need the task to come first on the commandline before the switches otherwise it doesn't work. What can I do here?
If you add --tests to Tasks in the right order it should work.
I.e. try adding
test --tests <test include expression>
as Tasks.
Switches is just for convenience - in the end everything will end up as the argument list of the gradle executable.

Build with multiple ant tasks

I have a jenkins build with three ant tasks. If the first ant task fails, jenkins continues with the next ant task. How can I get jenkins to fail the build and stop when an ant task fails?
I'm assuming you're missing a "failonerror=true" attribute within your ant task. A lot of sub tasks default this value to false. (e.g. Java Task for example).
Could you post your entire ant script if that's not the case?

Building ANT Task through Jenkins with SASS

I have an ANT task where it calls a SASS cmd.
This works properly in eclipse, but when I try to call that Ant task through Jenkins, it says "It could not find sass...(Gem::LoadError)"
I have the jenkins process running as 'root'.

Resources