Hi Eric,
Thanks for the feedback and clarifying between environment and groovy
variable.
I did use the experession yesterday itself and able to proceed onto next
stage.
Regards
Somshekar C Kadam
9036660538
On Thu, Apr 26, 2018 at 7:43 PM, Eric Pyle wrote:
> You are correctly getting the resu
You are correctly getting the result value from file ${WORKSPACE}/result
in the code below, and setting it into a Groovy variable called
test_result. You must understand that this Groovy variable is completely
separate from the environment variable test_result which you (uselessly)
set in the a
Hi Slide,
I am trying to set global variable test_result in test stage and then
execute deploy stage using when directive.
As test_result is not changing at all, deploy stage is being skipped, not
sure why
I have tried otuside shell also using script block {}
File result is aviable in workspace, a
Ok let me check, thanks for the advice
regards
Somshekar
Regards
Somshekar C Kadam
9036660538
On Wed, Apr 25, 2018 at 5:06 PM, Slide wrote:
> Yes, you can do that, you just can't set it from a shell script.
>
> On Wed, Apr 25, 2018, 00:20 Somshekar C Kadam
> wrote:
>
>> Thanks Slide for the he
Yes, you can do that, you just can't set it from a shell script.
On Wed, Apr 25, 2018, 00:20 Somshekar C Kadam wrote:
> Thanks Slide for the help, things are clear.
> One more doubt I have, can we not set global variable which will set that
> variable between different stages
>
> For ex consider
Thanks Slide for the help, things are clear.
One more doubt I have, can we not set global variable which will set that
variable between different stages
For ex consider
once Unit test is passed
set variable pass = true
same variable will be used in QA test stage to start if pass = true, start
QA
The other problem is that you are expecting state to be retained between
invocations of sh.
sh 'cd /media/usb'
sh 'rm -rf testing'
sh 'mkdir testing'
sh 'cd testing'
git branch: 'feature', url: 'g...@github.com:
CelestialSystem/cyelp.git'
sh 'cp develop-unit/arm/ltp.
Hi Slide,
One more observation, this result file is not in workspace. that is the
reason its always outputting 1 when we print the file content.
This could be root cause in my understanding.
I am sorry I should have mentioned this ealrier that verify script writes
this file on hardisk which is not
Hi Slide,
Sorry for the delay got some personal work had to step out.
Here is the full script for test stage
Here verify script writes to "result" file 0 on success and 1 on failure.
I am checking on the machine its value is 0, but still when i compare value
of output as mentioned by you it is ti
Post your full script
On Thu, Apr 19, 2018, 06:52 Somshekar C Kadam wrote:
> Hi Slide,
>
> I meant always the result file has 0, using above readfile when I compare
> in if cond it always says 1, I have even echoed tha value its shows 1, not
> sure why
>
> regards
> Somshekar
>
> Regards
> Somsh
Hi Slide,
I meant always the result file has 0, using above readfile when I compare
in if cond it always says 1, I have even echoed tha value its shows 1, not
sure why
regards
Somshekar
Regards
Somshekar C Kadam
9036660538
On Thu, Apr 19, 2018 at 7:21 PM, Somshekar C Kadam
wrote:
> Hi Slide,
Hi Slide,
Thanks for the inputs.
I did check the value of output its returning always 1, actually it has
value 0. not sure why?
one more clarification can we call awk in script { } block ?
regards
Somshekar
Regards
Somshekar C Kadam
9036660538
On Thu, Apr 19, 2018 at 7:12 PM, Slide wrote:
Ok, then my suggestion is fine, after readFile, the variable output has the
value, so just use an if check directly in the script block of the
pipeline. script blocks are groovy scripts, so you can use most of the
functionality of groovy to do what you want.
On Thu, Apr 19, 2018 at 6:24 AM Somshek
Hi Slide,
You got it right.
result file contains either 0 or 1 as a unittest pass or fail.
I need to read this file which contains 0 or 1 and proceed next stage.
thanks in advance
regards
Somshekar
Regards
Somshekar C Kadam
9036660538
On Thu, Apr 19, 2018 at 6:52 PM, Slide wrote:
> Well, it
Well, it depends on what you are expecting to happen with these lines:
awk '{ if ($1 == 0 ) { $res = "passed" } else $res = "fail" }' result
awk '{ if ($1 == 0 ) { print "Success"; } else print "failure" }' result
The shell scripts don't take parameters, so what are you expecting to be in
$1? Wh
Hi Slide,
First of thanks for the response. Ok understood
Am not finding any documentation to do the same in jjenkinsfile.
Please can you point to it or any example will help
regards
Somshekar
Regards
Somshekar C Kadam
9036660538
On Thu, Apr 19, 2018 at 6:39 PM, Slide wrote:
> You can't set
You can't set res inside a shell script and have it set in the pipeline. It
seems like you are trying to use shell scripts to do things that could be
done directly in the Jenkinsfile as well. Is there a reason you are using
shell scripts for that?
On Thu, Apr 19, 2018 at 1:41 AM Somshekar wrote:
Hi All,
I am trying to change the value of string dependign upon the unittest cases
passed by reading a file.
For next stage to proceed I want to set the string depending upon the value
next stage qa or other stage can proceed.
but not able to change value f string in jenkins file.
value of
18 matches
Mail list logo