in the code snippet it should have had a second line:
echo output
On Fri, Mar 27, 2020 at 1:09 PM Daniel Butler
wrote:
> If you want to see the bat file output, remove the returnStdOut. You only
> need that if you want to assign the output to variable and use it later in
> the pipel
If you want to see the bat file output, remove the returnStdOut. You only
need that if you want to assign the output to variable and use it later in
the pipeline.
if you still want it in the logging as well as a variable:
output = bat returnStdout: true, script: 'echo %PATH%'
On Fri, 27 Mar 20
You could use the Pipeline Multibranch Defaults plugin which does the
hardcoded in the job approach
https://github.com/jenkinsci/pipeline-multibranch-defaults-plugin/blob/master/README.md
If a stub file in Repo-A is acceptable you could also use a shared library
to store the actual jenkinsfile as
Replace ${mytime} with \$mytime
The mytime variable you've created is a bash one.
Regards
Daniel
On Thu, 2 May 2019, 1:16 pm b o b i, wrote:
> Jenkins 2.174, in a scripted pipeline the following
>
> sh """#!/bin/bash
>echo "TTT"
>mytime="`date '+%Y_%m_%d__%H_%M_%S'
Strings using single quotes do not do variable expansion; you must use
double quotes to have the variables expand.
So:
'$var' is the literal string $var
"$var" expands to the string value of the variable $var
and the same is true for multi line strings
'''
$var
'''
does not expand
"""
I’m assuming you’re meaning freestyle jobs? Usually you’d have a parameter in
Job X with the upstream job name that you can then use in the Parameterized
Build Trigger to pass the parameter to Job X.
What will be in place however to stop this ending up in a build loop? Otherwise
Job B is going
You could use the lockable resources plugin (v2.2+):
Set up a single resource for each node and give them all a common label
Then your Jenkinsfile would be:
lock(label: "common-label", variable: "LOCKED_NODE"){
node(env.LOCKED_NODE){
//build project
}
}
Regards,
Daniel.
On Thu,
Hi Vicki,
According to https://wiki.jenkins.io/display/JENKINS/Parameterized+Build, for
buildWithParameters you should use URL query params to pass the values.
To use your example:
curl -v https://jenkins/job/JobName/buildWithParameters?targ_env=dev --user
userName:userToken
Regards,
Daniel
If you set the number of executors on both master and slave to 1 that will
restrict the number of builds to one per node put a third into the queue.
Regards
Daniel
On Fri, 24 Aug 2018, 12:58 Nati Mirauta, wrote:
> Hello,
>
> I would like to know if there is a way to run a job on master once and
I believe this was added a month or two ago.
On 10 Jan 2018 6:33 pm, "Idan Adar" wrote:
> Is the following feasible?
>
> 1. Setup a Shared Library in the Jenkins settings
> 2. In every repository requiring the Jenkinsfile (it is the same one used
> in multiple repos...), use the following in the
If you use currentBuild.currentResult (was added a few months ago IIRC) you get
a value that will never be null.
From: jer...@bodycad.com
Sent: 04 December 2017 17:06
To: Jenkins Users
Subject: Re: Translation between declaritive pipleline and groovy pipeline
You need to wrap your groovy code i
er 1, 2017 at 9:08:12 AM UTC-5, Daniel Butler wrote:
If you’re writing a groovy class that’s run from a library in the pipeline
script then you’re not going to be able to use System.getEnv().
There’s a few approaches you can take that do work:
• You can pass in the values you need as parameters to th
This is my preferred as it’s nice and explicit:
class MyClass implements Serializable {
def ctx
MyClass(ctx) {
this.ctx=ctx
}
def bark(){
ctx.sh 'echo WOOF!'
}
}
You’d then construct it:
def mc = new MyClass(this)
If you remove the class definition so you end up with a gr
If you’re writing a groovy class that’s run from a library in the pipeline
script then you’re not going to be able to use System.getEnv().
There’s a few approaches you can take that do work:
- You can pass in the values you need as parameters to the methods/constructors
you’re using.
- In the pi
entVariableCredentialsProvider())
.build()
On Monday, November 20, 2017 at 6:57:07 AM UTC-5, Daniel Butler wrote:
By doing System.getenv() you're getting the environment of the Jenkins master
process.
The environment that will be used by any process run in the pipeline is
available through t
By doing System.getenv() you're getting the environment of the Jenkins
master process.
The environment that will be used by any process run in the pipeline is
available through the built-in variable env.
Regards,
Daniel
On 20 Nov 2017 2:14 am, "red 888" wrote:
In my pipeline I'm injecting aws
The powershell step in pipeline is provided by the same plugin that
provides the bat and sh steps. It's separate to the powershell plugin
which is for freestyle jobs.
On 31 Oct 2017 12:51 pm, "itchymuzzle" wrote:
Doesn’t answer my original question, but is a valid work around.
#! /usr/bin/e
Couple of approaches:
You could use the External Workspace Manager plugin:
https://jenkins.io/doc/pipeline/steps/external-workspace-manager/
Or as Robert suggested use the ws(){} block, this should give a guarantee on
the workspace but you’ll need to confirm that you’re not about to fill up you
The variables for the withCredentials step are created in the environment map,
to use them in the pipeline script you’ll need to refer them as env.
So for your case it would be: echo “${env.OD_USER}”
That should run but all you’ll see is a bunch of *** as the withCredentials
step filters the log
in my case:
I choosed execute windows batch command and typed the following:
""" cd c:\
\mysql --username --password -e "DROP DATABASE xyz; CREATE DATABASE xyz;"
"""
Is there something which am missing ?
Regards,
Harvey
On Monday, September 4,
Looking at the bracket positions in your log snippet, it looks like there could
be a trailing space or two after the file name in the File text box. Make sure
there’s no extra spaces around the file name as that could be messing it up.
Regards,
Daniel.
From: Ana MB
Sent: 04 September 2017 12:37
Are you using freestyle jobs or pipeline?
With Pipeline:
When you use a bat/sh step you’re providing a batch or shell script rather than
virtual input into a console.
In your case you’d need to do something like:
bat """
cd c:\...
...\mysql --user %user% --password %password% -e "DROP DATABASE
The XUnit plugin has support for MSTest output and is pipeline compatible.
You’d still need to run MSTest from a bat/powershell command but the Xunit
plugin will publish the test output.
From: jer...@bodycad.com
Sent: 16 August 2017 13:24
To: Jenkins Users
Subject: Re: Does anyone know if the MS
I’ve got triggering of Multibranches working using a user API token (from the
users config page) and curl. You can’t set job specific tokens on multibranch.
e.g.
Curl -x POST http://jenkins:8080/test-multibranch/job/master/build -u
user:0123456789abcedf0123456789abcdef
From: Rainer Hörbe
Sent:
The multibranch plugin from version 2.15 does support custom names for the
pipeline script so you can now have multiple multibranch projects on the same
repo.
As for only building on changes applicable to the respective folders I’m not
able to answer that. If each of these projects are changing
In a multibranch project you simply do:
checkout scm
And that clones/checks out the current branch.
Cheers,
Daniel Butler
From: R Srinivasan
Sent: 01 July 2017 12:45
To: Jenkins Users
Subject: finding git repo url
For Multibranch pipeline jobs,
how do I clone the git Repo? I can find what the
Hello,
If you have a look in the Pipeline Steps each instance of “Allocate Node :
Start” will have a link to the workspace used for that node block.
Cheers,
Daniel.
From: Ewgenij Gawrilow
Sent: 11 May 2017 14:32
To: Jenkins Users
Subject: Accessing workspace from WebUI in a multi-branch pipeli
27 matches
Mail list logo