Re: Any way to construct a url to a particular file in the jenkins workspace?

2021-09-13 Thread Jerome Godbout
Humm, that would be hard and security unwise. The executing node path 
aren't available to the web. If you are on a secure local network and you 
really want to go down that road, you need to 

   1. mount the slave nodes into the master node local path that would be 
   accessible by the jenkins web process. 
   2. You need to expose those path to the web master node (this is a 
   security breach). 
   3. You would have to make relative path from the node, then recreate the 
   path to the web local web path.

I think it would be easier to just gather artifacts and make them available 
to jenkins results. 

Example from the number above:
slave node (SLAVE1) path: /myjenkinsworkspace/projectA/MyPathIWant
master node mount (do this for every slave node you need): 
$SLAVE1:/myjenkinsworkspace /MyJenkinsSlaveAccess/Slave1
Expose the whole /MyJenkinsSlaveAccess/ to the Jenkins web (this is a huge 
security breach), depend how you serve the jenkins to the web, configure 
the share (build in, ngix, apache...)
then convert the MyPathIWant to a valid jenkins url:
/myjenkinsworkspace/projectA/MyPathIWant --> 
http://myjenkins/MyJenkinsSlaveAccess/Salve1/MyPathIWant

That would work, but I would not recommand that.
On Monday, September 13, 2021 at 11:28:11 AM UTC-4 davidmic...@gmail.com 
wrote:

> Thanks for the reply, but I think you've misunderstood the problem.  
> Getting, using, and publishing the filesystem path to the file is not a 
> problem. What I need to do is create a functional url to that file, which I 
> can print in the Jenkins build output, which a user can click to get to 
> that file.
>
> On Monday, September 13, 2021 at 6:40:56 AM UTC-7 jerome.god...@gmail.com 
> wrote:
>
>> Some helper I made for my scripted:
>>
>> Path conversion:
>> *def ToWindowsPath(path) {*
>> *return path.replace("/", "\\");*
>> *}*
>>
>> *def ToUnixPath(path) {*
>> *return path.replace("\\","/");*
>> *}*
>>
>> *def ToNativePath(path) {*
>> *if(isUnix()) {*
>> *return ToUnixPath(path);*
>> * }*
>> *return ToWindowsPath(path);*
>> *}*
>>
>> *def RemoveLastChar(str) {*
>> *return str.substring(0, str.length() - 1);*
>> *}*
>>
>> *def RemoveFirstChar(str) {*
>> *return str.substring(1, str.length());*
>> *}*
>>
>> Joining path part:
>> *def PathJoin(path1, path2) {*
>> *String p1 = ToUnixPath(path1);*
>> *String p2 = ToUnixPath(path2);*
>> *if(p1.length() > 1 && p1.endsWith("/")) {*
>> *p1 = RemoveLastChar(p1);*
>> * }*
>> *if(p2.startsWith("/")) {*
>> *p2 = RemoveFirstChar(p2);*
>> * }*
>> *if(p1 == "/") {*
>> *return p1 + p2;*
>> * }*
>> *if(p1.length() == 0) {*
>> *return p2;*
>> * }*
>> *if(p2.length() == 0) {*
>> *return p1;*
>> * }*
>> *return p1 + "/" + p2;*
>> *}*
>>
>> *def PathsJoin(paths) {*
>> *String result_path = "";*
>> *if(paths instanceof List && paths.size() > 0) {*
>> *result_path = paths[0];*
>> *for(int i = 1; i < paths.size(); ++i) {*
>> *result_path = PathJoin(result_path, paths[i]);*
>> * }*
>> * }*
>> *return result_path;*
>> *}*
>>
>> And to get the workspace root, you can use the pwd command, when the 
>> script start onto the node, the current dir is the workspace, so you could 
>> save it into a var with pwd command at the beginning. After use the path 
>> join above to recreate some path.
>>
>> https://www.jenkins.io/doc/pipeline/steps/workflow-basic-steps/#pwd-determine-current-directory
>>
>>
>> On Monday, September 13, 2021 at 2:30:18 AM UTC-4 ice...@googlemail.com 
>> wrote:
>>
>>> Hi,
>>>
>>> no, not really. Especially as  workspaces typically are reused between 
>>> jobs such an URL would be at leas open to surprise.  Best practice is to 
>>> archive such files (log output, generated files. ) as  artifacts to get 
>>> persistence. 
>>>
>>> Björn
>>>
>>> davidmic...@gmail.com schrieb am Freitag, 10. September 2021 um 
>>> 22:09:36 UTC+2:
>>>
 I do notice that my build has a "BUILD_URL" var in the environment, so 
 that gives me the "prefix" of the url, but the url to the file in the 
 workspace has pieces like the following after the BUILD_URL value: 
 "/execution/node/22/ws/". I don't see anything else in the environment 
 that 
 can help me construct that part of the url.

 On Friday, September 10, 2021 at 9:22:16 AM UTC-7 David Karr wrote:

> When a Jenkins build completes, I can navigate to "Workspaces" to 
> manually inspect files in the workspace.  While I'm navigating that tree, 
> and viewing specific files, I can see that the current browser url goes 
> directly to that point in the tree, and to the specific file I am viewing.
>
> Is there a practical way in a Jenkins scripted pipeline, to CONSTRUCT 
> a url to a file in the workspace so I can print it out in the log, to 
> enable a single click to get to a particular file?
>


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 

Re: Any way to construct a url to a particular file in the jenkins workspace?

2021-09-13 Thread Jerome Godbout
Some helper I made for my scripted:

Path conversion:
*def ToWindowsPath(path) {*
*return path.replace("/", "\\");*
*}*

*def ToUnixPath(path) {*
*return path.replace("\\","/");*
*}*

*def ToNativePath(path) {*
*if(isUnix()) {*
*return ToUnixPath(path);*
* }*
*return ToWindowsPath(path);*
*}*

*def RemoveLastChar(str) {*
*return str.substring(0, str.length() - 1);*
*}*

*def RemoveFirstChar(str) {*
*return str.substring(1, str.length());*
*}*

Joining path part:
*def PathJoin(path1, path2) {*
*String p1 = ToUnixPath(path1);*
*String p2 = ToUnixPath(path2);*
*if(p1.length() > 1 && p1.endsWith("/")) {*
*p1 = RemoveLastChar(p1);*
* }*
*if(p2.startsWith("/")) {*
*p2 = RemoveFirstChar(p2);*
* }*
*if(p1 == "/") {*
*return p1 + p2;*
* }*
*if(p1.length() == 0) {*
*return p2;*
* }*
*if(p2.length() == 0) {*
*return p1;*
* }*
*return p1 + "/" + p2;*
*}*

*def PathsJoin(paths) {*
*String result_path = "";*
*if(paths instanceof List && paths.size() > 0) {*
*result_path = paths[0];*
*for(int i = 1; i < paths.size(); ++i) {*
*result_path = PathJoin(result_path, paths[i]);*
* }*
* }*
*return result_path;*
*}*

And to get the workspace root, you can use the pwd command, when the script 
start onto the node, the current dir is the workspace, so you could save it 
into a var with pwd command at the beginning. After use the path join above 
to recreate some path.
https://www.jenkins.io/doc/pipeline/steps/workflow-basic-steps/#pwd-determine-current-directory


On Monday, September 13, 2021 at 2:30:18 AM UTC-4 ice...@googlemail.com 
wrote:

> Hi,
>
> no, not really. Especially as  workspaces typically are reused between 
> jobs such an URL would be at leas open to surprise.  Best practice is to 
> archive such files (log output, generated files. ) as  artifacts to get 
> persistence. 
>
> Björn
>
> davidmic...@gmail.com schrieb am Freitag, 10. September 2021 um 22:09:36 
> UTC+2:
>
>> I do notice that my build has a "BUILD_URL" var in the environment, so 
>> that gives me the "prefix" of the url, but the url to the file in the 
>> workspace has pieces like the following after the BUILD_URL value: 
>> "/execution/node/22/ws/". I don't see anything else in the environment that 
>> can help me construct that part of the url.
>>
>> On Friday, September 10, 2021 at 9:22:16 AM UTC-7 David Karr wrote:
>>
>>> When a Jenkins build completes, I can navigate to "Workspaces" to 
>>> manually inspect files in the workspace.  While I'm navigating that tree, 
>>> and viewing specific files, I can see that the current browser url goes 
>>> directly to that point in the tree, and to the specific file I am viewing.
>>>
>>> Is there a practical way in a Jenkins scripted pipeline, to CONSTRUCT a 
>>> url to a file in the workspace so I can print it out in the log, to enable 
>>> a single click to get to a particular file?
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/14c806a7-7337-48a1-9cb7-c2a112a99372n%40googlegroups.com.


Re: Can't run shell script in docker container

2021-09-02 Thread Jerome Godbout


Are you sure the mount of tmp did work and not superseed by another default 
mount there?

Maybe try to touch a new file from the docker and see if it show up into 
the original tmp folder. If so, it mean you might have permission problems 
instead. Make sure to allow rw for everyone on the file before.

On Thursday, September 2, 2021 at 7:18:50 AM UTC-4 il...@icandeliver.ru 
wrote:

> Good day!
>
> I am trying to run a shell script in a docker container.  The script is 
> created on the host in the folder: 
> */var/jenkins_home/workspace/Production/Test2@tmp*
>
> The container by default is starts with the following volumes:
> *--volume /var/jenkins_home:/var/jenkins_home:rw --volume /tmp:/tmp:rw*
>
> But it is launched in the container from the folder:
>
> */bin/sh: can't open '/tmp/jenkins15846770116304196347.sh': No such file 
> or directory Build step 'Execute shell' marked build as failure*
>
> How to fix that issue?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b4966eea-f1d1-40d1-b2c2-4ea84f3aa6a3n%40googlegroups.com.


Re: Execute shell script from jenkins

2021-08-12 Thread Jerome Godbout


You can also use the WSL on recent Windows and call the wsl shell, which 
can be call with:

“wsl ${cmd}”

I made myself a function that do call the proper shell based on the current 
platform, so my pipeline script does look like a big if else mess for each 
shell command, on windows it append the wsl in front of my command and fix 
the stdout return value. 

Here is some groovy scripts function I do inject to “fix” (or if you prefer 
bring it to human decent version of command) the shell: 

*/**

** Console cross platform command*

**/*

def BasicConsole(labelStr, cmd, returnStatus = *false*, returnStdout = 
*false*, useWsl = *false*) {

*// Only good for exact same syntax command on all platform or use wsl 
to execute the command into unix like under Windows if this is available*

*if*(isUnix()) {

*return*
 sh(label: labelStr, script: cmd, returnStatus: returnStatus, returnStdout: 
returnStdout);

} *else* {

*return*
 WindowFixReturn(bat(label: labelStr, script: WindowFixCmd(cmd, useWsl), 
returnStatus: returnStatus, returnStdout: returnStdout), returnStdout);

}

}

 

def ConsoleVar(varName) {

*if*(isUnix()) {

*return* "\${${varName}}";

} *else* {

*return* "%${varName}%";

}

}

 

def WindowFixReturn(data, returnStdout) {

*if*(returnStdout) {

*// Remove the requested command echo into the shell, this make the 
behavior more closer to unix for cross platform behavior*

*return* data.trim().readLines().drop(1).join("\n");

}

*return* data;

}

 

def WindowFixCmd(cmd, useWsl) {

*if*(useWsl) {

*return* WindowsWslCommand(cmd);

}

*return* cmd;

}

 

def WindowsWslCommand(cmd) {

*return* "wsl ${cmd}";

}

 

def WindowsEscapeVarPercentage(str) {

*if*(isUnix()) {

*return* str;

}

*// If we want literal %*

*return* str.replace("%", "%%");

}

 

def ConsoleScriptExtension() {

*if*(isUnix()) {

*return* ".sh";

} *else* {

*return* ".bat";

}

}

 

def ConsoleCommandDelimiter() {

*// When doing command that must be execute no matter the results of 
the first one*

*if*(isUnix()) {

*return* ";";

} *else* {

*return* "&";

}

}

 

 

I did some file manipulation commands for files and folders manip (delete, 
create, exist, etc) some my pipeline scripts now run the same code on all 
platform without issues and remove the big if(isWindows()) mess all around.

 

Wish they have made this build in. This is a CI, this is what it should do 
manipulated files in many env. Feel like this is lacking big time.

 

If you want to detect the main platform for the 3 majors OS and you need to 
determine which one it is:

*/**

** Platform specific check*

**/*

def GetOS() {

*if*(isUnix()) {

def uname = sh(script: 'uname', returnStdout: *true*);

*if*(uname.startsWith("Darwin")) {

*return* "MacOS";

}

*// TODO godboutj 2019-07-30, Add other *nix check here*

*return* "Linux";

}

*return* "Windows";

}

 

def IsMacOS() {

*return* GetOS() == "MacOS";

}

 

def IsLinux() {

*return* GetOS() == "Linux";

}

 

def IsWindows() {

*return* GetOS() == "Windows";

}

 

Then you can manipulate the path:

*/**

** Path Manipulation*

**/*

def ToWindowsPath(path) {

*return* path.replace("/", "\\");

}

 

def ToUnixPath(path) {

*return* path.replace("\\","/");

}

 

def ToNativePath(path) {

*if*(isUnix()) {

*return* ToUnixPath(path);

}

*return* ToWindowsPath(path);

}

 

This allow for very simple scripts and make it bearable to work with the 
Jenkins API.

On Thursday, August 12, 2021 at 11:00:28 AM UTC-4 kuzh...@gmail.com wrote:

> Hello everyone,
>
> How can I execute shell scripts from jenkins? 
>
> I have the below code in "Execute Shell" command
> ""
> #!/bin/bash
> echo "hello"
>
> Received the following Error Msg  in the console.
>
> Running as SYSTEM Building on master in workspace 
> C:\Users\crnat\.jenkins\workspace\ssh-task-test [ssh-task-test] $ /bin/bash 
> C:\Users\crnat\AppData\Local\Temp\jenkins563122492098989130.sh The system 
> cannot find the file specified FATAL: command execution failed 
> java.io.IOException: CreateProcess error=2, The system cannot find the file 
> specified at java.lang.ProcessImpl.create(Native Method) at 
> java.lang.ProcessImpl.(Unknown Source) at 
> java.lang.ProcessImpl.start(Unknown Source) Caused: java.io.IOException: 
> Cannot run program "/bin/bash" (in directory 
> "C:\Users\crnat\.jenkins\workspace\ssh-task-test"): CreateProcess error=2, 
> The system cannot find the file specified at 
> java.lang.ProcessBuilder.start(Unknown Source) at 
> hudson.Proc$LocalProc.(Proc.java:252) at 
> hudson.Proc$LocalProc.(Proc.java:221) at 
> hudson.Launcher$LocalLauncher.launch(Launcher.java:996) at 
> hudson.Launcher$ProcStarter.start(Launcher.java:508) at 
> 

Jenkins pipeline git branch push trigger

2019-11-11 Thread Jerome Godbout
Hi,
I'm using my Jenkins file pipeline to checkout and build, I have a pipeline 
project I would like to get triggered only when a push to a specific branch 
occur. The Git repos is host on bitbucket cloud services. I cannot make a 
webhook, since the Jenkins run on an intranet and cannot be access from the 
web.

Is there a way to trigger on a push on release/test and not on master or 
any other branch for example? how can I do this?

my pipeline checkout look like this so far:
checkout([$class: 'GitSCM'
, branches: [[name: repos['branch']]]
, browser: [$class: 'BitbucketWeb', repoUrl: repos['url']]
, doGenerateSubmoduleConfigurations: false
, extensions: [[$class: 'CloneOption', noTags: false], 
[$class: 'LocalBranch', localBranch: "**"], [$class: 'SubmoduleOption', 
disableSubmodules: false, parentCredentials: true, recursiveSubmodules: 
true, reference: '', trackingSubmodules: false], [$class: 'CleanCheckout'], 
[$class: 'CleanBeforeCheckout']]
, submoduleCfg: []
, userRemoteConfigs: [[credentialsId: 'BitBucketAmotus', 
url: repos['url']]]
]);

Thanks,



-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f0093a38-edbb-42a0-953f-5201242d11e8%40googlegroups.com.


Re: NodeLabel Parameter Plugin with Scripted pipeline

2017-12-13 Thread jerome
For prosperity, my finding is:

   1. it seem like the node have their node name as label automatically (I 
   realized this when trying to add the node name to the label, the label was 
   disappearing when saving the changes) 
   2. Knowning number 1 point, I could just use the named parametrized 
   input and ask for the node name as unique label, which was forcing the 
   Jenkinsfile to run on that node.
   3. parametrized build is node type: name: ENFORCED_NODE, fill the rest 
   as wanted
   4. Use it as follow into the scripted pipeline Jenkinsfiles: 

println("Enforced node: $ENFORCED_NODE")
node(!ENFORCED_NODE ? 'windows && x64' : ENFORCED_NODE)
{
...
}



-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f39b4b3d-bf6a-4e2f-9498-9b98dd44bcae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


NodeLabel Parameter Plugin with Scripted pipeline

2017-12-06 Thread jerome
Is anybody can point me to some info or an how to use the node and label 
parameter.

I can make it work with a choice list but I would rather make it work with 
the plugin if possible with proper default value.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/1be9feec-0729-4741-8871-514aa8db982f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: location of email-ext template file

2017-12-06 Thread jerome
For security reason I was told, the template must reside on the master (you 
can stash it and unstash it into the email template folder on the master or 
you can read it and write it on master node):

node('master')
{
  writeFile([file: "${JENKINS_HOME}/email-templates/mytempofile.jelly", 
text: 'template data read from other file']);
}
emailext body: ...

At least it was my workaround until I find something less retarded.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/4d6da8a2-8b3e-45c2-8545-bf858e768378%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Translation between declaritive pipleline and groovy pipeline

2017-12-04 Thread jerome
You need to wrap your groovy code into a try/catch/finally block and check 
the current build result ( I also give you some hint when things are not 
yet filled)
try
{
}
catch(any)
{
  println('Error occurred during build:');
  println(any.toString());
  println('Marking build as FAILURE because of this');
  currentBuild.result = 'FAILURE'
  throw any //rethrow exception to prevent the build from proceeding
}
finally
{
  if(!currentBuild.result)
  {
currentBuild.result = 'SUCCESS'
println("Current build result is undefined, setting it as 
${currentBuild.result}")
  }
  // send email
  emailext body: 'my email body', subject: 'email subject', to: 
't...@test.dev', replyTo: 't...@test.dev', mimeType: 'text/html';
}


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/dfdf3042-8b26-4f83-b43f-a17b8142a4a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkinsfile and its complete properties list

2017-11-13 Thread jerome
Not sure I got this right but if you are looking how the system check for 
modification and trigger new execution, Jenkinsfile need a successful 
manual build first. This will record the repos checkout and according to 
the jobs settings and the checkout options, can start polling/trigger new 
execution.

NOTE: Warning/Error build don't record the repos to be poll, you need a 
successful build for this to happen for the first time at least.

If you are looking how to trigger a build from a remote 
command: https://wiki.jenkins.io/display/JENKINS/Remote+access+API

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/58720d40-8f06-48c2-b426-6a6add3ebbae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: SharedLibrary, clone, using resources

2017-11-03 Thread jerome
Jenkins checkout the Jenkinsfile first and then the scm inside the jenkins 
checkout. If you can, try to enable the Lightweight checkout on the 
jenkinsfile checkout.

Side note, I for one make a repos for the jenkins file that is not the same 
as the code repos, so my server and build setup evolve at different pace as 
the code and I can build old version into a recent configuration (jenkins 
updated and jenkinsfile needed to be modified for a while). I did more 
enjoy doing it this way then having my Jenkins file static into a revision 
of the source repos. I can also try different Jenkinsfile with the same 
source code Jenkinsfile checkout use build parameter.
Side note #2: I also use mercurial with sub repos, so my jenkinsfile pull 
subrepos for the shared scripts/lib/exe that I use during the build 
process, this work like a charm.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3bbb7e7e-f34b-47b6-9218-84dd8014a009%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Declarative script: 'bat' command fails but job succeeds

2017-10-19 Thread jerome
Not sure about declarative pipeline (I haven't played with them yet). but 
for normal pipeline I use it this way:
bat returnStatus: false, script: "\"${bcad.msbuild_current}\" 
${bcad.msbuild_solution_name} ${bcad.msbuild_default_arg} /t:Build"

You can find the doc here:
https://jenkins.io/doc/pipeline/steps/workflow-durable-task-step/#bat-windows-batch-script

returnStatus can be check or not if you want, if you don't want to end the 
script for warnings like my above example. You can then use msbuild parser 
for example
step([$class: 'WarningsPublisher', canRunOnFailed: true, consoleParsers: [[
parserName: 'MSBuild']]])

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/0e30d94d-ccfc-4b72-b8a8-a7280ee99ce5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Declarative script: 'bat' command fails but job succeeds

2017-10-18 Thread jerome
Take care batch error level only is valid for the last command and not a 
cumulative flag. So every msbuild command you run should check the error 
level result and exit batch according to it with proper error code. This 
will make the bat command failed properly. I personnaly would suggest, you 
run run each msbuild command into separated bat command so you will known 
which one failed, but that's totally up to you. Also make sure you give the 
proper  bat argument returnStatus into your pipeline scripts.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8b5daca4-a072-4d1e-b06d-fcd4aeefb356%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mercurial checkout failure

2017-09-14 Thread jerome
Finally found the error, some CIFS share cache were used, now I mount all 
the drive with cache=none and I disabled the oplocks of the samba share, it 
seem to have fix the issue.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/89c5d1b7-6f8d-495d-866a-4db800950d50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running a bat file

2017-09-14 Thread jerome
I'm not sure if you are using pipeline or not, either way, when you said 
the command succeed, the fact that a batch complete doesn't make it 
successful, make sure to evaluate the %errorlevel%  after critical command. 
ALso if you are using pipeline, make sure to check if the returnStatus 
and returnStdout to make sure you can fetch some information.

Also, I'm not sure if asadmin can be run by your jenkins service (make sure 
it got permission to do so). If Jenkins is installed as a service, take 
care no GUI can be launch from that user. If your start-domain use any gui, 
you will need to run your Jenkins as a real user and keep that user login 
under Windows. 
Also does the asadmin is available into the PATH of your jenkins user, may 
want to provide a full path.

If you can give more meat around the way you run your batch command and 
some console output that would help to help you.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/d4242e34-d82e-4a3e-b027-c05c03c6f972%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running a bat file

2017-09-12 Thread jerome
Take care that you are actually chaining batch command. What is chaining 
batch, someone somewhere though it would be nice to make this super weird 
feature for batch script only (yeah a lot of sarcasm here, the first time 
you see this beahavior and realize wtf someone wanted to do this is beyond 
total common sense), where you call a batch from another batch script, the 
remaining in between one can be skipped entirely. Here's the documentation 
from https://jpsoft.com/help/call.htm which give a better explanation of 
this eye bleeding nightmare:

WARNING! If you execute a batch file from inside another batch file without 
using CALL, the original batch file is terminated before the other one 
starts. This method of invoking a batch file from another is usually 
referred to as chaining. Note that if the batch file A.BTM uses CALL B, and 
B.BTM chains to the batch file C.BTM, on exit from C.BTM (without executing 
a CANCEL  command) processing of batch 
file A.BTM is resumed as if it had used CALL C.

I suspect that the Jenkins shell execute the script you gave it as it is a 
call itself maybe, maybe the Jenkins people can shed some light on this.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/d6337c9f-723b-48fb-b7f5-c13283deb708%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Mercurial checkout failure

2017-08-30 Thread jerome
Hi,
I have intermittent problems with my hgweb with .cgi and apache (everything 
seem to work fine), I can perform a full checkout without issue with 
TortoiseHG under Windows machines to the web address, but sometime I got 
this error when doing the checkout into Jenkins:

hg pull --rev default*08:07:21* pulling from http://MyHost/MyRepos/ 
*08:07:21* searching for changes*08:07:21* adding 
changesets*08:07:21* adding manifests*08:07:21* transaction abort!*08:07:21* 
rollback completed*08:07:21* abort: stream ended unexpectedly (got 0 bytes, 
expected 4)


I can start a build and end up with this and start again and it will work just 
fine a few minute later. The apache server access log only have 200 return code 
for the hgweb virtual host and the main access. Nothing into the error log. I'm 
a bit confuse about what can cause this, I double checked the network config of 
all machine imply into this and nothing seem to be wrong (ipV4, ipV6, hostname, 
domain) everything seem to be fine and ping work flawlessly under 0.75 ms. 
Anybody have a clue or a way to check what happen into those case? what is 
happening that close the stream (host unreachable, timeout, ...)?


Any tips is welcome here, I'm a bit at lost, I don't have anything into logs 
except this abort and I don't understand why.


Jenkins 2.73

Mercurial plugins 2.0

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f88561c2-8985-4210-8e3a-2fb88c85ccd3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: JNLP slave with fixed TCP port.

2017-08-18 Thread jerome
Here's some info and the port list required:

https://stackoverflow.com/questions/17472291/jenkins-slave-port-number-for-firewall

JNLP port 49187 worked ("Configure Global Security" -> "TCP port for JNLP 
slave agents").

TCP
49187 - Fixed jnlp port
8080 - jenkins http port

Other ports needed to launch slave as a windows service

TCP
135 
139 
445

UDP
137
138

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/309f3174-db9e-4125-b4fa-07514335cf38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Does anyone know if the MSTest plugin supports pipelines and how to use it in a pipeline (jenkinsfile)?

2017-08-16 Thread jerome
Sadly no, many puglin are still incompatible, you can see the compatibility 
list here: 
https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md

Since the .trx is just an xml file, you could try to do an .xslt file that 
do the convertion to junit .xml. Maybe someone already did it somewhere, 
worth googling, I known some people have done .trx to .html graph (which 
you could use and publish the html results too).

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/75edf196-1d55-4bca-b0df-e0025e837f28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help with NotSerializableException in pipeline

2017-08-07 Thread jerome
Maybe not relevent, but I would declare the function above/before the main 
stage. Maybe this won't change anything. Also is the suitesStat properly 
defined when declared? [AutoSuiteSet_0:0 ...]

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/196f9dc8-3445-4fca-8030-475caaec4191%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


SCM polling into recent Jenkins version

2017-08-04 Thread jerome
Hi,
I have a strange behavior with the polling system, the polling cron like 
work fine but the checkup is totally wrong, it see to use old settings and 
not the latest Jenkinsfile (2.72 with up to date plugins in today date).

My Jenkins file does 3 Hg checkout:

   1. Jenkinsfile
   2. Build script helpers
   3. Source

The helper scripts are checkout into tmp subdir (poll is false I don't want 
to rebuild because of change on this) (#2)
def build_helper_scripts = 
"${jenkinsfile_scripts}\\JenkinsBuildHelperScripts"
dir("${build_helper_scripts}") 
{
checkout changelog: false, poll: false, scm: [$class: 'MercurialSCM', 
source: "http://BCADLX04/Jenkinsfile ", 
browser:[$class: 'HgWeb', url: "http://BCADLX04/Jenkinsfile 
"], clean: false, credentialsId: '', revision: 
"${PIPELINE_BRANCH_NAME}", revisionType: "BRANCH"]
}

After that the second checkout is main repos inside the workspace (poll is 
true, #3):
checkout changelog: true, poll: true, scm: [$class: 'MercurialSCM', source: 
"http://BCADLX04/B odycad", browser:[$class: 
'HgWeb', url: "http://BCADLX04/B odycad"], 
clean: false, credentialsId: '', revision: "${BRANCH_NAME}", revisionType: 
"BRANCH"];

I started the build manually so the system have the jenkinsfile entry into 
it.
The build number  *Mercurial Build Data* show the proper revision and the 
build complete (with an error, 1 unit test failed).

Then the polling execute itself at the proper time but I end up with the 
following thing into the *Mercurial Polling Log*

Started on Aug 3, 2017 7:03:00 PM
[CAD_CPP_ContinuousBuild@script] $ hg pull --rev VS2015
pulling from http://BCADLX04/Jenkinsfile 
no changes found
[CAD_CPP_ContinuousBuild@script] $ hg log --rev VS2015 --template {node}
[CAD_CPP_ContinuousBuild@script] $ hg log --rev VS2015 --template {rev}
no polling baseline in 
c:\Jenkins\workspace\CAD_CPP\CAD_CPP_ContinuousBuild@tmp\Jenkinsfile on Windows 
10 Node
ERROR: no such computer Windows 10 Node
Done. Took 2.4 sec
No changes


The problems is that the *Windows 10 Node* no more exist for a while now 
(way before the yesterday manual execution). The last build (manually 
started yesterday) was not using it anymore, it check the Jenkinsfile for 
polling (#1), ok I guess this is fair and a wanted behavior, but the real 
checkout #3 is not more checked! 

Where is the polling information kept? Can I reset this properly and how 
(manual build doesn't seem to had any effect)?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b0b3897b-c67f-41cb-921d-be9a59fb1935%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I'm trying to learn Jenkins Pipeline - pointers to good programmer documentation? Or is Jenkins World the place I should go????

2017-08-04 Thread jerome
>> Do you have to shell out and cp everything? If that's the case, how do 
you properly handle errors etc?

The sh/bat have the returnStatus and returnStdout. Sadly no returnStdError, 
so you need to pipe and I suggest to use 'tee' to duplicate it if need such 
feature. 
https://jenkins.io/doc/pipeline/steps/workflow-durable-task-step/

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f0956c3f-4ca7-4dca-8a50-384c6a5f75db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline - how to copy a directory of files from outside of workspace into a workspace using groovy?

2017-08-02 Thread jerome
It's not as funny as it should be for a build system manipulating file 
should be fairly easy. There is no direct way, but here a solution that 
would probably work I haven't test it:

   1. Zip the folder into a single file from the particular source node
   2. statch the file (or maybe if the **/* ant work you could try to stash 
   the whole directory) from the source node
   3. unstash it on the wanted target node
   4. unzip it (if not stash a dir)

That should work and copy the source directory into target properly, at 
least I hope.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b763d243-47b5-4f28-a2d1-098f65fc332b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I'm trying to learn Jenkins Pipeline - pointers to good programmer documentation? Or is Jenkins World the place I should go????

2017-08-02 Thread jerome
I totally agree with Stephen here, the pipeline script engine is a lock 
down groovy with many quirks and approval mess. Making it a painful 
experience. Do as much as possible into your build scripts (.vcxproj, 
makefile, shell script, python...). Just launch them and take light 
decision into pipeline. If you shell scripts are working, you may want to 
clean them to just launch the build and run sequence and let Jenkins 
pipeline deceide which node should be launch and do the tests on each 
platform/OS.
The declarative pipeline seem to make it easier to do things like this, but 
from what I have seen into this forum so far, many things ain't working so 
well yet, but it's definitely the future thing with blue ocean.

I for one do use jenkins pipeline (non declarative one) and it make only 
243 lines  (with a lots of comments and even file headers) that does all 
the following:

   1. checkout repos
   2. checkout an helper repos for scripts (python, executable that does 
   specific jobs)
   3. build whole solution with msbuild
   4. build unit tests
   5. run the tests
   6. extract results results
   7. extract benchmarks data and graph them between build (into an HTML 
   web graph)
   8. Syntax checking for qmllint, Qml dir inspection, .vcxproj, .csproj 
   9. Generate the Doxygen doc

Many of those things are done into python outside pipeline script, the 
pipeline only launch them (using either sh or bat) back to back as 
different stage.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/663ec671-39c1-4708-8c06-0af75396428d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Q: How to choose nodes for build based on parameter?

2017-08-01 Thread jerome
Nice! is the plugin: 
https://wiki.jenkins.io/display/JENKINS/NodeLabel+Parameter+Plugin
compatible with pipeline script (declarative or normal one)? if yes how do 
we use it into those configuration?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/9771abad-9e1e-4fc6-8f62-4c6c2bdb8a11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Q: How to choose nodes for build based on parameter?

2017-07-31 Thread jerome



Check for choice parameters plugins like:
https://wiki.jenkins.io/display/JENKINS/Extensible+Choice+Parameter+plugin
there also a validation plugins if you allow custom entry.

I guess the node selection should work (take care " and not '):

node("${NODE_LABEL}")




-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/14549f00-f27b-440b-b73b-e7c031874a01%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins running unit tests MSTest 10.0

2017-07-18 Thread jerome
Many thing can cause this

   - unreliable tests, where concurrency can occur or uninitialized values
   - Windows permission
   - invalid path inside the machine
   - the user under which the salve run the tests (service under windows 
   don't have access to the GUI part and you need to run the salve under a 
   normal user account, OpenGL, DirectX, Canvas, Qt, etc)
   - Make sure the number you get is valid with MsBuild command line and 
   not Visual Studio (they aren't totally the same when it come to project 
   behavior).
   - Make sure you use the right visual studio/MsBuild version along the 
   right architecture (x86 vs x64).
   - Try to run your tests multiple times into random order if the test 
   suite allow it (help catch some problems).
   - Make sure you development env and jenkins slave have the Fault 
   Tolerent Heap disabled (world worst idea ever was born on the day that damn 
   thing was created)
   https://msdn.microsoft.com/en-us/library/dd744764(VS.85).aspx

A failed tests even if not always happening (once in a blue moon also 
apply) is always a bug somewhere.

On Tuesday, July 18, 2017 at 9:05:34 AM UTC-4, Simon Whale wrote:
>
> Hi, 
>
> I am wondering if someone can help.  I have setup Jenkins to run Unit 
> Tests.  Our application currently has 289 tests.   
>
> If I run it through Jenkins only 89 pass.  But If I run it through VS 2010 
> 247 pass. 
>
> Is there something that I should be doing in Jenkins? 
>
> This is how I have configured the Execute Windows batch command in the 
> build settings for the project. 
>
> "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe" 
> /resultsfile:"%WORKSPACE%\Brian\Results.trx" /testcontainer:"C:\Program 
> Files\Jenkins\workspace\Brian - 
> Freestyle\Brian\trunk\BrianTestProject\bin\x86\Debug\BrianTestProject.dll" 
> /nologo
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/0ea27d79-eef9-4cff-9277-f8ec9d9e1c45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is pipeline timeout suppose to work?

2017-07-12 Thread jerome
I think I got my answer about it into the console log after a hang, I had 
to restart the jenkins service and got this as a result:

*04:18:53* 
*04:18:53* Build succeeded.
*04:18:53* 0 Warning(s)
*04:18:53* 0 Error(s)
*04:18:53* 
*04:18:53* Time Elapsed 00:14:25.77
Waiting to resume part of Bodycad cpp projects » CAD_CPP_ContinuousBuild #172: 
JGMachine  is offline
Waiting to resume part of Bodycad cpp projects » CAD_CPP_ContinuousBuild #172: 
JGMachine  is offline
Ready to run at Wed Jul 12 10:50:34 EDT 2017
*10:50:34* Timeout expired 5 hr 46 min ago
*10:50:34* Cancelling nested steps due to timeout
[Pipeline] }
[Pipeline] // timeout
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // timestamps
[Pipeline] echo
Error occurred during build:
[Pipeline] echo
java.lang.Exception: Resume after a restart not supported for non-blocking 
synchronous steps


the line: 
*10:50:34* Timeout expired 5 hr 46 min ago
tell me that it cannot be used that way.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c424e3d8-fdc5-4c65-8fc9-c84dbaf6dd61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline powershell

2017-07-12 Thread jerome
I have add the support info inside the following bug
https://issues.jenkins-ci.org/browse/JENKINS-42988

As far as the mini repro project, I cannot reproduce it with a strip down 
pipeline file that does the same bat command on the same repos checkout. So 
it look like (not sure yet, only 5 build done so far) a particular context, 
project settings or something outside the bat command make a difference.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/75b43ad7-6df1-445b-90a0-587593905310%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is pipeline timeout suppose to work?

2017-07-11 Thread jerome
This is Declarative pipeline syntax (which I don't use), for non 
Declarative pipeline (which is what I have), I wonder if this work the same 
or where it can be used?

On Tuesday, July 11, 2017 at 5:31:08 AM UTC-4, Jakub Pawlinski wrote:
>
> I use this on pipeline level and it works fine there, haven't tried on 
> stage level tho.
>
> pipeline {
> options {
> timeout(time: 12, unit: 'HOURS')
> timestamps()
> }
> ...
> }
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8e3e104b-9cf2-49b0-bdc2-572865691d8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline powershell

2017-07-11 Thread jerome
Hi James, 
I will try to install the plugin and provide more information (I was giving 
the dump and the system info, but I may generate even more with this it 
seem).

As for JENKINS-34150 <https://issues.jenkins-ci.org/browse/JENKINS-34150> goes 
it definitely did not fix everything, since many bug were open since then 
with up to date configuration. So you can assume there still is something 
wrong there without a doubt.

As for giving a working example, I wonder how I can manage to do this 
properly. I need a master and a slave to do so, I cannot provide the whole 
System image (there is confidential data and configuration won't work else 
where with network drive).

I can provide most of the build script, but I cannot give access to the 
real .sln and .vxcproj files and sources. If you have an idea how I could 
do the reproduction master/slave setup and all data for reproduction that 
could be used. This doesn't show up when master/salve was a single Windows 
node, this only show up with my Linux master inside a Hyper-V and Windows 
slave Desktop normally installed. I haven't test any other master/node 
configuration so far. If you have any wish list or way I could give you 
back the proper usable information to reproduce this that you could use let 
me know.

I wonder if you could provide a jenkins.war with more debug trace I could 
try to reproduce the bug on my side (probably not, but worth a try to ask 
for it)?

Else I will try the following:

   1. Make a dummy project
   2. make a strip down jenkinsfile script
   3. try to run it until it hang
   4. make a dummy msbuild .sln, .vcxproj compilation
   5. drop the information with the plugin above
   6. Submit all this.

The #2 and especially #4 can be a headache to make something that look like 
the real deal and can reproduce the problems since it seem to occur when 
the bat command is really long. But if this can reproduce it, I will post 
it for both bat and powershell.

Will give some feedback as soon as I can.
Jerome

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/450c0b7e-bf50-4573-b3e0-c191d5a2a864%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is pipeline timeout suppose to work?

2017-07-10 Thread jerome
When trying the 45 minutes units into the syntax helper (pipeline-syntax/ 
of the project) it display the following code:
timeout(45) {
// some block
}

If I change the unit the syntax change like follow:
timeout(time: 45, unit: 'SECONDS') {
// some block
}

So I will try with the following too see if it change something:
timeout(time: 45, unit: 'MINUTES') {
// some block
}

The document seem to specify the timeout goes into the options block when 
using declarative pipeline (which I don't), but for normal pipeline I guess 
the* //some block* above is for any code block or is a block a specific 
type (stage, node...) ? This is unclear.
If this is any code block, it doesn't seem to work with either bat or steps 
warning publisher, which I cannot interrupt by cancelling the build into 
the GUI, so I guess the timeout may not cancel them either.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/1ff554c4-b80e-4224-85cd-10f5da6e1d16%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Is pipeline timeout suppose to work?

2017-07-07 Thread jerome



HI,
is the timeout can be used to prevent the warnings publisher and bat hang 
even possible?

stage('Build')
{
timeout(60)
{
bat returnStatus: false, script: "\"${bcad.msbuild_current}\" 
${bcad.msbuild_solution_name} ${bcad.msbuild_default_arg} /t:Build"
step([$class: 'WarningsPublisher', canRunOnFailed: true, consoleParsers: 
[[parserName: 'MSBuild']]])
}
}


and it have hang for over 3 hours now :-(
I was hoping to at least be able to stop those nasty hanging build and make 
them failed but doesn't seem to work. maybe I'm using timeout wrongly or 
the default units is not min like the doc and example said???





-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8e24ad7b-cb94-4505-8819-e1592c4f2b49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline powershell

2017-07-04 Thread jerome
I'm not alone into this situation and this have been a problems for many 
times for some:
   
   - https://issues.jenkins-ci.org/browse/JENKINS-28759
   - https://issues.jenkins-ci.org/browse/JENKINS-33164
   - https://issues.jenkins-ci.org/browse/JENKINS-42988
   
And I probably miss some other, but some are open since 2015 and still are 
unresolved. I was told this won't be fix and I should look forward to 
powershell api instead that should not have this :-(

I try to offer to test it, even gave an article that IMO seem to point to a 
probable problems with the way the process is spawn and check, but seem 
like I was lost and it was irrelevant. 
http://www.javaworld.com/article/2071275/core-java/when-runtime-exec---won-t.html

Looking at the source, this seem like the pitfall of Java process reading 
was not avoid, might be at a lower level into CommandInterpreter but since 
I'm no Java expert (more a C/C++/Python/Bash dev):
https://github.com/jenkinsci/jenkins/blob/d111e2ac1658c8fa5fb768e7d1233613b4b9992d/core/src/main/java/hudson/tasks/BatchFile.java

We have a broken CI for months now (ever since the master is no more a 
single Windows machine master/slave, now we have a Linux Master and a 
Windows slave, this behavior is appearing nearly every day, have to restart 
the Jenkins service, cannot even cancel it via the web GUI). I now need the 
multiple slave and my master on Linux and it ain't working with msbuild 
batch nor powershell.

I don't really have time to do this migration, but at some point my team 
and I need my CI to be reliable, not something that hang every day where I 
need an admin to log on the machine and restart Jenkins service since we 
have a master and a slave hang. Really wish this would be resolved by now, 
but I'm no longer holding my breath and it's a show stopper for us.

Thanks,
regards,
Jerome

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3e4ab9ce-fa78-4680-8843-d242217863e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline powershell

2017-06-30 Thread jerome
unless I'm mistaken or I missed the feature, MsBuild plugin is not pipeline 
compatible (
https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md 
seem to agree on that, not sure if this up to date). If I'm wrong I will 
totally up to use it. I was using batch because the plugin was not 
compatible, now I use powershell because the batch often hang when the 
MsBuild command terminate.

so yeah this is a workaround the other workaround to just make this simple 
use case work :-(

On Friday, June 30, 2017 at 3:38:07 PM UTC-4, slide wrote:
>
> Why not use the msbuild plugin to launch msbuild? 
> https://wiki.jenkins.io/display/JENKINS/MSBuild+Plugin?focusedCommentId=67568742
>
> On Fri, Jun 30, 2017 at 12:35 PM  wrote:
>
>> So far I can execute the following into a powershell:
>> $msbuild = "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"
>> $options = "BodyCad.sln /m 
>> /p:Configuration=Release;Platform=x64;SolutionDir=`" + $PSScriptRoot + `"\ 
>> /t:Clean;Build"
>> Invoke-Expression "& '$msbuild' $options"
>>
>> But I cannot make this happen when running into piepline powershell so far
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkinsci-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/f1427e69-e1fa-47c6-92c8-dd616b7d38c7%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/45182aaf-8128-4bcc-8c3b-3a435240d6c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline powershell

2017-06-30 Thread jerome
def psScript = """
\$msbuild = "${bcad.msbuild_current}"
\$options = "${bcad.msbuild_solution_name} ${bcad.msbuild_default_arg.
replace('"', '`"').replace('%CD%', '$PSScriptRoot')} /t:Build"
Invoke-Expression "& '\$msbuild' \$options"
""";
powershell returnStatus: false, script: psScript

is doing the trick, have to replace the " and the %CD% which was a batch 
path replacement. Now it seem to work. Will make it compile a lot over the 
weekend to see if this hang as much as batch was.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/1ef730ea-6014-453e-bd5b-7d82683a9091%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline powershell

2017-06-30 Thread jerome
So far I can execute the following into a powershell:
$msbuild = "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"
$options = "BodyCad.sln /m 
/p:Configuration=Release;Platform=x64;SolutionDir=`" + $PSScriptRoot + `"\ 
/t:Clean;Build"
Invoke-Expression "& '$msbuild' $options"

But I cannot make this happen when running into piepline powershell so far

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f1427e69-e1fa-47c6-92c8-dd616b7d38c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Pipeline powershell

2017-06-30 Thread jerome
Hi,
I just realized that the powershell is not part of pipeline script. I'm no 
powershell guru. So I wonder how one can use it properly to launch 
something like msbuild (I known I can launch it with the bat but this often 
hang like many jenkins issues have already show the problems). So I hope to 
have something finally working with it, so we can put the Jenkins Ci into a 
real life CI usage. So my questions are the following:


   1. Is it better to execute a pregen scripts myScriptFile.ps1 ?
   2. How can one invoke the following batch into powershell properly:
   bat returnStatus: false, script: "\"${bcad.msbuild_current}\" 
   ${bcad.msbuild_solution_name} ${bcad.msbuild_default_arg} /t:Build"
   
   
Do I have to 
Invoke-Expression

or do I have to force escape with 
--%

Thanks
Jerome

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/965e7e32-550c-4eaa-8ab9-5dfaad602346%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Adding .groovy files to secured script classpath

2017-06-30 Thread jerome
"In the name of security you shall not pass!"

Run you stuff into a sh/bat/powershell with python/perl/bash script and get 
over the false security wall.

Ok, I'm out of here!

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/1e296ce7-7654-448d-a43e-e7e455e8dbf1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Runing Groovy scripts on Jenkins on Master

2017-06-21 Thread jerome
if you are into a pipeline, you can swap node by using
node("master")
{
...
}


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/df913a9a-b259-42a8-9032-26cb6457d520%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [EXTERNAL] - Re: how to reset build number

2017-06-09 Thread jerome
Just an idea, but if I understand you well, you may want to split the 
concept of Jenkins build number and the build number for you application. 
Maybe an SQLite db (or any other database type) where you could read/write 
with your main version, and make an incremental entry for the version build 
number and the related jenkins build number. This way you could keep a 
track of the matching version without altering the Jenkins behaviors and 
avoiding Jenkins build number clash.

Using either sh/bat and sqlite command line this should be easy to do. You 
can also put a cgi or wsgi  web page that could display/search into the db 
if needed. Keep the db on the master and access it with the master node and 
this should work.

My new thumb rules with pipeline, if you can do it outside of pipeline 
script itself it's way easier and robust to do so.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3275a328-0e19-4cfe-a8a8-1cac98710a52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Monitoring resource use of executable started by Jenkins batch job

2017-06-08 Thread jerome
You may want to take a look at Job Object and cook this limitation right 
inside the application you run into the batch script

https://msdn.microsoft.com/en-us/library/windows/desktop/ms684161(v=vs.85).aspx

example C++
#include 
#define BYTES_PER_GIGABYTE ((size_t)1073741824);
...
JOBOBJECT_EXTENDED_LIMIT_INFORMATION info;
info.ProcessMemoryLimit = mem_limit_gb * BYTES_PER_GIGABYTE;
...


This way you application will end right away if it reach that limits. It's 
always a good idea to make this code for any platform not just Windows

For Linux you can go ulimit way:

http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/40


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/0b8c1175-5d70-41c1-934c-7d73cb01fc3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Are jelly templates supported in email-ext with pipeline

2017-05-23 Thread jerome
Into pipeline they are working to certain extent, but you have to take 
special care when declaring the usage of the body (it does not support 
windows \ into the path, convert to unix path type):

emailext body: '${JELLY_SCRIPT,template="/path/to/templatefile.template"}', 
subject: 'subject', to: 'myt...@test.com', replyTo: 'jenk...@test.com', 
mimeType: 'text/html';

I for one also made a replacement function to replace the variables into 
the template file and write it again with the replacement.

   1. read the template with special string to be replaced
   2. replace some variables into the string
   3. write the template into the tempo folder of the master (since a few 
   release it no more check on the slave with absolute path).
   4. Send the tempo filled copy.

It's the best way I found to do this with a few function I load every 
project. I give it a dictionary to replace all values into the template. I 
also have something that convert windows path to Unix path style and 
generate the whole body entry with a simple path. So I don't bother with 
what is available or not into the Jelly context/parsing anymore. It give me 
more freedom and I known what to expect every time, I also have some style 
replacement based on the project (devel, official, etc) that I can now 
inject based on the project/branch/result...

Another fun part, is to combine multiple template part together based on 
the build results ;-)

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ce69e630-9ee6-46bc-8df4-78225e4f5d54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Issue/question with Pipeline and SCM

2017-05-09 Thread jerome
How is your slave labels configured?

If nothing match is found, I think the code run on the master. Also make 
sure the master node doesn't have the labels Axis. You also may want to 
change the usage of each node (node configuration). May want to mark your 
master to be used only when matching and your slave to be used as much as 
possible.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ad11ff1b-5b38-4712-ace1-94c0055a2bf4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Windows Service for Jenkins doesn't start automatically

2017-05-01 Thread jerome
On my side, the service needed to be Local System to be able to launch 
properly, which prevent GUI and graphical context to be run inside the 
service. Since I needed the GUI context for some unit test (OpenGL unit 
test was problematic), I had to change the service user for a local user. 
That prevented the jenkins service from booting at startup. 

Sorry I didn't investigate why, since we moved the master from Windows to 
Linux to avoid those problems. Starting the slave with a simple batch 
script that connect to the master solved the problems:

LaunchSlave.bat
"c:\Program Files\Java\jdk1.8.0_121\bin\javaws.exe" 
"http://MyHost/Jenkins/computer/Windows%%2010%%20Node/slave-agent.jnlp;

Put it into the Start Menu Startup folder for a local user and you are 
done. You can make the Windows slave machine auto login into that user.

I may suggest to put your master into a VM with Linux, that really solve 
those problems if you need GUI context, if you don't need it, make sure you 
use the default Local System as Jenkins service user, it should work.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/1e7337f4-93bd-4d96-a27e-001cfe3ae30c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: email-ext no mor resolve template absolute path

2017-04-27 Thread jerome
this security non sense is getting annoying, anyway I can workaround by 
writing the file on the master anyway. But since you can run almost 
anything into a python/perl/bash/batch... scripts, the security should be 
at the scripts trust not what it's content in the end, if you trust the 
source and ensure the script is a trusted user/server, no need to go at 
every details of the scripts operation. We should have a way to sign and 
trust Jenkinsfile script and be done with the security. Try to secure each 
and every call inside the script language when you can call sh or bat is a 
false security.

I don't known how to do it exactly right off the bat, but my guess it's 
make more sense. Preventing me from doing a file operation for security 
purpose into Groovy, but I can call sh todo it anyway doesn't give much 
except frustration. I totally fail to see why something like:

   - new java.util.Date
   - method java.util.Map containsKey java.lang.Object
   - staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods 
   leftShift java.util.Map java.util.Map
   - staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods minus 
   java.lang.String java.lang.Object
   - staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods plus 
   java.util.List java.lang.Iterable
   - 
   - staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods plus 
   java.util.List java.util.Collection
   - staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods plus 
   java.util.Map java.util.Map
   - staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods println 
   groovy.lang.Closure java.lang.Object

are security risk?!? seriously, I call bullshit. Just do yourself a favor 
and call whatever you want to do into sh or python and do it anyway. And 
even if it would want to check if the process do something illegal, we 
still could launch other process/pipe from those command and nothing could 
be really done or known. As long as the Jenkins user have limited privilege 
on the machine and you trust the Jenkinsfile (some kind of certificate 
maybe).

This false security is grabbing way too much ground over the 
features/usability ground and that's sad, the concept is good but start to 
feel like it's going down the rabbit hole.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c7742dbf-0e22-486d-b2ae-2eb7d40af307%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Windows Slave / LinuxMaster hang

2017-04-27 Thread jerome
I open a tickets: 
https://issues.jenkins-ci.org/browse/JENKINS-42988

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/478621ea-f5c4-4ab4-8f3b-ee067cc7870f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: email-ext no mor resolve template absolute path

2017-04-27 Thread jerome
I opened a ticket about it:
https://issues.jenkins-ci.org/browse/JENKINS-43903

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5942c8d2-177b-4441-9c7f-86a6fe4a9d42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use email-ext plugin in pipeline script?

2017-04-25 Thread jerome
Upon David request here's our Jenkinsfile example, it's not all files 
should be enough to give a good idea of my current setup.

Note (the email-ext email content stop working between 2.51 and 2.54 
Jenkins update, since the absolute path can not be found anymore, I may 
have to transfer the file back to the master node or something similar).


   - The concept is to have Jenkinsfile alone into it's own mercurial repos.
   - Then as sub repos (JenkinsBuildHelperScripts) I have many 
   template/helper scripts.
   - The LocalSettings.groovy only exist on each node if some 
   installation/properties are special on a particular node.

This is the basic idea, the build system is configured to take 2 parameter:

   - PIPELINE_REPOS
   - PIPELINE_BRANCH_NAME
   
the default value are set for mostly used script but can be change for 
testing or if a dev want to check it's own branch or want to compile with 
another compiler (VS2013, VS2015, VS2017 config branch exist for example)


   1. The master checkout the Jenkinsfile repos (along with it's sub repos 
   since this is a Mercurial behavior). 
   2. Kick in the appropriate node
   3. *stage('Init Node')* The node checkout Jenkinsfile sub repos again 
   into it's tmp (avoid double checkout into workspace) to get access to build 
   helper scripts (could have been transfer from master to node but checkout 
   is simpler to make sure I got everything). It also make sure the proper env 
   settings are used and it sellect the proper MSBuild/Qt version installed on 
   the node.
   4. *stage('Checkout') *The actual code checkout
   5. *stage('Clean')* clean up previous build
   6. *stage('Build')* launch msbuild compilation for the whole solution
   7. *stage('Build Unit Tests')* compile the unit tests (google C++ tests)
   8. *stage('Run Unit Tests') * I have a python script that help run every 
   .exe of unit test with ADmonitoring, then I collect the core dump and tests 
   results. I also rerun failed tests into html mode, where I can collect the 
   awaited/results comparaison of our tests function and I publish them so 
   user can see what is wrong (we do a lot of 3D, so WebGL with simple 
   geometry can be render with our tests output).
   9. *stage('Benchmark') *some of our tests output benchmarks, I also have 
   a script that convert the output and log the data between build so I can 
   monitor the algo performance between build.
   10. *stage('Qml Syntax Checker') * the Qml syntax checker, run qmlint on 
   each files (output is console parsed later since we can only do it once).
   11. *stage('Qml Inspection')* same inspect valid Qml structure, qmldir 
   entry
   12. *stage('VcxProj Inspection')* make sure a dev didn't forget some 
   Optimization into the code and other in house settings. This is the last 
   place where we concat the .txt for the rules and do a single console 
   parsing.
   13. *stage('Doxygen Generation')* we then generate the doxygen
   14. Send the email with templates based on the build results. This is 
   broken into 2.54 (was working into 2.51): Jelly file 
   
[c:/Jenkins/workspace/CAD_CPP/CAD_CPP_ContinuousBuild@tmp/email_template_file.jelly]
 
   was not found in $JENKINS_HOME/email-templates.

This is not perfect at all, but it give a good idea of what is possible for 
us. I haven't play with the declarative pipeline yet. 

What I wish I had:

   1. I would like to have stage that run no matter what (even if previous 
   stage failed)
   2. Easy to express which stage are linear and which can be done into 
   parallel (on same node)
   3. Multiple Console parsing per stage output (super slow since it have 
   to parse the whole output which is totally unnecessary.
   4. email-ext that can take the absolute path template on node again!
   5. Programming language that is 100% compatible with Groovy language so 
   we can test outside Jenkins our scripts. My best fallback is to develop 
   Python and use groovy only to launch those script which remove a lot of 
   pain  (predictable, testable, stand alone development...).




-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/11abcfed-5e2f-422e-b539-0c87007ec33a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkinsfile
Description: Binary data
error /^SCRIPT NOT FOUND: (?!external)/
info /^SCRIPT NOT FOUND: external/

warning /^Script file not listed into qmldir: (?!external)/
info /^Script file not listed into qmldir: external/

error /^Module not found: (?!(QtQuick|QtQml|BuildSystemTools))/
info /^Module not found: (QtQuick|QtQml|BuildSystemTools)/
error /^FI\s+ERROR/
warning /^FI\s+WARNING/
info /^FI\s+INFO/

PipelineXUnitTests.template
Description: Binary data

Re: How to use email-ext plugin in pipeline script?

2017-04-24 Thread jerome
It's not so hard, it's just some behavior/limitations that are a bit hard 
to grasp (groovy loop anyone). I think they went on a road to provide some 
features at high trade back cost.

If you want some examples more like real life usage:
https://github.com/jenkinsci/pipeline-examples

I would love to have better or complex examples, that would save a lots of 
questions on this lists and people wouldn't get so frustrated trying to 
achieve simple stuff.

Some people must have made a few .groovy that could be used by many, that 
would be great if that could be shared between user, like plugins one day. 
I made a few python scripts to help me back into the Jenkins non pipeline 
era, I still use them, but passing them to Groovy would be a pain, since 
even if I made a normal groovy script, I would still have to validate the 
Jenkins 'groovy' alike language can output the same thing and probably have 
to allow a few dozen of functions into scripts approval.

So far, I use simple Jenkins file that launch a lot of console cmd (Python 
code, msbuild command, batch/bash script, custom C# program) that I can 
test into console. Work fine, except the Windows slave hang and the new 
email-ext that doesn't resolve the absolute path on node.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/de3f954b-71d6-43d0-8c25-adc475557136%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use email-ext plugin in pipeline script?

2017-04-24 Thread jerome
You can check the currentBuild status just before sending the email:

currentBuild.result

If empty it mean nothing have set it to warning or error yet. you can set 
it to success
if(!currentBuild.result)
{
  currentBuild.result = 'SUCCESS'
}

or you could set it directly into the email without touching the 
currentBuild.result variable or use another variables into a custom 
template.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/dd403b4e-dd28-484b-9c7e-3f8342e6faa6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


email-ext no mor resolve template absolute path

2017-04-24 Thread jerome
Hi,
is there a change into email-ext lately (I was into Jenkins 2.51 and 
email-ext 2.56, now updated to Jenkins 2.54 with 2.57.2)  that could 
prevent email-ext to fetch template into the node with an absolute path? My 
outgoing email used to work now I receive this into my email body:

Jelly file [c:/Jenkins/workspace/CAD_CPP/CAD_CPP_ContinuousBuild@tmp/
email_template_file.jelly] was not found in $JENKINS_HOME/email-templates.

The file was present on the node is there a way to fix this or an approval 
switch to enable?

I'm guessing this got broke into the 2.57 or 2.57.2 release:
https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin

P.S.: Sometime I wish there was a non secure global switch and we could 
accept the server run into a secure local network and don't have to mess 
around with all the security non sense and modification that always broke 
the build machine at every Jenkins update. I still have the slave hang 
during the whole building phase, there's still many bugs report for this 
(over 2 years, and this important bug don't get fix, then we see 'security' 
features that remove working use case all the time). Maintaining Jenkins is 
more time consuming then maintaining our code base. Maybe I should stop 
update it, but I still hope the Windows slave hanging will be fix one day, 
if that day come around and I get it to work, I might highly tempted to 
stop updating.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6f602780-ff11-4110-8329-56faf95895c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: cannot run a python script from Jenkins

2017-04-18 Thread jerome
Not sure but it look like the scripts use IO redirection, which could not 
be standard output/error inside the Jenkins flow execution. Check if you 
can spawn a bash shell that run this python script on it's own and exit 
after. You may want to find a way to check the results into your bash 
command.  Maybe this will help the script to properly redirect the IO. 
Again I'm not sure about his but it would be my first guess for this.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a0e63d33-99f7-46b6-baf8-eb4a9f8c5742%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Declarative pipelines per branch and reusable stages (keeping it DRY)

2017-04-11 Thread jerome
Up vote for the forward declaration of stage/steps and just give the 
assembly later on (would just invert the 3rd example, delcare 
implementation first then use them).

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/92dcd6af-0b10-4e59-82f8-776c0a6d4cba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread jerome
This seem like a declarative way bug too me. I do this into full scripts 
(changing the current build result) and it work fine.
I haven't tested the declarative (post {}, always {}, ...), but you could 
try a Jenkinsfile without the declarative syntax:

node()
{
try
{
  // make you junit test that make unstable here
}catch()
{
if (currentBuild.result == 'UNSTABLE')
currentBuild.result = 'SUCCESS'
}
}

This should work, if so, it mean that the declarative syntax have a bug in 
it and the currentBuild.result is somehow a copy used into the post scope 
and restore after the processing of the declarative post {}. You should 
open a bug report if so.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c18bc05d-ba2e-44e5-8a0f-ffd2dd42e306%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread jerome
Take care the currentBuild.result will be unset if successful up to that 
point. There's no 'STABLE'

'SUCCESS'
'UNSTABLE'
'FAILURE'
'ABORTED'
'NOT_BUILT'

http://javadoc.jenkins-ci.org/hudson/model/Result.html

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/81762c79-b462-4839-b7b3-13eea7ef884c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Console output at stage level

2017-03-21 Thread jerome
+1
That would be awesome, this along console parsing per stage output would 
greatly improve speed on console output parsing.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a3f2ca79-2f80-4ff1-bc55-a6c45aaf7221%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Zip and archive folder/sub folders

2017-03-21 Thread jerome
zip zipFile: "x64\\Release\\${APPLY_TAG}.zip", dir: 
"x64\\Release\\${APPLY_TAG}";
archiveArtifacts artifacts: "x64\\Release\\${APPLY_TAG}.zip", fingerprint: 
false, allowEmptyArchive: false, onlyIfSuccessful: true;

This work for me, make sure your path are adapted to the platform (Unix vs 
Windows). Not sure about the wildcard, may want to try without and a simple 
file to see which part is messing around. I have tryt the archiving of zip 
command yet. I do the archiving manually after.


On Tuesday, March 14, 2017 at 2:36:20 AM UTC-4, Baswaraj Malage wrote:
>
> Thanks Jerome for all your suggestion. But, no luck to get files in zip. I 
> did use zip directly (I had to separate commands with ,) but did not work 
> for me. I might be missing something or jenkins yet to support this feature.
>
> zip zipFile: 'screen.zip', archive: true, dir: 'screenprint', glob: 
> '**/*.png'
>
>
> -Baswaraj
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6d552215-fefc-4002-8686-3d315cff8f30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


slave bat command doesn't continue jenkinsfile upon completion

2017-03-09 Thread jerome
Hi,

I'm having many trouble with bat method into my Jenkinsfile, the command 
complete but the execution flow stop, both master (CentOS) and slave 
(Windows 10) thread are waiting for each other.

The following open bug seem related into the behavior.

   1. https://issues.jenkins-ci.org/browse/JENKINS-28759
   2. https://issues.jenkins-ci.org/browse/JENKINS-33164


Anybody have workaround (i'm not even using multi branch setup). The 
command have finish and all the output is logged, but it's like the master 
doesn't known it have to continue the Jenkinsfile instruction flow.

There's no way to cancel the task, the slave node hook and I have to 
restart the master node. This is particularly annoying and we cannot have 
any CI right now (happen 2 times out of 3!). Into single Master node, we 
never had this problems.

It seem to always happen with very long command on slave:

bat returnStatus: false, script: "msbuild.exe mySolution.sln ..."

The command complete successfully and we see the end of the compilation.

*18:00:58* 
*18:00:58* Build succeeded.
*18:00:58* 0 Warning(s)
*18:00:58* 0 Error(s)
*18:00:58* 
*18:00:58* Time Elapsed 00:15:41.55


So I have to restart the master node (there's nothing into the console 
output inbetween):

Waiting to resume part of Bodycad cpp projects » CAD_CPP_ContinuousBuild #113: 
Windows 10 Node <http://bcadlx03/Jenkins/computer/Windows%2010%20Node/> is 
offline
Waiting to resume part of Bodycad cpp projects » CAD_CPP_ContinuousBuild #113: 
Windows 10 Node <http://bcadlx03/Jenkins/computer/Windows%2010%20Node/> is 
offline
Ready to run at Thu Mar 09 09:22:34 EST 2017


I'm wondering if the timestamps{ } maybe in cause or simply the bat 
instructions is failing at resuming the Jenkinsfile flow.

Any info or help would be welcome, I can't imagine I'm the only one who 
have this problems, since it's such a basic usage and setup?

Jerome

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/4c89d4ed-e4e4-4080-ae57-db02aeed31ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins2 pileline poll scm

2017-03-06 Thread jerome
You can set your pipeline project configure like the following:

Build Triggers
Poll SCM
Schedule H 22 * * *

This will consider the pipeline scripts checkout and the checkout done into 
the pipeline. The later need at least a single run manually started to 
register the code checkout with the first execution of the jenkinsfile. I 
haven't tested this with multi branch.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/fa2d7164-e029-4292-aef0-ee26e661be26%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Windows Slave / LinuxMaster hang

2017-03-01 Thread jerome
I wonder if this is related:

   1. https://issues.jenkins-ci.org/browse/JENKINS-28759
   2. https://issues.jenkins-ci.org/browse/JENKINS-33164

So I'm not the only one who have issue with the bat command hanging it 
seem. Wonder if it will ever get fixed?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/712fbb9c-992a-4a2d-a0a9-aa3a7a6d2c32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Windows Slave / LinuxMaster hang

2017-02-27 Thread jerome
Hi,

I still got some trouble with my Linux master and Windows slave that often 
hang.

I don't have anything into the jenkins.log to help
Feb 25, 2017 3:05:41 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Started Workspace clean-up
Feb 25, 2017 3:05:41 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Finished Workspace clean-up. 29 ms
Feb 25, 2017 6:03:12 AM hudson.triggers.SCMTrigger$Runner run
INFO: SCM changes detected in Bodycad cpp projects » 
CAD_CPP_ContinuousBuild. Triggering  #105
Feb 25, 2017 11:31:25 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Started Download metadata
Feb 25, 2017 11:31:30 AM hudson.model.UpdateSite updateData
INFO: Obtained the latest update center data file for UpdateSource default


The dmesg -T on the server doesn't help much either but I got the following 
error after forcing restart Jenkins:
[Mon Feb 27 11:43:37 2017] CIFS VFS: Send error in Close = -512
Yes the server build info are locate on a CIFS share. I had some CFIS error 
before, I increased the VM memory and tweak the vm_dirty* parameters to get 
ride of those.

This often occur right after a bat command on the slave
bat returnStatus: false, script: "\"${bcad.msbuild_current}\" 
${bcad.msbuild_solution_name} ${bcad.msbuild_default_arg} /t:Build"

The command seem to have successfully completed into the output log but 
then nothing happen and I cannot kill the build, the Web GUI is accessible 
but nothing can be done to un jam them, I have to restart Jenkins, which 
try to recover the build and fail since it a sequential sequence at at that 
point.

This doesn't show up when starting the build manually. Any way to debug 
this? It's really interfering with our build system and lock Porject and 
Slave.

Jerome

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/450edafc-2a19-4bdd-a2d0-cc5ac27a27ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Workspace root directory (Jenkinsfile)

2017-02-21 Thread jerome
What I have found so far:

Inside the Jenkins management you can change the Workspace directory. 


   1. http://MY_HOST/Jenkins/configure
   2. Right under the home directory into advanced button.
   3. Workspace Root Directory   ${JENKINS_HOME}/workspace/${ITEM_FULLNAME}

you could change it for something short indeed like  D:/work
I had the same problems with the zip archiving under Windows. The 256 char 
path limits is a pain. Keep your job project short, use description for 
more info. Try to avoid too many job folder under Windows since it does 
create 2 folder deep /job/name every time.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/fef85f6b-90a8-4215-86c2-73e6028518cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting the description of a failed test in pipeline groovy

2017-02-21 Thread jerome
Add description on the side:

manager.addShortText("${APPLY_TAG}")

You can find a lot of property inside you syntax help page (change MY_HOST, 
MY_PIPELINE_JOB):

http://MY_HOST/Jenkins/job/MY_PIPELINE_JOB/pipeline-syntax/globals

this should with the properties of env/manager/currentBuild. the 
hudson/build object is inside the manager for example. As what is available 
on them after, you need to check the javadoc and try to make sense of it.

Hope this help,
Jerome

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c548cc44-ebee-4de0-b201-0a6dc8c78b48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline documentation jenkins-book vs realty?

2017-02-13 Thread jerome
https://jenkins.io/doc/pipeline/examples/

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f2aa061f-7115-440a-bf05-e788d554c57b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Issue with pipeline

2017-02-09 Thread jerome
the {workspace}@script is done during the initial fetch for the 
Jenkinsfile. Normally the pipeline checkout config. This first checkout is 
not transfer to the real workspace when you start the script


   1. the jenkinsfile checkout inside {workspace}@script. I strongly 
   suggest you get a small repos without the source code, else you will be 
   checkouting twice the source.
   2. read the jenkins file pipeline script inside {workspace}@script
   3. change the directory to {workspace}
   4. start executing the jenkinsfile inside {workspace}
   5. you pipeline script should scm checkout the real source code repos to 
   compile or do any other tasks

I for one would like to have an env variables to get that @script folder, 
since @script2+ is possible. I used some script helper to run the pipeline 
script which are found into the Jenkinsfile repos only. Right now I do 3 
checkout to ensure proper execution (I avoid refereing to 
{workspace}@script at all). 1 for the initial jenkinsfile into the @script, 
2 the jenkinsfile repos again for script helper into workspace which I can 
access and 3 the source code itself into workspace.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/22f3d61e-5b00-4d48-898f-71028be0a9c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Slave hang

2017-02-06 Thread jerome
I called victory way too fast, still can happen, just not as often. The 
fact that the slave can flood the master is a bit annoying, it should wait 
and continue later. Right now the behavior is if this happen, the 
slave/master hang (web gui is still accessible, but impossible to cancel 
the jobs) and I need to restart the Jenkins daemon everyday :-(

Maybe it's impossible to have the jobs folder under a network mount where 
the network can sometime be under heavy usage. This was solving the split 
between the master config and the jobs config/results for backup purpose. 
The master config change at slow pace and we manually backup the whole 
machine when doing update keeping the 2 last in case of problems to quickly 
revert. Jobs on the other hand need to be backup every day in incremental 
way.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/45d23afd-7861-452b-b5ec-dca615d09430%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Slave hang

2017-02-03 Thread jerome
Finally find the problem. Seem like my mount drive under Linux was under 
heavy usage (the polling was occurring at the same time the IT was doing 
big backup) and therefor the Master Disk IO could not follow to write the 
jobs and the RAM vm.dirty_ was flooded. Making the build to hang.

So I changed the polling cron to avoid the conflict, but still a little 
weird that it doesn't suspend the slave until it can recover. So if the 
salve can flood the master disk IO the build hang and never recover.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3d16e7e7-3dee-4e6c-b71a-e1ef55df31fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Email complete build report when build fails

2017-02-01 Thread jerome
You can set a variable global and set it during various step/stage. Then 
when you throw you could known what was the last thing done and append it 
to the email info with the error info too

def my_last_seen_step = "start"
try
{
stage('Checkout') 
  {
  my_last_seen_step = 'checkout begin'
   ...
my_last_seen_step = 'checkout end'
 }
  stage('Build') 
 {
  my_last_seen_step = 'build begin'
  ...
my_last_seen_step = 'build end'
}
}
catch(any)
{
  notifyFailed(my_last_seen_step, any);
}

This is not the best approche, just an easy one, a scope object would be 
better suited for this like the stage() {}. WOuld be nice to have the last 
seen stage or the seen stages list somehow.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/723d1b08-92e4-46d2-80c0-1d2b331a6d06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Slave hang

2017-01-31 Thread jerome
More info, it seem like if I use the Windows slave computer and the poll 
occur, it work just fine. So when the user is lock (sleep is disabled, only 
the screen is allowed to go to sleep on this computer and maximum 
performance profile is used) and a poll on the master request the slave to 
do some work, it seem like it can checkout, build and then hang either at 
the end of the build which is completed.

Windows Batch Script - (13 hr in self) 


So the batch command is done and the command have returned, but nothing 
happen after



*msbuild compilation here..00:14:37.575* 
*00:14:37.576* Build succeeded.
*00:14:37.577* 0 Warning(s)
*00:14:37.578* 0 Error(s)
*00:14:37.579* 
*00:14:37.579* Time Elapsed 00:14:09.54


I'm guessing it has something to do with the desktop access and the user 
being lock into Windows 10. If anybody have an idea why a batch script hang 
under those conditions when returning, I'm a bit lost here.

bat returnStatus: false, script: "\"${bcad.msbuild_current}\" 
${bcad.msbuild_solution_name} ${bcad.msbuild_default_arg} /t:Build"

I use the *returnStatus: False* if that may give any idea (so the build 
doesn't get fail and the pipeline stop by a warning).

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/58ee5b93-bf81-431e-9281-3e6d60e1e87e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline - stage, node

2017-01-26 Thread jerome
I'm not sure they actually do this much, but you could totally put a stage 
around your parallel. If we take a look at the diagram on
https://jenkins.io/doc/book/pipeline/

stage{
  parallel(['toto': node(){ ... }])  
}

seem like a valid way.

I for one have a node that contain multiple stage and it doesn't disturb it.

node
{
  stage('build')
  {
...
  }
  stage('unit testing')
  {
...
  }
}


I think you cannot declare a stage inside a parallel, it would mess up the 
stages. It's my understanding of them so far, they kind of just indicate a 
split between flow group.  Maybe the dev people from Jenkins or more 
advanced users can shed more light on this.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f70f37a2-7a75-45d5-866a-cd20c5cf382f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline - stage, node

2017-01-26 Thread jerome
I may not have all answer here, but here a start.

stage serve no purpose except giving visual queue and split console data 
into the view as far as I know. It also split the time used to complete.

For the node, they are sequential unless you use the parallel instruction. 
So you probably need to build on a possible node first then parallel the 
unit test execution:

node('buildrequirement')
{
   // build instruction here
}
parallel
(
 platform1: 
 {
 node('platform1requirements')
 {
 // run unit test on platform 1
 }
 },
 platform2: 
 {
 node('platform2requirements')
 {
 // run unit test on platform 2
 }
 }
)

For better parallel example:
https://github.com/jenkinsci/pipeline-examples/blob/master/pipeline-examples/jobs-in-parallel/jobs_in_parallel.groovy

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/1fe75160-da21-4e17-b2ec-50b33bc875c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Slave hang

2017-01-26 Thread jerome
It hang again today, seem like the MSBuild Warning plugin is the pipeline 
step that hang under Windows 10 if the user is in lock (not log off) state. 
When user that run the slave client is active on the machine it work fine.

step([$class: 'WarningsPublisher', canRunOnFailed: true, consoleParsers: [[
parserName: 'MSBuild']]])

This is a problems if on top of having the user log in I need the session 
to remain unlock.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/4e3a0e2f-ab4c-460b-aa5c-8a6f5095d09c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: LogParserPublisher rules on slave

2017-01-26 Thread jerome
Yeah, seem about right, this what I end up doing:

def all_rules_file = 'rules.txt'
dir(pwd([tmp: true]))
{
writeFile([file: all_rules_file, text: all_rules_str]);
stash includes: all_rules_file, name: 'LogParsingRules'
}
node('master')
{
unstash 'LogParsingRules'
step([$class: 'LogParserPublisher', parsingRulesPath: 
"${env.WORKSPACE}/${all_rules_file}", useProjectRule: false, 
failBuildOnError: true, unstableOnWarning: true, showGraphs: true]);
}

So I create the temp file on the slave then stash it, move to the master, 
unstash iit then run the LogParserPublisher there. It would probably work 
if step() is executed on the slave through.


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/08da045f-e63b-4baa-b735-f0798941490c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


LogParserPublisher rules on slave

2017-01-24 Thread jerome
Hi,

I'm trying to use this pipeline command on my Windows slave node:

step([$class: 'LogParserPublisher', parsingRulesPath: all_rules_file, 
useProjectRule: false, failBuildOnError: true, unstableOnWarning: true, 
showGraphs: true]);

I get the following error:
ERROR: Failed to parse console log

java.io.FileNotFoundException: c:\Jenkins\workspace\MyProject@tmp\all_rules.txt 
(No such file or directory)

The file is created at runtime on the slave, it's there and filled properly 
and permission are correct. I was wondering, if I invoke the step 
LogParserPublisher command, does it get run on the master even if declared 
inside the slave node? do I have to stash/copy the rules files back to the 
master? then do a new node('master') at the end?

if so I will have to send the email after this, so my ig try catch will 
overlap 2 node, is that legal code? and the email will get send by the 
master instead I suppose

Right now I have

node('windows')
{
try
{
...
step([$class: 'LogParserPublisher', parsingRulesPath: all_rules_file, 
useProjectRule: false, failBuildOnError: true, unstableOnWarning: true, 
showGraphs: true]);
...
}
catch(any)
{
currentBuild.result = 'FAILURE'
throw any //rethrow exception to prevent the build from proceeding
}
finally
{
emailext ...
}
}

What I should do to have the LogParserPublisher done back on the master, 
but doesn't seem like ligit code:

try
{
node('windows')
{
...
stash includes: "all_rules.txt", name: 'MyRules'
...
}

node('master')
{
def tempo_dir = pwd([tmp: true])
dir(tempo_dir)
{
unstash name: 'MyRules'
step([$class: 'LogParserPublisher', parsingRulesPath: 
"${tempo_dir}/all_rules.txt", useProjectRule: false, failBuildOnError: 
true, unstableOnWarning: true, showGraphs: true]);
}
}
}
catch(any)
{
currentBuild.result = 'FAILURE'
throw any //rethrow exception to prevent the build from proceeding
}
finally
{
node('master')
{
// I need a node to perform command here but...
emailext ...
}
}


how does one get to send an email if anything failed from any node actions?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/4c33eb52-5a8d-4277-ada8-579008a4af25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins jobs on cifs mount drive

2017-01-24 Thread jerome
I'm currently having some issue with the jobs on a cifs mount for Jenkins. 
The l

ln -s builds/lastStableBuild /var/lib/jenkins/jobs/MyJob/lastStable failed: 13 
Permission denied

The user and group is both set to Jenkins and it can write there for the reste 
of the operation. My guess is that my network share doesn't support "unix 
extensions" into samba, which is not under my control. Anybody ever had this 
problems too?



-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a024eca5-06de-4803-95a1-25a2b5b3d97b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Pipeline checkout poll argument

2017-01-24 Thread jerome
Hi,
I just would have some light shed on the poll option when doing a pipeline 
checkout.

I currently have a repos for my jenkinsfile, which I don't want to poll for 
change (but I could poll it if necessary to activate the poll option).
My code reside into another repo, which I would like to poll for change and 
start a build with default parameters value.

I was wondering what are the exact effect of the poll option into the 
checkout pipeline method?

My guess:
- It add the repos to the polling if the polling on the jobs is activate 
(which will also poll the repos of my jenkinsfile).
- I need to start a first build manually so it get register

am I correct on all this or not?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/16727c0b-c1d8-48ca-945e-cf2f73bd9ffa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [pipeline][slave][publishHtml] reportFiles wildcard problems

2017-01-23 Thread jerome
I guess I misinterpreted the thing, the reportFiles are only the start page 
or something like that for the wrapper to use. So there's no way to collect 
only specified files, I have to copy them into their own folder then 
publish them.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8694001b-f700-466d-b503-46cfaa5ecd14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[pipeline][slave][publishHtml] reportFiles wildcard problems

2017-01-23 Thread jerome
Hi,
I was using a script to archive a single html file into my pipeline. Now I 
have a master and a slave (master is Linux, slave is Windows) and I try to 
archive the same single file but I run into troubles where the reportFiles 
is taken like a * no matter what:

publishHtml [allowMissing: false, alwaysLinkToLastBuild: true, keepAll: false, 
reportDir: "x64\\Release", reportFiles: "bench.html", reportName: 'Bench 
Results'];


I end up copying the whole directory content to the master like if the 
reportFiles 
was totally ignored or considered "*". It was working before (master on 
Windows that was the only node), now I'm a bit confuse, is that a path 
conversion problems between master and slave with the plugins? Should I 
stash the file on the slave and unstash it on the master, then publish the 
result?

Thanks,
Jerome

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/944be487-2ee3-478f-b3ed-caf6d5a3bc13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can i execute sql commands using jenkins

2017-01-23 Thread jerome
If I remember well, the command return value is the fail/pass. So you may 
want to craft your command to return non 0 and make the build fail when 
something did not goes as planed.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/614d0da8-4dcc-410f-81a4-4fd745998dff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can i execute sql commands using jenkins

2017-01-23 Thread jerome
Are you running inside a pipeline script or the "old" way?

pipeline: https://jenkins.io/doc/book/pipeline/
"old" way: https://goo.gl/images/uKcWFd

If this is a new project, you may want to try the new pipeline, it will 
make thing more flexible.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/fc667c43-6b02-4045-95fa-2b44aa9b95d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can i execute sql commands using jenkins

2017-01-23 Thread jerome
Hi,
you need to execute either a bat or sh command with the mysql binaray:

https://dev.mysql.com/doc/refman/5.7/en/mysql.html

You can either cat the command into a temporary file then pipe it to the 
command or have the scripts already prepared.

Jerome

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/74149b4a-6ae4-4cad-b630-0f8c1f462125%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Slaves pipeline scripts

2017-01-19 Thread jerome
I'm having a hard time accessing jenkinsfile checkout folder (@script one). 
This name can change when in parallel or if a lock occure or mutliple build 
are done. What is the proper way to get the current Jenkinsfile folder 
inside the pipeline (the one used for the scm jenkinsfile checkout)?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6c8cb5a3-e7c4-4666-ae3c-be8ce7b69b2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Slaves pipeline scripts

2017-01-19 Thread jerome
Hi,
We currently moving away form single master node under Windows to master 
under Linux and multiples node under multiples desktop OS. I was looking to 
some tips and check if my setup idea is good or maybe what others have done 
so far into such cases.

We are using Hg for repos and we did a sub repos for the Jenkinsfile. So 
multiple version of the main repos can use the same Jenkinsfile. But we 
were having many template and scripts in the master ${JENKINS_HOME}.

Now I was thinking about making the helper scripts as sub repos of the 
Jenkinsfile repos. This way I could checkout the Jenkinsfile and pull the 
proper version of the helper scripts that goes along.

Repos numbering:

   1. JenkinsFile repos
   2. Build Scripts helper
   3. Source Code project X
   4. Source Code project Y

The repos hierarchy (I think might work):

   - #3
  - #1
 - #2
  - #4
  - #1
 - #2
  
This way when I checkout the source code I known which version/branch of 
Jenkinsfile is used to build that source code. And the Jenkinsfile can use 
the proper Build scripts version. Sound about right to me. 

   1. The build would fetch the jenkinsfile for the wanted branch 
   (platform/tools/target...) sub repos #1 along with sub repos #2 (extra 
   checkout but not too bad at this point, at least I don't checkout #3 or #4 
   at this point (save a lot of HD space).
   2. Execute the jenkinsfile on the required node (#2 required to do so).
   3. Inside the node tag
  1. Checkout again but the full repos (either #3 or #4) with the #1, 
  #2 sub repos again.
  2. Execute the build on the slave.
  3. Generate build data (tests, graph, screen capture, etc)
   4. Format generated data with script of #2 to be kept as html page, log 
   parser, etc.


My problems is that the builds scripts are needed to parse the Jenkinsfile 
and run it to an extent.

Is that a right way to do it or I'm over complicating thing here?
My requirements 

   - is to be able to build an old version again with as little 
   modification as possible into the build process.
   - being able to build new way.
   - Have an history of what was used for each build exactly and reproduce 
   it if needed (for at least 10 years).

Thanks,
Jerome

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/50741335-ef5c-48a6-b540-b69fb2a7fedd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Windows to Linux migration LogParsed output

2017-01-16 Thread jerome
Seem like the build.xml result use absolute path (sigh...)


  
  
0
0
82

C:\Jenkins\jobs\CAD_CPP\jobs\CAD_CPP_ContinuousBuild\builds\83/log_content.html

C:\Jenkins\jobs\CAD_CPP\jobs\CAD_CPP_ContinuousBuild\builds\83/logerrorLinks.html

C:\Jenkins\jobs\CAD_CPP\jobs\CAD_CPP_ContinuousBuild\builds\83/logwarningLinks.html

C:\Jenkins\jobs\CAD_CPP\jobs\CAD_CPP_ContinuousBuild\builds\83/loginfoLinks.html

job/CAD_CPP/job/CAD_CPP_ContinuousBuild/83/parsed_console/log.html

C:\Jenkins\jobs\CAD_CPP\jobs\CAD_CPP_ContinuousBuild\builds\83
  


grep, awk time I guess


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6e06d76a-f4eb-4699-b530-9e6608564537%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Windows to Linux migration LogParsed output

2017-01-16 Thread jerome
Hi,

I'm migrating our Jnekins server to Linux (CentOS 7). I have everything 
mostly up and running except The previous build log parser results. It try 
to fetch the file into an aberant path and I cannot figure out why:

Problem accessing /job/CAD_CPP/job/CAD_CPP_ContinuousBuild/83/parsed_console
/job/CAD_CPP/job/CAD_CPP_ContinuousBuild/83/parsed_console/log.html. Reason:

Not Found


The file truly reside into:

/var/lib/jenkins/jobs/CAD_CPP/jobs/CAD_CPP_ContinuousBuild/builds/83/log.
html

My home dir is
/var/lib/jenkins

And the Build records is
${ITEM_ROOTDIR}/builds


This is the same as the Windows server except the home dir which was 
C:\Jenkins

For some reason it seem to try to compose it's path with something and I 
cannot figure out where is this settings exactly? Any body have a clue on 
this?

Thanks,
Jerome

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5ce24dad-b57d-4369-94ed-ff07ead83e09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: maven-plugin install

2017-01-16 Thread jerome
Sorry for the noise, Sophos AV was going crazy, I downloaded the .hpi on 
the side and upload the plugins into Jenkins manually and it work just fine.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c03b9a35-11a6-4d3a-b9b5-46e33a526f79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: maven-plugin install

2017-01-16 Thread jerome
Anybody can tell my if the 2 .hpi url above are working on there side? so I 
know if I have an enteprise firewall problem or is it really down?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/05a90bd2-e452-4d61-a66a-bb97394b74df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: maven-plugin install

2017-01-16 Thread jerome


All other plugin install properly


hudson.util.IOException2: Failed to download from 
http://updates.jenkins-ci.org/download/plugins/maven-plugin/2.14/maven-plugin.hpi
 (redirected to: 
http://mirror.xmission.com/jenkins/plugins/maven-plugin/2.14/maven-plugin.hpi)
at 
hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1172)
at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1678)
at 
hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1876)
at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1652)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.SocketTimeoutException: Read timed out
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at 
sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1926)
at 
sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1921)
at java.security.AccessController.doPrivileged(Native Method)
at 
sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1920)
at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1490)
at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at 
hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1124)
... 7 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:170)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:704)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:647)
at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1569)
at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at 
sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2982)
at java.net.URLConnection.getHeaderFieldLong(URLConnection.java:629)
at java.net.URLConnection.getContentLengthLong(URLConnection.java:501)
at java.net.URLConnection.getContentLength(URLConnection.java:485)
at 
hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1123)
... 7 more


On Monday, January 16, 2017 at 3:26:20 PM UTC-5, Daniel Beck wrote:
>
>
> > On 16.01.2017, at 21:17, jer...@bodycad.com  wrote: 
> > 
> > But I don't see the maven-plugin into the jenkins plugins available 
> list. I'm using Jenkins 2.41 under CentOS 7. 
> > So I wonder how can I get it? Or is it hidden into another plugin name. 
> > 
> > Also I was trying to install the Maven Integration plugin hoping it 
> would pull the dependency, but it seem to only fail and restart the server 
> without being installed. 
> > 
>
> Maven Integration Plugin _is_ maven-plugin. We don't necessarily know its 
> user-friendly name at the time dependencies fail to load, only its ID, 
> therefore the discrepancy. 
>
> What happens when you try to install Maven Integration Plugin, in detail? 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/14acc1bd-59a4-4447-8540-bc443249803f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


maven-plugin install

2017-01-16 Thread jerome
Hi, I'm having some trouble to install Jenkins along some plugins. It seem 
like the maven-plugin dependencies was not installed:

There are dependency errors loading some plugins:
   
   - Static Analysis Utilities v1.82
  - maven-plugin v2.9 is missing. To fix, install v2.9 or later.
   - Conditional BuildStep v1.3.5
  - maven-plugin v2.8 is missing. To fix, install v2.8 or later.
   

But I don't see the maven-plugin into the jenkins plugins available list. 
I'm using Jenkins 2.41 under CentOS 7.
So I wonder how can I get it? Or is it hidden into another plugin name.

Also I was trying to install the *Maven Integration plugin* hoping it would 
pull the dependency, but it seem to only fail and restart the server 
without being installed.

Any way to fix this or do I have to reinstall Jenkins?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3bbb09e7-71ce-4b8b-8898-d73211e1d233%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Master/Slave requirements

2017-01-11 Thread jerome
Hi,
I would like to know how people are doing to manage the slave requirements 
and installation when having different platform between master and slave.

I'm currently having a very simple setup where my Windows master have 
everything installed on it and no slave.  We are looking at making a Linux 
Master and Windows slaves.

   - Linux Master
   - many Windows slaves
   - different Visual Studio version on slaves
   - I already use Jenkinsfile pipeline, may need to adjust some node stuff

Is it possible to have groovy/python scripts on the master accessible by 
the salve:

   1. do I need to stash them and unstash them at every build?
   2. can I access them directly on the salve by requesting the master?

Is Jenkins plugins on the master accessible on the salves? timestamps, zip 
util, email ...

How one give installed software on the salve or manage them? especially the 
one not handled by Jenkins like Microsoft Visual Studio.
Can I force to have them and keep the installer or archive to deploy them 
on the slave machine (like Python 2.7, Doxygen)?

I also have some lint executable for Windows only, can I store them on the 
Master and deploy them on slvae automaticaly or I need to setup each slave 
manually?

If someone can shed some light on this, I will begin the migration testing 
later this week, but would like to have a better idea before I take a 
plunge into this and not try stuff that are impossible.

Thanks,
Jerome

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b7064734-9683-4fb2-92c5-00b38f2328e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Some questions on ArtifactArchiver for a pipeline script

2017-01-11 Thread jerome

Use:
println(pwd());
that should help you determine current working directory.

If the /home/user/project is the current working directory where the 
project is checkout and you are looking at /home/user/artifacts for the zip 
files:

archiveArtifacts artifacts: "../artifacts/**/*.zip", excludes: "
../artifacts/notIncluded/**/*.zip", fingerprint: true, allowEmptyArchive: 
false, onlyIfSuccessful: true;

Note, you don't need the step(([$class:]) wrapper anymore, make it easier 
to read into recent Jenkins. you can also change the path before calling 
archive (I haven't test it but it should work, make it more compact and 
easier to maintain and understand):
dir("../artifacts")
{
  archiveArtifacts artifacts: "**/*.zip" ...
}



-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ee8e98cd-6527-4e67-9da4-7d47f657b76e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Declarative pipepipe] Reusable stages ?

2017-01-09 Thread jerome
On the same note, anybody have a good *complete* example of the possibility 
for external part (@NonCPS, function, class, block, stage, steps, ...) for 
external parts file import/usage? I'm looking for a good do/don't.

Right now I put a file into Jenkins for the install exec path that I import 
using:
my_var = evaluate(new File("${env.JENKINS_HOME}\\custom_scripts.groovy"))

my_var is a dictionary that I can access based on the build machine to get 
the exec install path. But for importing function and having a proper for 
loop or iterator that actually work from another file, I'm a bit lost for 
how to do it properly, I managed 1 way but was having a lot of troubles 
with built-in function and @NonCPS nightmare.

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8063d424-2ee3-4141-b8c4-c7e2e89a0ce2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins pipeline build failing even though all steps/stages pass

2017-01-03 Thread jerome
Take care a ill formated script part make the build as failing. use some 
print line to make sure you reach the end of the script. Many script error 
are way too silent into JenkinsFile.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5b214ac8-6318-403b-af24-6f5c5f1c1740%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Conditional BuildStep Plugin don't fail the build

2016-12-05 Thread jerome
you can use direct assigantion to currentBuild result variable:

currentBuild.result = 'FAILURE'

avaiable value are (not sure I got them all): 
'UNSTABLE', 'SUCCESS', 'FAILURE', 'ABORTED', 'NOT_BUILT'

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/cef164ac-0ecd-4b50-b8af-512d8991e07e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins Pipeline plugin seemingly skipping commands

2016-11-25 Thread jerome
They probably are all executed, just the output is not redirect (yeah IO 
pipe into pipeline are not so funny so far). You can use the redirect stdout

*The good*
println(shell(['returnStdout': true, 'script': "git --version" ]));

*The bad*
This doesn't split std::out and std::cerr either, so you are on your own to 
split and parse the whole thing.

*The ugly*
You cannot return both the return value ('returnStatus': true) and the 
stdout at the same time! So you are totaly out of luck if you need both.


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/24433db3-4d0f-445d-bcce-77d50d73aba0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline build crashes depending on who started it?

2016-11-25 Thread jerome
Just a quick question just in case, does you other user log on the machine 
and the Jenkins is start with the other user space? Windows have a stupid 
behavior of limiting the number of user that can be loggon at the same 
time. Probably not the case, but just to make sure, run Jenkins into a 
service admin so it doesn't get kill when the other user login.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/be1d9b5a-155c-4723-8b31-f1531bb79557%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: groovy template help.

2016-11-24 Thread jerome
For the template part, here's some header variables (I do the same with 
jelly but I replace the value before giving the template to emailExt):


<%
style_default = "font-family:Verdana,Helvetica,sans serif; font-size:11px; 
color:black;"
style_header = "color: black;"
style_bg1 = "color:white; background-color:" + style_cie_color + "; 
font-size:120%;"
style_bg2 = "color:#66; background-color:white; font-size:110%; 
margin-left: 2px; margin-right: 2px;"
style_bg3 = "color: black; background-color:white;"
style_tr = "border: 1px solid " + style_cie_color + ";"
style_failure = "color: red;"
style_success = "color: green;"
style_unstable = "color: yellow;"
...
%>


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/470b6b06-53b7-4777-8038-9e94e6fbfbc8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: groovy template help.

2016-11-24 Thread jerome
Hi,
I can give you my template I used to have when non pipeline (haven't tested 
it into the pipeline, I went Jelly). Here's the code for JUnit part

<% def junitResultList = it.JUnitTestResult
if (junitResultList.size() > 0) { %>
  

JUnit Tests

<% it.JUnitTestResult.each{ junitResult ->
  junitResult.getChildren().each { packageResult -> %>

 Name: ${packageResult.getName()} 
Failed: ${packageResult.getFailCount()} test(s), Passed: 
${packageResult.getPassCount()} test(s), Skipped: 
${packageResult.getSkipCount()} test(s), Total: 
${packageResult.getPassCount()+packageResult.getFailCount()+packageResult.getSkipCount()}
 
test(s)

<% packageResult.getFailedTests().each{ failed_test -> %>

Failed: 
${failed_test.getFullName()} 

<% }
  }
}
} %>
  

For the Jelly I end up with the following:



Unit Tests




Tests Root Name
${packageResult.getName()}


Tests Counts
${packageResult.getPassCount()+packageResult.getFailCount()+packageResult.getSkipCount()}


Tests Pass
${packageResult.getPassCount()}


Tests Skip
${packageResult.getSkipCount()}


Tests Fail
${packageResult.getFailCount()}



Failed: ${failed_test.getFullName()} 


 






On Thursday, November 24, 2016 at 5:55:44 AM UTC-5, Bubunia Patra wrote:
>
>
>
> On Thursday, November 24, 2016 at 11:45:16 AM UTC+5:30, Baptiste Mathus 
> wrote:
>>
>> So what does not work? What is the error?
>>
> Code : I want to print TestName after parsing the JUNIT xml. I want to 
> parse the jUNIT and fill the table,
>
> 
> 
>  
>   Test Name
>   <% def junitResultList = it.JUnitTestResult
>   try {
>  def cucumberTestResultAction = 
> it.getAction("org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultAction")
>  junitResultList.add(cucumberTestResultAction.getResult())
> } catch(e) {
> //cucumberTestResultAction not exist in this build
>   }
>  if (junitResultList.size() > 0) { %>
>  
>   colspan="2">${junitResultList.first().displayName} 
>   <% junitResultList.each{
>   junitResult -> %>
>  <% junitResult.getChildren().each { packageResult -> %>
>  ${packageResult.getName()} } 
>  
> <% } %>
>   
>   Test Status
>   Pass
>   Fail
>   Total
>  
> 
>  
>
> It fails with Parsing Error. The error message is also not clear. 
>
> Exception raised during template rendering: Failed to parse template 
> script (your template may contain an error or be trying to use expressions 
> not currently supported): startup failed: SimpleTemplateScript61.groovy: 
> 424: expecting '}', found '' @ line 424, column 40. /* Generated by 
> SimpleTemplateEngine */ ^ 1 error groovy.lang.GroovyRuntimeException: 
> Failed to parse template script (your template may contain an error or be 
> trying to use expressions not currently supported): startup failed: 
> SimpleTemplateScript61.groovy: 424: expecting '}', found '' @ line 424, 
> column 40. /* Generated by SimpleTemplateEngine */ ^ 1 error at 
> groovy.text.SimpleTemplateEngine.createTemplate(SimpleTemplateEngine.java:125)
>  
> at groovy.text.TemplateEngine.createTemplate(TemplateEngine.java:38) at 
> hudson.plugins.emailext.plugins.content.ScriptContent.renderTemplate(ScriptContent.java:128)
>  
> at 
> hudson.plugins.emailext.plugins.content.ScriptContent.evaluate(ScriptContent.java:69)
>  
> at 
> hudson.plugins.emailext.EmailExtTemplateAction.renderTemplate(EmailExtTemplateAction.java:132)
>  
> at sun.reflect.GeneratedMethodAccessor1346.invoke(Unknown Source) at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at 
> java.lang.reflect.Method.invoke(Unknown Source) at 
> org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298) at 
> org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161) at 
> org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96) 
> at 
>
>
> Is there a document I can refer for syntax to while writing groovy 
> template script?
>
> Regards
> Pradeep
>  
>
>> Le 24 nov. 2016 6:21 AM, "Bubunia Patra"  a écrit :
>>
>> Hi all,
>>
>> I am new to groovy and the syntax is very confusing and error prone and 
>> written a template to work with Email-Extn plugin. I want to add the test 
>> result in the tabular format as below. Can anyone help me in this regard?
>>
>> Regards
>> Pradeep
>>
>> For exp if 1 test executed then i want a table in the email-body as 
>> follows: 
>>
>> TestName | Test Status | Pass | Fail | Total
>>  
>> abc  |  Pass  |  1 |  0 |  1
>>
>> 
>> 
>>  
>>   Test Name
>>   Test Status
>>   Pass
>>   Fail
>>   Total
>>  
>> 
>> 
>>
>> <% def junitResultList = it.JUnitTestResult
>> try {
>>  def cucumberTestResultAction = 
>> it.getAction("org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultAction")
>>  junitResultList.add(cucumberTestResultAction.getResult())
>> } catch(e) {
>> //cucumberTestResultAction not exist in this build
>> }
>> if (junitResultList.size() > 0) { %>
>>  
>>  > 

Re: Empty Worspace, don't know why

2016-11-23 Thread jerome
Salut,

For those who don't understand french, english will follow below ;-)

FR:
avant que plein de monde le demande, il serait bien de savoir quel est la 
configuration de ton Jenkins et de ton projet qui posse problème.


EN:
before anything, it could help us to help you if we had the Jenkins config 
and also the project config.


Jerome

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/842d1e9b-6294-4d51-b806-5e988d73573c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   >