Not able to pulll the code from GitLab using Jenkins

2017-02-02 Thread Sivakrishna Yarra
Hello Guys,
I am using Jenkins as CI, i had created a job which will pull the code from 
GitLab. For this i had configured like this. Under SourceCode Management i 
had selected Git.
I had porvided my Git *Repository URL* as like this "
*http://192.168.1.36/Enliven-Product/EnlivenService.git*";. 

Immediately i am getting the below exception. Will you please help on this 
how to resolve.

Failed to connect to repository : Command "git ls-remote -h 
http://192.168.1.36/Enliven-Product/EnlivenService.git HEAD" returned 
status code 128:
stdout: 
stderr: error: The requested URL returned error: 401 Unauthorized while 
accessing http://192.168.1.36/Enliven-Product/EnlivenService.git/info/refs

fatal: HTTP request failed

-- 
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/44f03a6b-1ec0-4c3e-867e-8535001ed62f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with build step - Windows Batch Command

2017-02-02 Thread Daniel Beck

> On 03.02.2017, at 05:39, ssitaramasas...@gmail.com wrote:
> 
> I gave a basic command echo "Hello" but I am getting the following error... I 
> believe it is expecting cmd.exe to be in my work space???

Windows batch scripts need to run on Windows nodes -- as you can see from the 
workspace path, it's a Linux system.

-- 
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/6F1A4D5E-7865-4562-9215-8600C2C6418B%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline problem after upgrading

2017-02-02 Thread Sam K
Yeah, we need to see the code to tell what's wrong with the syntax.  Which 
version were you before the upgrade?  And is it now at the latest as of 
this writing?  

On Thursday, February 2, 2017 at 4:27:42 PM UTC-8, Guy Knights wrote:
>
> I upgraded some of my pipeline plugins (there were some groovy module 
> upgrades I believe, unfortunately I don't have a list of what was upgraded) 
> and suddenly my build pipelines no longer work and are throwing the 
> following error:
>
> Running on master in /var/jenkins_home/jobs/Project1/jobs/API - 
> Deploy/workspace
> [Pipeline] {
> [Pipeline] sh
> [workspace] Running shell script
> nohup: failed to run command ‘sh’: No such file or directory
> [Pipeline] }
> [Pipeline] // node
> [Pipeline] }
> [Pipeline] // stage
> [Pipeline] End of Pipeline
> ERROR: script returned exit code -2
> Finished: FAILURE
>
> Does anyone know why?
>
> Thanks,
> Guy
>

-- 
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/11cb91ac-090b-46e6-92b3-fe2968916657%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Problem with build step - Windows Batch Command

2017-02-02 Thread ssitaramasastri
Hi

I have setup Jenkins in Docker and am able to run some ANT script, I now 
have to run some 'windows batch script'. I gave a basic command echo 
"Hello" but I am getting the following error... I believe it is expecting 
cmd.exe to be in my work space??? Can some one please help me resolve this 
? Thanks in advance

[CI] $ cmd /c call /tmp/hudson5615964182226568321.bat
FATAL: command execution failed
java.io.IOException: Cannot run program "cmd" (in directory 
"/var/jenkins_home/workspace/CI"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at hudson.Proc$LocalProc.(Proc.java:243)
at hudson.Proc$LocalProc.(Proc.java:212)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:815)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:95)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:64)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.Build$BuildExecution.build(Build.java:205)
at hudson.model.Build$BuildExecution.doRun(Build.java:162)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1720)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 15 more
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

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/5d9a8078-ec9e-43b4-9593-0e06b4c06948%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Pipeline problem after upgrading

2017-02-02 Thread Guy Knights
I upgraded some of my pipeline plugins (there were some groovy module
upgrades I believe, unfortunately I don't have a list of what was upgraded)
and suddenly my build pipelines no longer work and are throwing the
following error:

Running on master in /var/jenkins_home/jobs/Project1/jobs/API -
Deploy/workspace
[Pipeline] {
[Pipeline] sh
[workspace] Running shell script
nohup: failed to run command ‘sh’: No such file or directory
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // stage
[Pipeline] End of Pipeline
ERROR: script returned exit code -2
Finished: FAILURE

Does anyone know why?

Thanks,
Guy

-- 
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/CANNH9mv%2BwWNxQ4-H9rmS5_hxftbfBL2aUK8OU_pRqzJQuUX0oA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Help with groovy syntax

2017-02-02 Thread kurrent93
Hello

I had a jenkinsfile which worked perfectly, but after updating it no longer 
works.


*Old Jenkinsfile*
#!/usr/bin/groovy
@Library('github.com/fabric8io/fabric8-pipeline-library@master')

def failIfNoTests = ""
try {
  failIfNoTests = ITEST_FAIL_IF_NO_TEST
} catch (Throwable e) {
  failIfNoTests = "false"
}

def itestPattern = ""
try {
  itestPattern = ITEST_PATTERN
} catch (Throwable e) {
  itestPattern = "*KT"
}

def versionPrefix = ""
try {
  versionPrefix = VERSION_PREFIX
} catch (Throwable e) {
  versionPrefix = "1.0"
}

def canaryVersion = "${versionPrefix}.${env.BUILD_NUMBER}"
//def utils = new io.fabric8.Utils()

node {
  def envProd = 'shiftwork-production'

  checkout scm




  kubernetes.pod('buildpod')
  .withNewContainer()
  .withImage('jhipster/jhipster')   
  .withPrivileged(true)
  .withHostPathMount('/var/run/docker.sock','/var/run/docker.sock')
  .withEnvVar('DOCKER_CONFIG','/home/jenkins/.docker/')
  .withSecret('jenkins-docker-cfg','/home/jenkins/.docker')
  .withSecret('jenkins-maven-settings','/root/.m2')
  .withServiceAccount('jenkins')
  .inside {
stage 'Canary Release'
mavenCanaryRelease{
  version = canaryVersion
}

stage 'Integration Test'
mavenIntegrationTest{
  environment = 'Testing'
  failIfNoTests = localFailIfNoTests
  itestPattern = localItestPattern
}

stage 'Rolling Upgrade Production'
def rc = readFile 'target/classes/kubernetes.json'
kubernetesApply(file: rc, environment: envProd)

  }
}


*New Syntax*
So I'm trying to replace with the below groovy. But this results in an 
error. Im not familiar with groovy. The old DSL style syntax was very easy 
to read and write. The below, newer, syntax.
podTemplate(label: label, serviceAccount: 'jenkins', containers: [
 [name: 'maven', image: 'fabric8/maven-builder', command: 'cat', 
ttyEnabled: true, 
 envVars: [
 [key: 'DOCKER_CONFIG', value:'/home/jenkins/.docker/'],
 ],
 [name: 'jnlp', image: 'iocanel/jenkins-jnlp-client:latest', 
command:'/usr/local/bin/start.sh', args: '${computer.jnlpmac} 
${computer.name}', ttyEnabled: false,
envVars: [
 [key: 'DOCKER_HOST', value: 'unix:/var/run/docker.sock']
 ]
 ]
 ],
 volumes: [
[$class: 'PersistentVolumeClaim', mountPath: 
'/home/jenkins/.mvnrepository', claimName: 'jenkins-mvn-local-repo'],
[$class: 'SecretVolume', mountPath: '/home/jenkins/.m2/', 
secretName: 'jenkins-maven-settings'],
[$class: 'SecretVolume', mountPath: 
'/home/jenkins/.docker', secretName: 'jenkins-docker-cfg'],
[$class: 'HostPathVolume', mountPath: 
'/var/run/docker.sock', hostPath: '/var/run/docker.sock']
]])

*Error*

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 34: Unexpected node type: EXPR found when expecting type: 
LABELED_ARG at line: 34 column: 10. File: WorkflowScript @ line 34, column 10.
[name: 'maven', image: 'fabric8/maven-builder', command: 'cat', 
ttyEnabled: true, 
^


Also, how do I write 
.withImage('jhipster/jhipster')
in the new syntax?


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/eb84f4fd-3ba9-4e75-b915-512e8bc5ae06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Build periodically with Parameters support

2017-02-02 Thread Sam K
I could not find this plugin in the compatibility page 
here: https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md

Is there a way I can schedule the same job with different parameters?  I am 
using a non-declarative job just to kick off my parameterized declarative 
pipeline each night.  :)

-- 
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/7321d978-45c0-4faa-aa20-6022bad84b46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins2 pipeline - Global methods in shared-library fails when invoked

2017-02-02 Thread David Karr
On Thursday, February 2, 2017 at 2:13:36 PM UTC-8, Daniel Beck wrote:
>
>
> > On 02.02.2017, at 17:27, David Karr > 
> wrote: 
> > 
> > Wow, and the documentation page doesn't even MENTION this fact?  I'm 
> reading it now, and there's that underscore, completely without any 
> statement like YES, THIS REALLY NEEDS TO BE HERE.  Seriously? 
>
> Could you clarify what you're referring to? Tor Christian quoted the 
> documentation which states… 
>
> > For Shared Libraries which only define Global Variables (vars/), or a 
> Jenkinsfile which only needs a Global Variable, the annotation pattern 
> @Library('my-shared-library') _ may be useful for keeping code concise. In 
> essence, instead of annotating an unnecessary import statement, the symbol 
> _ is annotated. 
>
>
>
I perhaps phrased that stronger than it should have. However, the example 
that comes before this text uses the underscore character without 
mentioning it.  It's only this note that comes a few lines later on when 
this is mentioned. When I first wrote that reply (I did try to delete it), 
I saw the example without any explanation, and didn't notice the 
explanation until later.

-- 
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/318779d6-87fc-4edb-9f9b-1ed45a37bb8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to get ip(public or private of one EC2 node and pass it to second

2017-02-02 Thread Moshe Zuisman
I am quite a new bee in jenkins. So - it can happen , that  I ask something 
that already was asked. While - I did not find anything on those or another 
forums or documentation.

I have 2 jobs on my jenkins server. 
One creates node (EC2 amazon Windows machine) with application server 
installed on it.
Second should create secondary fail-over instance, thay have to "know" host 
of primary host (and keep it in application database).
At batch script, that I have put in primary job definition I have run power 
shell job that prints public host name of primary host into stdout. So - 
when I look at job stdout - I can copy from there those public IP.
Than I edit job definition of secondary node and put there primary host 
ip...
So - I can run my tests half automatically , but it require manual 
involvement in secondary node job, and prevent automatic execution of tests.
Is there any way to store those primary host ip during run of primary job 
run(in some jenkins intenal variables , storage , whatever) of even let us 
say file/local db - at machine running jenkins server. So - that later 
secondary job whould be able to get it automatically without human 
involvement...

To get it clear. I can not run primary job in advance and keep it alive 
with constant IP. Since all those test is test of ongoing development 
builds - both instances have to be each time recreated from scratch, since 
they are each time installed from last development build.
Thanks in advance 

-- 
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/7d579a1c-caf4-43f7-9424-cd9179bda308%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Pipeline with build parameters creation

2017-02-02 Thread garylau . work
Hello,

I'm currently dynamically creating several jobs with different build 
parameters.  I want to combine these jobs into a single pipeline and have 
the pipeline run these jobs in parallel.  Which plugins would be 
recommended for this task?  Additionally, I need to be able to retrieve the 
console output of each of those jobs.  I was trying the example from 
https://github.com/jenkinsci/pipeline-examples/blob/master/pipeline-examples/jobs-in-parallel/jobs_in_parallel.groovy
 
but am getting "

java.lang.NoSuchMethodError: No such DSL method 'build'"

Any suggestions would be appreciated.

-- 
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/b252ad0e-b9d1-43ab-b68e-23df09df0d81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: User not passing to job history if submitted by URL?

2017-02-02 Thread Daniel Beck

> On 02.02.2017, at 20:26, Don Alcombright  wrote:
> 
> Any thoughts on what I am doing wrong?

You forgot to include the interesting parts of the URL you're using. Strip out 
job names or whatever, but leave the rest intact.

Also, what does Jenkins tell you is the cause for the build, if not the user 
triggering it?

-- 
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/F2D18623-BA4D-43FA-8C69-C1E860FC9A9E%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: Using pipeline shared library is failing with "I don't handle protocol 'git clone ssh'"

2017-02-02 Thread David Karr
On Thursday, February 2, 2017 at 9:15:57 AM UTC-8, David Karr wrote:
>
> In Jenkins 2.19.2, I now have three different pipeline jobs using a 
> variation of the same script components, including a bunch of methods that 
> I've pasted into each script.  I'm storing each script in git, but I think 
> it's now time to define a shared library so I can remove the duplicated 
> methods.
>
> So, I created a git repo with the "src", "vars", and "resources" structure 
> (initial test only has a single class in the "src" tree), and referenced 
> that repo from the shared library definition.
>
> I first noticed that something might be wrong when I entered "1.0" in the 
> "Default Version" field and it printed "Cannot validate default version" 
> below that.  When I clicked on "show details" it said something like this:
> hudson.plugins.git.GitException: Command "/opt/app/git/1.9.0-0.14/bin/git 
> fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*" 
> returned status code 128:
> stdout: 
> stderr: fatal: I don't handle protocol 'git clone ssh'
>
> at 
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1745)
>
>
> Even with this, I went ahead and tried adding the reference to the library 
> in one of my pipeline scripts, only to reference the single class I put in 
> the library (a simple enum definition).  In the build output, the first 
> reference to the repo containing the shared library looks like this:
>
> Setting origin to git clone ssh://git@.../usl_jenkins_library.git
>  > /opt/app/git/1.9.0-0.14/bin/git config remote.origin.url git clone 
> ssh://git@.../usl_jenkins_library.git # timeout=10
> Fetching origin...
> Fetching upstream changes from origin
>  > /opt/app/git/1.9.0-0.14/bin/git --version # timeout=10
> using GIT_ASKPASS to set credentials 
>  > /opt/app/git/1.9.0-0.14/bin/git fetch --tags --progress origin 
> +refs/heads/*:refs/remotes/origin/*
> hudson.plugins.git.GitException: Command "/opt/app/git/1.9.0-0.14/bin/git 
> fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*" returned 
> status code 128:
> stdout: 
> stderr: fatal: I don't handle protocol 'git clone ssh'
>
> at 
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1745)
> at 
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1489)
>
>
> If it matters, I modified my pipeline script to look like this:
> @Library("usl-pipeline-library")
> import com.att.usl.jenkins.BUILD_STATUS
>
> import groovy.xml.*
> import java.nio.file.*
> import hudson.model.*
> import hudson.triggers.*
> import hudson.plugins.git.GitStatus
>
>
> What might I be doing wrong here?
>

Hmm, well, this is was a head-slap error.  I didn't pay enough attention to 
what I pasted into the "repository" field.  I copied the entire "git clone" 
instruction instead of just the repository url.  Moving forward now. 

-- 
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/adae71ec-42d0-4b79-ae92-3b7bff880d64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using pipeline shared library is failing with "I don't handle protocol 'git clone ssh'"

2017-02-02 Thread Daniel Beck

> On 02.02.2017, at 18:15, David Karr  wrote:
> 
> What might I be doing wrong here?

Are you including 'git clone' wherever you are pasting the URL to the repo?

-- 
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/2F7A12FC-DB29-4C3C-96DA-77B8741DC466%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins2 pipeline - Global methods in shared-library fails when invoked

2017-02-02 Thread Daniel Beck

> On 02.02.2017, at 17:27, David Karr  wrote:
> 
> Wow, and the documentation page doesn't even MENTION this fact?  I'm reading 
> it now, and there's that underscore, completely without any statement like 
> YES, THIS REALLY NEEDS TO BE HERE.  Seriously?

Could you clarify what you're referring to? Tor Christian quoted the 
documentation which states…

> For Shared Libraries which only define Global Variables (vars/), or a 
> Jenkinsfile which only needs a Global Variable, the annotation pattern 
> @Library('my-shared-library') _ may be useful for keeping code concise. In 
> essence, instead of annotating an unnecessary import statement, the symbol _ 
> is annotated.


-- 
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/90C8402F-BA1C-47F1-BD74-DE22FC7EB7E3%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Problem using Github Credentials in Maven Release

2017-02-02 Thread jermccormick
Hi, 

I'm having trouble supplying my github credentials to a release build for a 
Maven project using the Jenkins credentials plugin.

When I use the form to supply the SCM credentials for a specific release, 
it works fine.  But it ends up putting my github password in the console 
log!  So I can't use that as a permanent solution, as I want to save the 
builds for my releases.

But when I use the github credentials plugin, I get the following error 
message in my build log...

[ERROR] Provider message:[ERROR] The git-push command failed.[ERROR] Command 
output:[ERROR] fatal: could not read Username for 'https://github.com': No such 
device or address[ERROR] -> [Help 1]


I am supplying my credentials with the username as my github account name and 
password, but Jenkins does not seem able to correctly supply this to the git 
commands it is using.


I am defining my SCM info in the Maven POM file like this...




  scm:git:git://github.com/username/project.git

  
scm:git:https://github.com/username/project.git

  http://github.com/username/project

  HEAD




I tried with both https as shown here and an SSH URL but both had the same 
issue.

Any idea on why it works okay when I supply the SCM password using the 
release form but not when I try to use a saved credential?

Thanks.

--Jeremy

-- 
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/2c49dadc-87eb-440e-96a2-c23d07f540bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: cannot create - Directory nonexistent

2017-02-02 Thread kurrent93
I 'described' the pod and see:

Events:
  FirstSeen LastSeen Count From SubobjectPath Type Reason Message
  -  -  -  -- ---
  10m 10m 1 {default-scheduler } Normal Scheduled Successfully assigned 
buildpod-34a7d18b-a756-4ce8-a851-cf3221884432 to 176.9.36.15
  10m 10m 1 {kubelet 176.9.36.15} spec.containers{buildcnt} Normal Pulling 
pulling 
image "jhipster/jhipster"
  10m 10m 1 {kubelet 176.9.36.15} spec.containers{buildcnt} Normal Pulled 
Successfully 
pulled image "jhipster/jhipster"
  10m 10m 1 {kubelet 176.9.36.15} spec.containers{buildcnt} Normal Created 
Created 
container with docker id 8dc9f93dbc43; Security:[seccomp=unconfined]
  10m 10m 1 {kubelet 176.9.36.15} spec.containers{buildcnt} Warning Failed 
Failed 
to start container with docker id 8dc9f93dbc43 with error: Error response 
from daemon: {"message":"invalid header field value \"oci runtime error: 
container_linux.go:247: starting container process caused \\\"chdir to cwd 
(\\\"/home/jenkins/workspace/copy-of-sw\\\") set in config.json 
failed: no such file or directory\\\"\\n\""}
  10m 10m 1 {kubelet 176.9.36.15} Warning FailedSync Error syncing pod, 
skipping: failed to "StartContainer" for "buildcnt" with RunContainerError: 
"runContainer: Error response from daemon: {\"message\":\"invalid header 
field value \\\"oci runtime error: container_linux.go:247: starting 
container process caused \\\"chdir to cwd 
(\\\"/home/jenkins/workspace/copy-of-sw\\\") set in 
config.json failed: no such file or directory\\\"n\\\"\"}"


 

-- 
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/7705c37b-2863-4c84-9979-37a5f711064b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


cannot create - Directory nonexistent

2017-02-02 Thread kurrent93
Hi

I'm trying to run this jenkinsfile, but get the below error. Does anyone 
know what the problem is?

Jenkinfile
#!/usr/bin/groovy
@Library('github.com/fabric8io/fabric8-pipeline-library@master')

def failIfNoTests = ""
try {
  failIfNoTests = ITEST_FAIL_IF_NO_TEST
} catch (Throwable e) {
  failIfNoTests = "false"
}

def itestPattern = ""
try {
  itestPattern = ITEST_PATTERN
} catch (Throwable e) {
  itestPattern = "*KT"
}

def versionPrefix = ""
try {
  versionPrefix = VERSION_PREFIX
} catch (Throwable e) {
  versionPrefix = "1.0"
}

def canaryVersion = "${versionPrefix}.${env.BUILD_NUMBER}"
//def utils = new io.fabric8.Utils()

node {
  def envProd = 'shiftwork-production'

  checkout scm

  kubernetes.pod('buildpod')
  .withNewContainer()
  .withImage('jhipster/jhipster')   
  .withPrivileged(true)
  //.withHostPathMount('/var/run/docker.sock','/var/run/docker.sock')
  //.withEnvVar('DOCKER_CONFIG','/home/jenkins/.docker/')
  //.withSecret('jenkins-docker-cfg','/home/jenkins/.docker')
  //.withSecret('jenkins-maven-settings','/root/.m2')
  //.withServiceAccount('jenkins')
  .inside {
stage 'Canary Release'
mavenCanaryRelease{
  version = canaryVersion
}

stage 'Integration Test'
mavenIntegrationTest{
  environment = 'Testing'
  failIfNoTests = localFailIfNoTests
  itestPattern = localItestPattern
}

stage 'Rolling Upgrade Production'
def rc = readFile 'target/classes/kubernetes.json'
kubernetesApply(file: rc, environment: envProd)

  }
}




Error

[Pipeline] withPod
[Pipeline] {
[Pipeline] stage (Canary Release)
Using the ‘stage’ step without a block argument is deprecated
Entering stage Canary Release
Proceeding
[Pipeline] sh
[copy of sw] Running shell script
$ sh -c echo $$ > '/home/jenkins/workspace/copy of 
sw@tmp/durable-65cd6640/pid'; jsc=durable-5f8d30ed8e3c29be00825e1f021569f8; 
JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/copy of 
sw@tmp/durable-65cd6640/script.sh' > '/home/jenkins/workspace/copy of 
sw@tmp/durable-65cd6640/jenkins-log.txt' 2>&1; echo $? > 
'/home/jenkins/workspace/copy of sw@tmp/durable-65cd6640/jenkins-result.txt' 
exit
/bin/sh: 1: cannot create /home/jenkins/workspace/copy of 
sw@tmp/durable-65cd6640/pid: Directory nonexistent
/bin/sh: 1: cannot create /home/jenkins/workspace/copy of 
sw@tmp/durable-65cd6640/jenkins-log.txt: Directory nonexistent
/bin/sh: 1: cannot create /home/jenkins/workspace/copy of 
sw@tmp/durable-65cd6640/jenkins-result.txt: Directory nonexistent

$ command terminated with non-zero exit code: Error executing in Docker 
Container: 2[Pipeline] }
[Pipeline] // withPod
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code -2
Finished : FAILURE



-- 
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/6a59f50b-5c30-4792-9eb7-e42d918620ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


User not passing to job history if submitted by URL?

2017-02-02 Thread Don Alcombright
We have an internal build page setup that passes builds off via URL. This 
method works fine but for some reason, although the job passes fine with

http://username:apitoken@jenkins-server

the build history doesn't show the user that kicked it off. If i submit via 
the UI of Jenkins it does. Any thoughts on what I am doing wrong?

-- 
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/5fa3d255-c0bd-4f9e-8799-ea7984abe45e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using pipeline shared library is failing with "I don't handle protocol 'git clone ssh'"

2017-02-02 Thread David Karr
In Jenkins 2.19.2, I now have three different pipeline jobs using a 
variation of the same script components, including a bunch of methods that 
I've pasted into each script.  I'm storing each script in git, but I think 
it's now time to define a shared library so I can remove the duplicated 
methods.

So, I created a git repo with the "src", "vars", and "resources" structure 
(initial test only has a single class in the "src" tree), and referenced 
that repo from the shared library definition.

I first noticed that something might be wrong when I entered "1.0" in the 
"Default Version" field and it printed "Cannot validate default version" 
below that.  When I clicked on "show details" it said something like this:
hudson.plugins.git.GitException: Command "/opt/app/git/1.9.0-0.14/bin/git 
fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*" 
returned status code 128:
stdout: 
stderr: fatal: I don't handle protocol 'git clone ssh'

at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1745)


Even with this, I went ahead and tried adding the reference to the library 
in one of my pipeline scripts, only to reference the single class I put in 
the library (a simple enum definition).  In the build output, the first 
reference to the repo containing the shared library looks like this:

Setting origin to git clone ssh://git@.../usl_jenkins_library.git
 > /opt/app/git/1.9.0-0.14/bin/git config remote.origin.url git clone 
 > ssh://git@.../usl_jenkins_library.git # timeout=10
Fetching origin...
Fetching upstream changes from origin
 > /opt/app/git/1.9.0-0.14/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials 
 > /opt/app/git/1.9.0-0.14/bin/git fetch --tags --progress origin 
 > +refs/heads/*:refs/remotes/origin/*
hudson.plugins.git.GitException: Command "/opt/app/git/1.9.0-0.14/bin/git fetch 
--tags --progress origin +refs/heads/*:refs/remotes/origin/*" returned status 
code 128:
stdout: 
stderr: fatal: I don't handle protocol 'git clone ssh'

at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1745)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1489)


If it matters, I modified my pipeline script to look like this:
@Library("usl-pipeline-library")
import com.att.usl.jenkins.BUILD_STATUS

import groovy.xml.*
import java.nio.file.*
import hudson.model.*
import hudson.triggers.*
import hudson.plugins.git.GitStatus


What might I be doing wrong 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/b316a2ba-e8a2-4503-9740-e4a237187773%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins2 pipeline - Global methods in shared-library fails when invoked

2017-02-02 Thread David Karr
On Thursday, February 2, 2017 at 3:30:05 AM UTC-8, R Tyler Croy wrote:
>
> (replies inline) 
>
> On Thu, 02 Feb 2017, Tor Christian Solev?gseide wrote: 
>
> > I was finally able to solve this myself. The problem was how I 
> referenced 
> > the shared library. Apparently, I need to add the underscore character 
> to 
> > the end if my @Library annotation like this: 
> > @Library('customized-portal-lib') _ 
> > 
> > Also, I must make sure to not import my global *acme *variable. 
> > 
> > This is documented 
> > in https://jenkins.io/doc/book/pipeline/shared-libraries/ for those who 
> > take their time to fine read it (which I didn't at first): 
>
>
> FWIW, the underscore character is kind of a cute little hack. @Library is 
> an 
> annotation so it must annotate *something*, annotating the underscore is 
> kind 
> of like annotating a throwaway unused character. Technically you're able 
> to 
> annotate other statements, as the section in the handbook describes 
>

Wow, and the documentation page doesn't even MENTION this fact?  I'm 
reading it now, and there's that underscore, completely without any 
statement like YES, THIS REALLY NEEDS TO BE HERE.  Seriously?
 

>
>
> - R. Tyler Croy 
>
> -- 
>  Code:  
>   Chatter:  
>  xmpp: rty...@jabber.org  
>
>   % gpg --keyserver keys.gnupg.net --recv-key 1426C7DC3F51E16F 
> -- 
>

-- 
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/f0014c4e-2d77-4372-bf65-817b08b02b7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I perform if/else operations in a jenkins workflow build?

2017-02-02 Thread Slide
The best way to find out is to try it. We're willing to help if you get
stuck, but you also need to try things yourself and figure things out.
We're not going to write your script for you.

On Thu, Feb 2, 2017 at 7:34 AM siva varma Datla 
wrote:

> So you say this should work??
>
> node {
>
> if (result.toString() != "SUCCESS") {
>   notifyFailure()
> } else {
>   notifySuccessful()
> }
>
> }
>
> On Thursday, February 2, 2017 at 9:12:48 AM UTC-5, slide wrote:
>
> You are checking for != "SUCCESS" and then doing your success
> notification. You probably want to swap the stuff inside the blocks.
>
> On Thu, Feb 2, 2017, 07:08 siva varma Datla  wrote:
>
> I need an email notification for my job status I have groovy syntax for if
> condition please let me know if I am  doing it wrong. Using this syntax its
> only pushing notification when ever my build is successful its not sending
> any kind of notifications for failed build.
>
> node {
>
> if (result.toString() != "SUCCESS") {
>   notifySuccessful()
> } else {
>   notifyFailure()
> }
>
> }
>
> --
> 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/1f899ca2-9df5-45c3-b96e-0d8684666d3a%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/cf6835f7-ca68-4625-94ff-bb4b628ceb31%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/CAPiUgVcX0Ydpn-7QK7jnpVne37Ut2bgBoy%2BGSxoqKggFc_0Ttw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I perform if/else operations in a jenkins workflow build?

2017-02-02 Thread siva varma Datla
So you say this should work??

node { 

if (result.toString() != "SUCCESS") {
  notifyFailure()
} else {
  notifySuccessful()
}

}

On Thursday, February 2, 2017 at 9:12:48 AM UTC-5, slide wrote:
>
> You are checking for != "SUCCESS" and then doing your success 
> notification. You probably want to swap the stuff inside the blocks.
>
> On Thu, Feb 2, 2017, 07:08 siva varma Datla  > wrote:
>
>> I need an email notification for my job status I have groovy syntax for 
>> if condition please let me know if I am  doing it wrong. Using this syntax 
>> its only pushing notification when ever my build is successful its not 
>> sending any kind of notifications for failed build.
>>
>> node { 
>>
>> if (result.toString() != "SUCCESS") {
>>   notifySuccessful()
>> } else {
>>   notifyFailure()
>> }
>>
>> }
>>
>> -- 
>> 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/1f899ca2-9df5-45c3-b96e-0d8684666d3a%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/cf6835f7-ca68-4625-94ff-bb4b628ceb31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I perform if/else operations in a jenkins workflow build?

2017-02-02 Thread Slide
You are checking for != "SUCCESS" and then doing your success notification.
You probably want to swap the stuff inside the blocks.

On Thu, Feb 2, 2017, 07:08 siva varma Datla  wrote:

> I need an email notification for my job status I have groovy syntax for if
> condition please let me know if I am  doing it wrong. Using this syntax its
> only pushing notification when ever my build is successful its not sending
> any kind of notifications for failed build.
>
> node {
>
> if (result.toString() != "SUCCESS") {
>   notifySuccessful()
> } else {
>   notifyFailure()
> }
>
> }
>
> --
> 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/1f899ca2-9df5-45c3-b96e-0d8684666d3a%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/CAPiUgVf80QF4%3DQRUdnx2fVdkm_SifqvO4TJLivFd6Q03b1NudQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How do I perform if/else operations in a jenkins workflow build?

2017-02-02 Thread siva varma Datla
I need an email notification for my job status I have groovy syntax for if 
condition please let me know if I am  doing it wrong. Using this syntax its 
only pushing notification when ever my build is successful its not sending 
any kind of notifications for failed build.

node { 

if (result.toString() != "SUCCESS") {
  notifySuccessful()
} else {
  notifyFailure()
}

}

-- 
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/1f899ca2-9df5-45c3-b96e-0d8684666d3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: $JENKINS_HOME vs. $WORKSPACE on a slave (agent) node vs master node

2017-02-02 Thread Ioannis Moutsatsos
I believe that you can define a JENKINS_HOME environment variable on the 
slave node. Jobs running there will use that instead of the JAVA_HOME of 
the master.

On Wednesday, February 1, 2017 at 4:48:52 PM UTC-5, Bruce Epstein wrote:
>
> Hi Everyone -
>
> I have one master and one slave node.
>
> I am trying to move some Jenkins jobs that currently run on the master to 
> instead run on the slave.
>
> For various reasons, I need (or at least want) to use the $JENKINS_HOME 
> env variable in my scripts, but it returns the value of the master jenkins 
> localtion, even when running a job on the slave.
>
> On the master node, $JENKINS_HOME  is 
> /opt/apache-tomcat-7.0.54/webapps/jenkins
>
> On the slave node, $JENKINS_HOME should be /opt/jenkins, but is being 
> returned as the master's value ( /opt/apache-tomcat-7.0.54/webapps/jenkins)
>
> For now, the best I have been able to do is climb up the directory 
> hierarchy, using something like:
>
> $WORKSPACE/../../../..
>
> So $WORKSPACE is returning the workspace location correctly on the slave, 
> but $JENKINS_HOME is returning the jenkins installation folder on the 
> master.
>
> Is this the expected behavior?
>
> Is there another env variable I should be using?
>
> Regardless, I have hundreds of Jenkins jobs, and tweaking them all will be 
> painful if I can't simply modify $JENKINS_HOME on which they currently rely.
>
> I think it is an IT configuration issue, because they say that when they 
> echo $JENKINS_HOME it gives the expected value on the slave node, as 
> follows:
>
> [jenkins@builder01-slave01 ~]$ echo $JENKINS_HOME
>
>
> /opt/jenkins
>
>  
>
> Maybe the Jenkins process was started as "root" and not as the "jenkins" 
> user, and they've defined $JENKINS_HOME for the wrong user?
>
> If it is an IT-related configuration and not a Jenkins thing, please give 
> advice and I'll rely it onto the IT dept, who control the server config.
>
>
> Thanks in advance 
> Cheers
> Bruce
>

-- 
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/6245bbe5-c448-420a-9f3b-f86cedc4a567%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins2 pipeline - Global methods in shared-library fails when invoked

2017-02-02 Thread R. Tyler Croy
(replies inline)

On Thu, 02 Feb 2017, Tor Christian Solev?gseide wrote:

> I was finally able to solve this myself. The problem was how I referenced 
> the shared library. Apparently, I need to add the underscore character to 
> the end if my @Library annotation like this:
> @Library('customized-portal-lib') _
> 
> Also, I must make sure to not import my global *acme *variable.
> 
> This is documented 
> in https://jenkins.io/doc/book/pipeline/shared-libraries/ for those who 
> take their time to fine read it (which I didn't at first):


FWIW, the underscore character is kind of a cute little hack. @Library is an
annotation so it must annotate *something*, annotating the underscore is kind
of like annotating a throwaway unused character. Technically you're able to
annotate other statements, as the section in the handbook describes


- R. Tyler Croy

--
 Code: 
  Chatter: 
 xmpp: rty...@jabber.org

  % gpg --keyserver keys.gnupg.net --recv-key 1426C7DC3F51E16F
--

-- 
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/20170202112955.GJ26439%40blackberry.coupleofllamas.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Digital signature


Re: Publisher Over CIFS(CifsBuilderPlugin) seems not to be working when configuring the plugin using groovy DSL script

2017-02-02 Thread Makarand Jadhav
Another interesting thing I found that when I use the following "project / 
'builders' / 'jenkins.plugins.publish__over__cifs.CifsPublisherPlugin'" 
instead of CifsBuilderPlugin in the groovy script, it seems to populate the 
values in the plugin in Jenkins Job configuration but I believe it gives me 
the publisher view in "Build Step" which is not what I want. Also, on 
saving the job configuration, the plugin seems to disappear. Not sure if 
anyone has seen this issue or am I doing something wrong here!

On Thursday, January 26, 2017 at 1:39:13 PM UTC, Makarand Jadhav wrote:
>
> I am using the below groovy DSL script for populating the 
> "publish_*over*_cifs"(v0.3) 
> in the Build step for sending files to Windows Share from a Linux 
> jenkins(v1.640) server from a seed job. The code seems to generate the 
> "Publish Over CIFS" plugin in the job but the values(highlighted in Red 
> color below) set in the Groovy script does not seem to get populated after 
> the plugin is generated from the groovy script & JobDSL plugin(v1.45):
> Note that the jenkins Global Configuration has the CIFS Share 
> APP_Share_dev configured & it connects using the credentials successfully
>
> job('test3_app') {
> logRotator(-1, 10)
> jdk('JDK7')
> scm {
> }
> triggers {
> }
> steps
> { gradle('clean build') }
>
> //steps {
> configure { project ->
> // Configure Publish over CIFS
> project / 'builders' / 
> 'jenkins.plugins.publish_*over*_cifs.CifsBuilderPlugin'(plugin="publish-over-cifs@0.3")
>  
> {
> delegate.publishers {
> consolePrefix('CIFS:')
> 'jenkins.plugins.publish_*over*_cifs.CifsPublisher' {
> Name('APP_Share_dev')
> verbose('true')
> useWorkspaceInPromotion(false)
> usePromotionTimestamp(false)
> transfers {
> 'jenkins.plugins.publish_*over*_cifs.CifsTransfer' {
> sourceFiles('app.ear')
> excludes('')
> remoteDirectory("app\\ws
> ear")
> removePrefix('')
> remoteDirectorySDF(false)
> flatten(false)
> cleanRemote(true)
> noDefaultExcludes(false)
> makeEmptyDirs(true)
> patternSeparator('[, ]+')
> }
> }
> continueOnError('false')
> failOnError('true')
> alwaysPublishFromMaster('false')
> }
> }
> }
> }
>
> Am I missing something here? Please let me know if the above 
> implementation is correct in the Groovy Script.
>

-- 
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/54120890-ab4c-4e92-ace9-04a982a68b4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins2 pipeline - Global methods in shared-library fails when invoked

2017-02-02 Thread Tor Christian Solevågseide
I was finally able to solve this myself. The problem was how I referenced 
the shared library. Apparently, I need to add the underscore character to 
the end if my @Library annotation like this:
@Library('customized-portal-lib') _

Also, I must make sure to not import my global *acme *variable.

This is documented 
in https://jenkins.io/doc/book/pipeline/shared-libraries/ for those who 
take their time to fine read it (which I didn't at first):

> For Shared Libraries which only define Global Variables (vars/), or a 
> Jenkinsfile which only needs a Global Variable, the annotation 
>  pattern 
> @Library('my-shared-library') 
> _ may be useful for keeping code concise. In essence, instead of 
> annotating an unnecessary import statement, the symbol _ is annotated.
>
 

> It is not recommended to import a global variable/function, since this 
> will force the compiler to interpret fields and methods as static even if 
> they were intended to be instance. The Groovy compiler in this case can 
> produce confusing error messages.


/TC


fredag 20. januar 2017 12.24.21 UTC+1 skrev Tor Christian Solevågseide 
følgende:
>
> As documented in https://jenkins.io/doc/book/pipeline/shared-libraries/, 
> I've created the file vars/acme.groovy in a library project checked into 
> our SVN.
>
>
> def setName(value) {
> this.name = value;
> }
> def getName() {
> return this.name;
> }
> def caution(message) {
> echo "Hello, ${this.name}! CAUTION: ${message}"
> }
>
>
>
>
> My pipeline script in a Jenkins2 pipeline project:
> acme.name = 'Alice'
> echo acme.name 
>
> acme.caution 'The queen is angry!'
>
>
>
>
> The two first lines, setting and getting the name works fine.
> But when I include the last line, calling the "caution" function the 
> script fails with
>
>
> hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No 
> signature of method: static Alice.caution() is applicable for argument 
> types: (java.lang.String) values: [The queen is angry!]
> Possible solutions: caution(java.lang.Object), wait(), 
> main([Ljava.lang.String;)
> at 
> groovy.lang.MetaClassImpl.invokeStaticMissingMethod(MetaClassImpl.java:1503)
> at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1489)
> at 
> org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.call(StaticMetaClassSite.java:53)
> at 
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
> at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
> at 
> com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:18)
> at WorkflowScript.run(WorkflowScript:8)
>
>
>
> If I remove the first 2 lines of the pipeline script, leaving only the 
> "acme.caution" call, the error detail is changed to
>
> hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No 
> signature of method: static acme.caution() is applicable for argument types: 
> (java.lang.String) values: [The queen is angry!]
>
>
>
> Jenkins version 2.41
> Pipeline plugin 2.4
>
>
> Any idea what's going on here?  Feels like a bug, or at least wrong doc...?
>
> regards
> Tor Christian Solevågseide
>

-- 
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/c5863b80-60eb-465f-9b5c-ae7636d88c5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: slave 2.52, IBM JVM 1.8, Out of memory at end of build

2017-02-02 Thread Baptiste Mathus
Also, though it may or may not be related at all, you want to run an LTS
version.

Running an old weekly is not great because you might have chosen the wrong
one by chance (cannot check now).

IOW if you don't plan on upgrading like once a month or more, running a
weekly probably doesn't make sense.

My 2 cents

-- Baptiste

Le 1 févr. 2017 7:54 PM, "Mark Waite"  a écrit :

> I'd recommend that you use the Oracle JVM instead of the IBM JVM to run
> the agent ("slave").  It is deeply tested with Jenkins, and runs very well.
>
> If you need to run individual jobs with the IBM JVM on that agent, you can
> configure it as a JVM installation (or with a JVM automatic installer).
> That gives you the most tested environment (Oracle JVM) to run your agent,
> and still allows you to run jobs using either the Oracle JVM or the IBM JVM.
>
> Mark Waite
>
> On Wed, Feb 1, 2017 at 4:25 PM Mikhail Ramendik  wrote:
>
>> Hello,
>>
>> I am getting an out of memory error at the end of a build. I have changed
>> the build itself to "echo hello world" and I still get the out of memory
>> error.
>>
>> This seems to be connected with the slave host using IBM JVM 1.8
>> (64-bit), as when the Oracle JVM was used this did not happen.
>>
>> The slave is started using the command: javaws http://jenkins.host:8080/
>> computer/node_name/slave-agent.jnlp
>>
>> The version of the slave is 2.52, according to the manifest file in
>> slave.jar. The version of Jenkins is 1.632.
>>
>> I would appreciate advice about fixing this. The details of the error
>> (fromthe console output as visible in Jenkins) follow.
>>
>> Yours, MIkhail Ramendik
>>
>> C:\Users\Administrator\SVT_UI_Auto>echo hello world
>> hello world
>>
>> C:\Users\Administrator\SVT_UI_Auto>exit 0
>> FATAL: Remote call on SVT_9_42_34_29_Windows_Node failedjava.io.IOException 
>> : Remote 
>> call on SVT_9_42_34_29_Windows_Node failed
>>  at hudson.remoting.Channel.call(Channel.java:786) 
>> 
>>  at hudson.Launcher$RemoteLauncher.kill(Launcher.java:954) 
>> 
>>  at 
>> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:543)
>>  
>> 
>>  at hudson.model.Run.execute(Run.java:1741) 
>> 
>>  at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 
>> 
>>  at hudson.model.ResourceController.execute(ResourceController.java:98) 
>> 
>>  at hudson.model.Executor.run(Executor.java:408) 
>> 
>> Caused by: java.lang.OutOfMemoryError 
>> : 
>> Java heap space
>>  at java.lang.String.(String.java:388) 
>> 
>>  at java.lang.String.substring(String.java:1372) 
>> 
>>  at 
>> org.jvnet.winp.WinProcess.parseCmdLineAndEnvVars(WinProcess.java:144) 
>> 
>>  at 
>> org.jvnet.winp.WinProcess.getEnvironmentVariables(WinProcess.java:121) 
>> 
>>  at 
>> hudson.util.ProcessTree$Windows$1.getEnvironmentVariables(ProcessTree.java:452)
>>  
>> 
>>  at 
>> hudson.util.ProcessTree$OSProcess.hasMatchingEnvVars(ProcessTree.java:276) 
>> 
>>  at hudson.util.ProcessTree$Windows.killAll(ProcessTree.java:478) 
>> 
>>  at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:966) 
>> 
>>  at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:957) 
>> 
>>  at hudson.remoting.UserR

No signature of method: static io.fabric8.kubernetes.pipeline.Kubernetes.withPrivileged() is applicable

2017-02-02 Thread kurrent93
Hello

I'm not sure if this is the right forum. Apologizes if this is the wrong 
place.

I have described the issue on 
https://github.com/fabric8io/fabric8-pipeline-library/issues/69, but I dont 
know exactly where is best to report this issue. 

Can anyone tell me how I can run the following code in a jenkinsfile?

  kubernetes.pod('buildpod')
   .withImage('/my/jhipster-build')
   .withPrivileged(true)
  .withHostPathMount('/var/run/docker.sock','/var/run/docker.sock')
  .withEnvVar('DOCKER_CONFIG','/home/jenkins/.docker/')
  .withSecret('jenkins-docker-cfg','/home/jenkins/.docker')
  .withSecret('jenkins-maven-settings','/root/.m2')
  .withServiceAccount('jenkins')
  .inside {



Thank you and regards
Anton



-- 
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/10e835cc-5195-4741-9308-f81d46098c88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.