Jenkins offlines cloud build slave with running jobs?

2020-06-29 Thread ZillaYT
I'm using v2.0.2 of https://github.com/jenkinsci/ec2-fleet-plugin

I created spot fleets in AWS to use as Jenkins build slaves, and then in 
Jenkins configuration, I added an "Amazon EC2 Fleet" to use those build 
slaves. I set the "Max Idle Minutes Before Scaledown" to 60 mins, and 
expect that Jenkins to ONLY offline a build slave if no job was running on 
it for the last 60 mins. However, Jenkins still does offline them. Any fix?

-- 
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/84c079c6-7808-44c1-a9c8-388276c5072eo%40googlegroups.com.


Re: In a pipeline, how to check if a Jenkins item is a folder?

2019-10-17 Thread ZillaYT
Or, if it's any easier, how can I get a list of folders in a Jenkins 
pipeline?

On Thursday, October 17, 2019 at 2:45:58 PM UTC-4, ZillaYT wrote:
>
> I have the following function defined in a pipeline.
>
> private boolean isFolder(Item j) {
>   return j.getClass().getName() == 
> "com.cloudbees.hudson.plugins.folder.Folder"  
> }
>
>
> When I run it, I get
>
> an exception which occurred: in field 
> com.cloudbees.groovy.cps.impl.BlockScopeEnv.locals in object 
> com.cloudbees.groovy.cps.impl.BlockScopeEnv@ad9ba3c in field 
> com.cloudbees.groovy.cps.impl.CpsClosureDef.capture in object 
> com.cloudbees.groovy.cps.impl.CpsClosureDef@a44ee1a in field 
> com.cloudbees.groovy.cps.impl.CpsClosure.def in object 
> org.jenkinsci.plugins.workflow.cps.CpsClosure2@13b12418 in field 
> org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.closures in object 
> org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@554cc3b1 in object 
> org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@554cc3b1 Caused: 
> java.io.NotSerializableException: com.cloudbees.hudson.plugins.folder.Folder 
> at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:926)
>  at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:568)
>  at 
> org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
>  at 
> org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
>  at 
> org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
>  at 
> org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
>  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344) at 
> java.util.HashMap.internalWriteEntries(HashMap.java:1793) at 
> java.util.HashMap.writeObject(HashMap.java:1363) at 
> sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source) at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498) at 
> org.jboss.marshalling.reflect.JDKSpecific$SerMethods.callWriteObject(JDKSpecific.java:156)
>  at 
> org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:191)
>  at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1028)
>  at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:920)
>  at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1082)
>  at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1040)
>  at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:920)
>  at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1082)
>  at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1040)
>  at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:920)
>  at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1082)
>  at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1040)
>  at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1019)
>  at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:920)
>  at 
> org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
>  at 
> org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
>  at 
> org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
>  at 
> org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
>  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344) at 
> java.util.HashMap.internalWriteEntries(HashMap.java:1793) at 
> java.util.HashMap.writeObject(HashMap.java:1363) at 
> sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source) at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498) at 
> org.jboss.marshalling.reflect.JDKSpecific$SerMethods.callWriteObject(JDKSpecific.java:156)
>  at 
> org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:191)
>  at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1028)
>  at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:920)
>  at 
> or

In a pipeline, how to check if a Jenkins item is a folder?

2019-10-17 Thread ZillaYT
I have the following function defined in a pipeline.

private boolean isFolder(Item j) {
  return j.getClass().getName() == 
"com.cloudbees.hudson.plugins.folder.Folder"  
}


When I run it, I get

an exception which occurred: in field 
com.cloudbees.groovy.cps.impl.BlockScopeEnv.locals in object 
com.cloudbees.groovy.cps.impl.BlockScopeEnv@ad9ba3c in field 
com.cloudbees.groovy.cps.impl.CpsClosureDef.capture in object 
com.cloudbees.groovy.cps.impl.CpsClosureDef@a44ee1a in field 
com.cloudbees.groovy.cps.impl.CpsClosure.def in object 
org.jenkinsci.plugins.workflow.cps.CpsClosure2@13b12418 in field 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.closures in object 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@554cc3b1 in object 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@554cc3b1 Caused: 
java.io.NotSerializableException: com.cloudbees.hudson.plugins.folder.Folder at 
org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:926)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:568)
 at 
org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
 at 
org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
 at 
org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
 at 
org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
 at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344) at 
java.util.HashMap.internalWriteEntries(HashMap.java:1793) at 
java.util.HashMap.writeObject(HashMap.java:1363) at 
sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source) at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498) at 
org.jboss.marshalling.reflect.JDKSpecific$SerMethods.callWriteObject(JDKSpecific.java:156)
 at 
org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:191)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1028)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:920)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1082)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1040)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:920)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1082)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1040)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:920)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1082)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1040)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1019)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:920)
 at 
org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
 at 
org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
 at 
org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
 at 
org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
 at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344) at 
java.util.HashMap.internalWriteEntries(HashMap.java:1793) at 
java.util.HashMap.writeObject(HashMap.java:1363) at 
sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source) at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498) at 
org.jboss.marshalling.reflect.JDKSpecific$SerMethods.callWriteObject(JDKSpecific.java:156)
 at 
org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:191)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1028)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:920)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1082)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1040)
 at 
org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:920)
 at 
org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58)
 at 
org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111)
 at 
org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverWriter.lambda$writeObject$0(RiverWriter.java:144)
 at 

Re: Clean useless files and directories

2019-10-03 Thread ZillaYT
You mean multi-branch "pipeline" jobs? In the job config page, Orphaned 
Strategy section, you check the "Discard old items" check box.

On Monday, September 30, 2019 at 11:18:13 AM UTC-4, Peter Flanagan wrote:
>
> Hello,
> working on Jenkins 2.150 hosted on on AWS-EC2, jenkins_home dir is located 
> on an EFS
>
> The space of some Jenkins instances increase dramatically due to folder 
> not removed automatically by internal Jenkins storage management.
>
> Using multi-branch jobs I got 2 major issues:
> - some branches directories stay on file system despite the branches does 
> not exist anymore on GUI
> - some workspace__* directories stay also on FS despite the build 
> workspace always linked to the last waorkspace (without __ suffix)
>
> I'm wondering how to clean these two useless (according to me) directories 
> properly.
>
> Thanks very much for your help  
>

-- 
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/f822f0aa-f1bd-4701-a696-9680cce90798%40googlegroups.com.


Re: Ansible Playbook using Jenkins

2019-10-03 Thread ZillaYT
There's a nice Ansible plugin for Jenkins

On Tuesday, September 24, 2019 at 9:32:02 AM UTC-4, Vikrant Kaushik wrote:
>
> Hi All,
>
> Can anybody advise how to run Ansible playbook using Jenkins if we have 
> any relevant link available?
>
> regards
>
> Vikrant
>

-- 
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/c26ad885-5e99-46ba-8ea4-64322ba65c28%40googlegroups.com.


Re: 'Include' a shared library pipeline in other pipelines in the same shared library

2019-10-03 Thread ZillaYT
I'm guessing you've looked at this already 
https://jenkins.io/blog/2017/10/02/pipeline-templates-with-shared-libraries/
 

On Monday, September 30, 2019 at 3:35:30 AM UTC-4, Kaliyug Antagonist wrote:
>
> I have several microservices which use the same pipeline from a shared 
> library  which is 
> named *jenkins-shared-pipelines* . The Jenkinsfile for a microservice is 
> as follows:
>
> @Library(['jenkins-shared-pipelines']) _
>
> gradleProjectPrPipeline([buildAgent: 'oc-docker-jdk11', 
> disableIntegrationTestStage: true])
>
> In jenkins-shared-pipelines/vars, the gradleProjectBranchWrapper has the 
> following stages:
>
> /**
>  * gradleProjectPrPipeline is a generic pipeline
>  * @param pipelineProperties map used to pass parameters
>  * @return
>  */
> void call(Map pipelineProperties = [:]) {
> .
> .
> .
>
> pipeline {
> agent {
> node {
> label "${pipelineProperties.buildAgent}"
> }
> }
>
> options {
> skipDefaultCheckout true
> timeout(time: 1, unit: 'HOURS')
> buildDiscarder(logRotator(
> numToKeepStr: '5',
> daysToKeepStr: '7',
> artifactNumToKeepStr: '1',
> artifactDaysToKeepStr: '7'
> ))
> }
>
> stages {
> stage('Clone') {
> steps {
> //clone step
> }
> }
> stage('Compile') {
> steps {
> script {
>/*Some custom logic*/
> }
> runGradleTask([task: 'assemble',
>rawArgs: defaultGradleArgs + " 
> -Pcurrent_version=${releaseTag}"
> ])
> }
> }
> stage('Tests') {
> parallel {
> stage('Unit tests') {
> steps {
> //Unit tests
> }
> }
> stage('Integration tests') {
> steps {
> //Integration tests
> }
> }
> }
> }
> stage('Sonar scan') {
> steps {
> //Sonar scanning
> }
> }
> }
>
> post {
>
> unsuccessful {
> script {
> bitbucketHandler.notifyBuildFail([
> displayName: pipelineName,
> displayMessage: "Build ${env.BUILD_ID} failed at 
> ${env.BUILD_TIMESTAMP}."
> ])
> }
> }
> success {
> script {
> bitbucketHandler.notifyBuildSuccess([
> displayName: pipelineName,
> displayMessage: "Build ${env.BUILD_ID} completed at 
> ${env.BUILD_TIMESTAMP}."
> ])
> }
> }
> }
> }
> }
>
> Now, there will be several more pipelines in 
> jenkins-shared-pipelines(under the same vars directory) e.g: awsPipeline, 
> azurePipeline and so on which will also incorporate the deployment stages. 
> These pipelines will require all the stages in the above 
> gradleProjectBranchWrapper and will also add a few of their own stages. 
> Currently, we simply copy-paste these stages in the new pipelines, then, we 
> invoke these new pipelines from the microservices, so for example:
>
> @Library(['jenkins-shared-pipelines']) _
>
> awsPipeline([buildAgent: 'oc-docker-jdk11', disableIntegrationTestStage: 
> true])
>
> I was wondering if there is a way to include the 
> gradleProjectBranchWrapper in the pipelines like awsPipeline, azurePipeline 
> and so on. Note: There is a post block in the gradleProjectBranchWrapper, 
> the other pipelines may have their own post blocks
>

-- 
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/91afcbdf-0f44-420b-9152-19d2bc012937%40googlegroups.com.


Re: Triggering multi Pipeline Job after other multi job is executed

2019-10-03 Thread ZillaYT
That's how you do it.

On Thursday, October 3, 2019 at 6:46:52 AM UTC-4, Ramesh R wrote:
>
> Hi All,
>
> Please help me with this Problem.
>
> I want to RUN or Build Project B after Project A is Build or Stable.
>
> In Freestyle project we have option to Build after other projects are 
> built in Build Triggers.
>
> In Multi pipeline job, under Branch View configuration we have same 
> options, But no Save or Apply button.
>
> Is there any way to do it? or add Triggers in Jenkinsfile.
>
> Kindly let me know.
>
> Thanks,
> Ramesh
>

-- 
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/90ddb3f3-9605-48cb-8b1d-82ec6c17c788%40googlegroups.com.


Sharing code via shared library?

2019-10-03 Thread ZillaYT
I posted In a Jenkins shared library infrastructure, how do I import class 
in another file? 

 in 
Stackoverflow. Anyone here know if what I want to achieve is possible? If 
so how?

Thanks,
Chris

-- 
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/61a29be1-5e3f-4850-ae43-0e5dc5c343c5%40googlegroups.com.


Re: Why does somestring.digest('SHA-1') fail in pipeline

2019-05-01 Thread ZillaYT
Jenkins pipeline has been working for us so far, except for these little 
gotchas.

Thanks!

On Wednesday, May 1, 2019 at 1:55:16 PM UTC-4, Daniel Beck wrote:
>
>
>
> > On 1. May 2019, at 02:11, Slide > 
> wrote: 
> > 
> > I don't know what version pipeline is using right now. 
>
> We're on 2.4.x. 
>
> And as usual, don't (ab)use pipeline as a general purpose programming 
> environment. It's not intended to be, never 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/49eb9169-9995-45ce-a844-66e2f08ce5e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Why does somestring.digest('SHA-1') fail in pipeline

2019-04-30 Thread ZillaYT
I have this simple code and it works on my Macs groovy

String sigStr = 'iurpeirupru04790734'
sigStr = sigStr.digest('SHA-1')
println sigStr

But I get this error when I run it in a Jenkins pipeline. Why? Thanks!

hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No 
signature of method: java.lang.String.digest() is applicable for argument 
types: (java.lang.String) values: [SHA-1] Possible solutions: getAt(java.
lang.String), size(), toSet(), size(), next(), toList()
 at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(
ScriptBytecodeAdapter.java:58)
 at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(
PojoMetaClassSite.java:49)
 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:20)
 at WorkflowScript.run(WorkflowScript:6)
 at ___cps.transform___(Native Method)
 at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(
ContinuationGroup.java:57)
 at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.
dispatchOrArg(FunctionCallBlock.java:109)
 at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(
FunctionCallBlock.java:82)
 at sun.reflect.GeneratedMethodAccessor372.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(
ContinuationPtr.java:72)
 at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
 at com.cloudbees.groovy.cps.Next.step(Next.java:83)
 at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
 at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
 at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use
(GroovyCategorySupport.java:122)
 at org.codehaus.groovy.runtime.GroovyCategorySupport.use(
GroovyCategorySupport.java:261)
 at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
 at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java
:174)
 at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.
java:332)
 at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(
CpsThreadGroup.java:83)
 at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.
java:244)
 at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.
java:232)
 at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(
CpsVmExecutorService.java:64)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at hudson.remoting.SingleLaneExecutorService$1.run(
SingleLaneExecutorService.java:131)
 at jenkins.util.ContextResettingExecutorService$1.run(
ContextResettingExecutorService.java:28)
 at jenkins.security.ImpersonatingExecutorService$1.run(
ImpersonatingExecutorService.java:59)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1149)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.
java:624)
 at java.lang.Thread.run(Thread.java:748)
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/86563179-18e2-4dd7-afeb-5859e1ecb7da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use cached Docker images in a Jenkins slave?

2019-04-16 Thread ZillaYT
Yeah we build our own AMIs via Packer. I'll looking into pulling the images 
into it. Thanks.

Chris

On Tuesday, April 16, 2019 at 11:30:11 AM UTC-4, kuisathaverat wrote:
>
> You do not need to change anything there, you would need custom ECS AMIs 
> where you have pre-pull the Docker images that you will need, see 
> https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html
>
> El mar., 16 abr. 2019 a las 17:14, ZillaYT ( >) escribió:
>
>> So what values do you put in your cloud section of you Jenkins config 
>> page for the 'Task definition' and 'Docker image' fields?
>>
>> [image: Screen Shot 2019-04-16 at 11.05.13 AM.png]
>>
>>
>>
>>
>> On Friday, April 5, 2019 at 2:21:10 PM UTC-4, Ivan Fernandez Calvo wrote:
>>>
>>> We have a similar problem, to make a local cache of those images we pull 
>>> then when we build packer images (once a day) so when we spin our VMs they 
>>> have those Docker images and don't have to pull them from any repository. 
>>> The only disadvantage of that it is you need extra disk space. In your 
>>> case, you can do the same if you build your own AMIs
>>>
>>> El viernes, 5 de abril de 2019, 16:59:22 (UTC+2), ZillaYT escribió:
>>>>
>>>> We have a number of EC2 instances that we create in our AWS ECS 
>>>> cluster, which run Docker. One of the EC2 instances run the Jenkins 
>>>> master, 
>>>> and the others are designated as slaves.
>>>>
>>>> So what we do is for every job, we run a Docker container in one of 
>>>> these slave EC2 instances. We set up, in the Cloud portion of Jenkins 
>>>> configuration page, a label called 'linux-fargate' that has the task 
>>>> definition and the Docker image that we want to run.
>>>>
>>>> All is working well, that is, we are able to run a Docker container for 
>>>> each job using the task definition and Docker image we set up in the 
>>>> configuration page.
>>>>
>>>> However, we pull the image from our ECR repo "every time" and this 
>>>> takes a long time. How can we tell Jenkins to use the image that's already 
>>>> on the EC2 instance instead of pulling the image every time?
>>>>
>>>> Thanks,
>>>> Chris
>>>>
>>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Jenkins Users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/jenkinsci-users/SVfcJO7KB-g/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to 
>> jenkins...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/502186ce-4ddf-402e-9a64-13e28ee29612%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/502186ce-4ddf-402e-9a64-13e28ee29612%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Un Saludo
> Iván Fernández Calvo
> https://www.linkedin.com/in/iv%C3%A1n-fern%C3%A1ndez-calvo-21425033
>

-- 
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/dc2f2266-7373-4955-bd03-da63f44e4494%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use cached Docker images in a Jenkins slave?

2019-04-16 Thread ZillaYT
So what values do you put in your cloud section of you Jenkins config page 
for the 'Task definition' and 'Docker image' fields?

[image: Screen Shot 2019-04-16 at 11.05.13 AM.png]




On Friday, April 5, 2019 at 2:21:10 PM UTC-4, Ivan Fernandez Calvo wrote:
>
> We have a similar problem, to make a local cache of those images we pull 
> then when we build packer images (once a day) so when we spin our VMs they 
> have those Docker images and don't have to pull them from any repository. 
> The only disadvantage of that it is you need extra disk space. In your 
> case, you can do the same if you build your own AMIs
>
> El viernes, 5 de abril de 2019, 16:59:22 (UTC+2), ZillaYT escribió:
>>
>> We have a number of EC2 instances that we create in our AWS ECS cluster, 
>> which run Docker. One of the EC2 instances run the Jenkins master, and the 
>> others are designated as slaves.
>>
>> So what we do is for every job, we run a Docker container in one of these 
>> slave EC2 instances. We set up, in the Cloud portion of Jenkins 
>> configuration page, a label called 'linux-fargate' that has the task 
>> definition and the Docker image that we want to run.
>>
>> All is working well, that is, we are able to run a Docker container for 
>> each job using the task definition and Docker image we set up in the 
>> configuration page.
>>
>> However, we pull the image from our ECR repo "every time" and this takes 
>> a long time. How can we tell Jenkins to use the image that's already on the 
>> EC2 instance instead of pulling the image every time?
>>
>> Thanks,
>> Chris
>>
>

-- 
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/502186ce-4ddf-402e-9a64-13e28ee29612%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to pass one of the jobs output value to the next job input in pipeline script

2019-04-16 Thread ZillaYT
Say you want JobA to trigger JobB

On JobA's pipeline code do

build job: JobB, parameters: [string(name: 'PARAMETER_NAME', value: 
'PARAMETER_VALUE')], wait: false

The 'wait' parameter indicates if you want JobB to finish before JobA does 
(true), or JobA to finish even before JobB does (false).


Jenkins has built-in environment variables that you can pass around between 
jobs, or you can pass any of JobA's variables to JobB.


Chris

On Tuesday, April 16, 2019 at 4:18:52 AM UTC-4, pbasan...@gmail.com wrote:
>
> Hi All,
>
> I have a pipeline script job and is triggering Jobs.
> The requirement here is to pass one of the jobs output value to the next 
> job .
>
> 1.How to get the value from job to the Pipeline job.
> 2.From Pipeline how to pass that values to the next job.
>
> Regards,
> Basanta
>

-- 
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/0d834541-268f-4efb-8d27-6fa4dbabca81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to refer to the private key generated by sshagent plugin?

2019-04-05 Thread ZillaYT
I have no solution. I saw your post that reference this one so hopefully 
someone will answer yours.

On Thursday, April 4, 2019 at 1:26:33 PM UTC-4, Edwin Makiuchi wrote:
>
> Hi ZillaYT,
>
> Can you let me know if you found a solution to this issue?
>
> Thanks,
> Edwin
>
> On Friday, February 15, 2019 at 11:14:46 AM UTC-8, ZillaYT wrote:
>>
>> I want to run a packer build in my Jenkins pipeline to create an AWS AMI. 
>> Packer needs an ssh key to connect to AWS, but we don't store the private 
>> key in our ephemeral Jenkins slaves that run in a Docker container. I 
>> therefore was thinking of using the sshagent plugin, and want to do this
>>
>> sshagent(credentials: "some-creds") {
>>   export SSH_KEY="/path_to_ssh_private_key"
>>   packer build create-ami.json
>> }
>>
>> Where the create-ami.json Packer file uses the SSH_KEY variable to set 
>> the ssh key.
>>
>> I see this in the Jenkins console output
>>
>> [Pipeline] sshagent[ssh-agent] Using credentials some-creds (Bitbucket 
>> credentials)
>> [ssh-agent] Looking for ssh-agent implementation...
>> [ssh-agent]   Exec ssh-agent (binary ssh-agent on a remote machine)
>> $ ssh-agent
>> SSH_AUTH_SOCK=/tmp/ssh-rTJZhA9qNK6L/agent.206
>> SSH_AGENT_PID=208
>> Running ssh-add (command line suppressed)
>> Identity added: 
>> /home/jenkins/workspace/Utilities/test-packer@tmp/private_key_614590059258028269.key
>>  
>> (/home/jenkins/workspace/Utilities/test-packer@tmp/private_key_614590059258028269.key)
>> [ssh-agent] Started.[Pipeline] {[Pipeline] sh[test-packer] Running shell 
>> script
>> $ ssh-agent -k
>> unset SSH_AUTH_SOCK;
>> unset SSH_AGENT_PID;
>> echo Agent pid 208 killed;
>> [ssh-agent] Stopped.
>>
>>
>> But when I try to use 
>>
>>
>> export SSH_KEY=$WORKSPACE/test-packer@tmp/private_key_614590059258028269.key
>>
>>
>> the file isn NOT there, that is, packer can't connect via ssh. I run the 
>> same Packer file on my Mac locally and it works.
>>
>>
>> How can I make this work in a Pipeline 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/ee73a227-79e1-4e01-9890-d85b6d28f15a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to use cached Docker images in a Jenkins slave?

2019-04-05 Thread ZillaYT
We have a number of EC2 instances that we create in our AWS ECS cluster, 
which run Docker. One of the EC2 instances run the Jenkins master, and the 
others are designated as slaves.

So what we do is for every job, we run a Docker container in one of these 
slave EC2 instances. We set up, in the Cloud portion of Jenkins 
configuration page, a label called 'linux-fargate' that has the task 
definition and the Docker image that we want to run.

All is working well, that is, we are able to run a Docker container for 
each job using the task definition and Docker image we set up in the 
configuration page.

However, we pull the image from our ECR repo "every time" and this takes a 
long time. How can we tell Jenkins to use the image that's already on the 
EC2 instance instead of pulling the image every time?

Thanks,
Chris

-- 
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/74a3286e-2f7b-47a0-b360-7055716cbdc2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help with cfnValidate() error in pipeline?

2019-04-02 Thread ZillaYT
I wanted to add, if I validate the file via AWS CLI (aws cloudformation 
validate-template --document file://my_template.yaml) it passes.

On Tuesday, April 2, 2019 at 7:51:48 PM UTC-4, ZillaYT wrote:
>
> We use Jenkins pipeline, and use AWS plugins that has a cfnValidate() API 
> https://jenkins.io/doc/pipeline/steps/pipeline-aws/. When I run it on my 
> Cloudformation template,
>
> AWSTemplateFormatVersion: '2010-09-09'
> Parameters: 
>   AlbName: 
> Type: String 
> Description: 'Parameter to override ALB name' 
> Default: '' 
>   RedirectUrl: 
> Type: String 
> Description: 'URL to redirect traffic to' 
> Default: '' 
>   SslCertificateArn: 
> Type: String 
> Description: 'SSL certificate ARN' 
> Default: '' 
>   VPCStackNameParameter: 
> Type: String 
> Description: 'CloudFormation stack name of the VPC' 
> Default: 'ProductionVPC' 
>
> Conditions: 
>   ProdEnvironment: 
> !Equals [ !Ref VPCStackNameParameter, 'ProductionVPC' ] 
>   CertExists: 
> !Not [!Equals [!Ref SslCertificateArn, ""]]
>
> Resources:
>   Alb:
> Type: AWS::ElasticLoadBalancingV2::LoadBalancer
> Condition: CertExists
> Properties:
>   Name: !Ref AlbName
>   Scheme: 'internet-facing'
>   IpAddressType: 'ipv4'
>   SecurityGroups:
> -
>   Fn::ImportValue:
> !Sub "${VPCStackNameParameter}-ELBSGID"
>   Subnets:
> -
>   Fn::ImportValue:
> !Sub "${VPCStackNameParameter}-SubnetPublic1ID"
> -
>   Fn::ImportValue:
> !Sub "${VPCStackNameParameter}-SubnetPublic2ID"
>
>   LoadBalancerAttributes:
> - Key: idle_timeout.timeout_seconds
>   Value: '240'
>   Tags:
> -
>   Key: Name
>   Value: !Sub "${AWS::StackName}-lb"
> -
>   Key: Product
>   Value: "Zift"
>
>  
>
>
> I get
>
>
> com.amazonaws.services.cloudformation.model.AmazonCloudFormationException: 
> Template format error: Every Condition member must be a string. (Service: 
> AmazonCloudFormation; Status Code: 400; Error Code: ValidationError; Request 
> ID: f6f203b9-5593-11e9-833d-1d475e1ca17e) at 
> com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1632)
>  at 
> com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1304)
>  at 
> com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1058)
>  at 
> com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:743)
>  at 
> com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:717)
>  at 
> com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:699)
>  at 
> com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:667)
>  at 
> com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:649)
>  at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:513) at 
> com.amazonaws.services.cloudformation.AmazonCloudFormationClient.doInvoke(AmazonCloudFormationClient.java:2733)
>  at 
> com.amazonaws.services.cloudformation.AmazonCloudFormationClient.invoke(AmazonCloudFormationClient.java:2709)
>  at 
> com.amazonaws.services.cloudformation.AmazonCloudFormationClient.executeValidateTemplate(AmazonCloudFormationClient.java:2673)
>  at 
> com.amazonaws.services.cloudformation.AmazonCloudFormationClient.validateTemplate(AmazonCloudFormationClient.java:2648)
>  at 
> de.taimos.pipeline.aws.cloudformation.CFNValidateStep$Execution$1.run(CFNValidateStep.java:141)
>  Finished: FAILURE
>
>
>
>
> What gives?
>
>

-- 
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/e60876d0-b9ef-4360-b4b2-a80cfaec5a8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Help with cfnValidate() error in pipeline?

2019-04-02 Thread ZillaYT
We use Jenkins pipeline, and use AWS plugins that has a cfnValidate() API 
https://jenkins.io/doc/pipeline/steps/pipeline-aws/. When I run it on my 
Cloudformation template,

AWSTemplateFormatVersion: '2010-09-09'
Parameters: 
  AlbName: 
Type: String 
Description: 'Parameter to override ALB name' 
Default: '' 
  RedirectUrl: 
Type: String 
Description: 'URL to redirect traffic to' 
Default: '' 
  SslCertificateArn: 
Type: String 
Description: 'SSL certificate ARN' 
Default: '' 
  VPCStackNameParameter: 
Type: String 
Description: 'CloudFormation stack name of the VPC' 
Default: 'ProductionVPC' 

Conditions: 
  ProdEnvironment: 
!Equals [ !Ref VPCStackNameParameter, 'ProductionVPC' ] 
  CertExists: 
!Not [!Equals [!Ref SslCertificateArn, ""]]

Resources:
  Alb:
Type: AWS::ElasticLoadBalancingV2::LoadBalancer
Condition: CertExists
Properties:
  Name: !Ref AlbName
  Scheme: 'internet-facing'
  IpAddressType: 'ipv4'
  SecurityGroups:
-
  Fn::ImportValue:
!Sub "${VPCStackNameParameter}-ELBSGID"
  Subnets:
-
  Fn::ImportValue:
!Sub "${VPCStackNameParameter}-SubnetPublic1ID"
-
  Fn::ImportValue:
!Sub "${VPCStackNameParameter}-SubnetPublic2ID"

  LoadBalancerAttributes:
- Key: idle_timeout.timeout_seconds
  Value: '240'
  Tags:
-
  Key: Name
  Value: !Sub "${AWS::StackName}-lb"
-
  Key: Product
  Value: "Zift"

 


I get


com.amazonaws.services.cloudformation.model.AmazonCloudFormationException: 
Template format error: Every Condition member must be a string. (Service: 
AmazonCloudFormation; Status Code: 400; Error Code: ValidationError; Request 
ID: f6f203b9-5593-11e9-833d-1d475e1ca17e) at 
com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1632)
 at 
com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1304)
 at 
com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1058)
 at 
com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:743)
 at 
com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:717)
 at 
com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:699)
 at 
com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:667)
 at 
com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:649)
 at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:513) at 
com.amazonaws.services.cloudformation.AmazonCloudFormationClient.doInvoke(AmazonCloudFormationClient.java:2733)
 at 
com.amazonaws.services.cloudformation.AmazonCloudFormationClient.invoke(AmazonCloudFormationClient.java:2709)
 at 
com.amazonaws.services.cloudformation.AmazonCloudFormationClient.executeValidateTemplate(AmazonCloudFormationClient.java:2673)
 at 
com.amazonaws.services.cloudformation.AmazonCloudFormationClient.validateTemplate(AmazonCloudFormationClient.java:2648)
 at 
de.taimos.pipeline.aws.cloudformation.CFNValidateStep$Execution$1.run(CFNValidateStep.java:141)
 Finished: FAILURE




What gives?

-- 
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/1d2825fe-ca64-4678-b73f-d3781db63250%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Can a class inside a pipeline be a subclass of the Script object?

2019-02-22 Thread ZillaYT
I have a class, say

class Foo {
  def fooEcho()
echo "Hello Foo"
  }
}


but of course this fails if I

Foo foo = new Foo()
foo.fooEcho()



because the Foo class doesn't know about Script echo() function. The 
general workaround is to do

class Foo {
  Foo(Script s) {
this.script = s
  }
  def fooEcho() {
script.echo "Hello Foo"
  }
  def script = null
}

Foo foo = new Foo(this)
foo.fooEcho()

But this is ugly, and it means that I have to prepend ALL normal Script 
calls (echo, println, stage, etc.) with "script."

Can Foo be defined as

class Foo extends 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/632a36b4-7f37-409b-a37f-541124df2706%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Custom build number to child job (correlate parent build with Child build)

2019-02-22 Thread ZillaYT
Are you triggering the child job via pipeline?

On Friday, February 22, 2019 at 2:44:38 AM UTC-5, Bhanu Sahu wrote:
>
> Dear All,
>
> Problem statement:   I have created a parent job in Jenkins, on completion 
> of the parent job I am triggering the a child job, Parent job is deployment 
> job and child job is sanity job.  I want to correlate the parent job with 
> the child job. Sending  a parameter from the parent job is not solving the 
> problem.
>
> I want to control  the child build number from the parent job,  It means i 
> want to assign the custom build number to child build .
>
>
>
>
> How can we achieve this please advice.
>
> Thank you 
> Bhanu
>

-- 
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/39021a2d-727b-451d-8ac8-d3d50fe3e107%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Sharing files between slave/master in a pipeline

2019-02-15 Thread ZillaYT
I see lots of info on sharing files, but via the GUI. How can I do it in a 
pipeline script?

I want to create a properties file with one job. I then want another job to 
read this properties file, and yet another cron job to add/modify/delete 
entries in this file.

Why is this so difficult, or at least scarce info on it?

Chris

-- 
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/80a65c55-de80-44f0-90fe-2a37e303541d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: emailext and Declarative Pipeline; multiple "to"

2019-02-15 Thread ZillaYT
Here's another function, with multiple "to"

def sendApprovalTransitionEmail(deploymentEnv) {
emailext body: "This build is now 
paused and awaiting transition by QA. Click 
here ${env.BUILD_URL} to approve this builds deployment to $deploymentEnv.",
subject: "Build is paused - awaiting QA approval ($deploymentEnv)",
to: "$watchers,jenkins...@company.com" 
}


On Friday, February 15, 2019 at 2:53:41 PM UTC-5, Zach LaCelle wrote:
>
> For my "build failed" emails, I'd like to send an email from my Jenkins 
> Declarative Pipeline to the developers group but also to a fixed list of 
> recipients. Under the Pipeline documentation (
> https://jenkins.io/doc/pipeline/steps/email-ext/), I see a class for 
> "recipients", which states that it includes "recipients defined in the 
> "Project Recipient List.""
>
> My question is: how do I add a list of emails to the "Project Recipient 
> List"? Where is this list defined for Declarative pipelines? If I can add 
> to this list, then I think I can add something like: recipientProviders: 
> [[$class: 'DevelopersRecipientProvider'], [$class: 
> 'RecipientsRecipientProvider']]
>
> Or, if I can't do this, then I could also add a "to:" at the end of the 
> emailext declaration. How do I add multiple users to this entry? Are they 
> comma-separated, or semi-colon separated? Will they automatically have the 
> default domain added?
>

-- 
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/2e62e890-cb57-496c-9372-607b35c9bb57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: emailext and Declarative Pipeline; multiple "to"

2019-02-15 Thread ZillaYT
Here's a sample function we call in our pipeline

def processTestFailure() {
junit "**/build/test-results/**/*.xml" 
emailext body: "You broke the 
build It appears that ${env.BUILD_URL} tests 
are failing (${currentBuild.result}). Change sets:${changelist()}${testStatuses()}", recipientProviders: [[
$class: "FailingTestSuspectsRecipientProvider"], [$class: 
"FirstFailingBuildSuspectsRecipientProvider"], [$class: 
"CulpritsRecipientProvider"]], subject: "FAILING TEST - ${env.JOB_NAME} 
(${env.BUILD_NUMBER}) - ${currentBuild.result}" 
}


On Friday, February 15, 2019 at 2:53:41 PM UTC-5, Zach LaCelle wrote:
>
> For my "build failed" emails, I'd like to send an email from my Jenkins 
> Declarative Pipeline to the developers group but also to a fixed list of 
> recipients. Under the Pipeline documentation (
> https://jenkins.io/doc/pipeline/steps/email-ext/), I see a class for 
> "recipients", which states that it includes "recipients defined in the 
> "Project Recipient List.""
>
> My question is: how do I add a list of emails to the "Project Recipient 
> List"? Where is this list defined for Declarative pipelines? If I can add 
> to this list, then I think I can add something like: recipientProviders: 
> [[$class: 'DevelopersRecipientProvider'], [$class: 
> 'RecipientsRecipientProvider']]
>
> Or, if I can't do this, then I could also add a "to:" at the end of the 
> emailext declaration. How do I add multiple users to this entry? Are they 
> comma-separated, or semi-colon separated? Will they automatically have the 
> default domain added?
>

-- 
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/7397d337-2906-477c-b55a-56fc7b8186df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to create a persistent file with key/value pairs (properties) that other jobs can use?

2019-02-15 Thread ZillaYT
I found the Config File Provider 
<https://wiki.jenkins.io/display/JENKINS/Config+File+Provider+Plugin#space-menu-link-content>
 
Plugin that looks promising. However it doesn't tell you how to edit/modify 
the file? How do I edit it via pipeline?

On Friday, February 15, 2019 at 2:31:05 PM UTC-5, ZillaYT wrote:
>
> I'm working on a process where we create AWS artifacts (Fargate services) 
> needed on a per-feature basis. I want to be able to create these artifacts, 
> and then after a certain expiry period, delete them. So I want a job that 
> will create/modify a properties file that looks like this. As features are 
> added, I want to be able to add a line in the file.
>
> Branch   Created
> --
> feature-dev-1234-blah-blah . 2018-02-14
> feature-dev-2345-blah-blah . 2018-02-15
>
> Let's say the expiry period is 3 days.
>
> So I want a job that runs daily that will look at properties file created 
> above, and if expiry period is met, will delete the artifacts for that 
> feature. So on 2018-20-17, the feature-dev-1234-blah-blah artifacts will be 
> deleted, and on 2018-02-18, the feature-dev-2345-blah-blah artifacts will 
> be deleted. As artifacts are deleted, I'll need to modify the data and 
> remove the corresponding feature/date key/value pair from the data.
>
> What mechanism can I use to store this persistent data? I don't want to 
> use a DB since this will be overkill.
>
> Thanks!
> Chris
>

-- 
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/778cff96-35a4-4b05-ba71-c135af937b1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to create a persistent file with key/value pairs (properties) that other jobs can use?

2019-02-15 Thread ZillaYT
I'm working on a process where we create AWS artifacts (Fargate services) 
needed on a per-feature basis. I want to be able to create these artifacts, 
and then after a certain expiry period, delete them. So I want a job that 
will create/modify a properties file that looks like this. As features are 
added, I want to be able to add a line in the file.

Branch   Created
--
feature-dev-1234-blah-blah . 2018-02-14
feature-dev-2345-blah-blah . 2018-02-15

Let's say the expiry period is 3 days.

So I want a job that runs daily that will look at properties file created 
above, and if expiry period is met, will delete the artifacts for that 
feature. So on 2018-20-17, the feature-dev-1234-blah-blah artifacts will be 
deleted, and on 2018-02-18, the feature-dev-2345-blah-blah artifacts will 
be deleted. As artifacts are deleted, I'll need to modify the data and 
remove the corresponding feature/date key/value pair from the data.

What mechanism can I use to store this persistent data? I don't want to use 
a DB since this will be overkill.

Thanks!
Chris

-- 
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/6caa3b89-68da-43e7-8f90-9d70c80873c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to refer to the private key generated by sshagent plugin?

2019-02-15 Thread ZillaYT
I want to run a packer build in my Jenkins pipeline to create an AWS AMI. 
Packer needs an ssh key to connect to AWS, but we don't store the private 
key in our ephemeral Jenkins slaves that run in a Docker container. I 
therefore was thinking of using the sshagent plugin, and want to do this

sshagent(credentials: "some-creds") {
  export SSH_KEY="/path_to_ssh_private_key"
  packer build create-ami.json
}

Where the create-ami.json Packer file uses the SSH_KEY variable to set the 
ssh key.

I see this in the Jenkins console output

[Pipeline] sshagent[ssh-agent] Using credentials some-creds (Bitbucket 
credentials)
[ssh-agent] Looking for ssh-agent implementation...
[ssh-agent]   Exec ssh-agent (binary ssh-agent on a remote machine)
$ ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-rTJZhA9qNK6L/agent.206
SSH_AGENT_PID=208
Running ssh-add (command line suppressed)
Identity added: 
/home/jenkins/workspace/Utilities/test-packer@tmp/private_key_614590059258028269.key
 
(/home/jenkins/workspace/Utilities/test-packer@tmp/private_key_614590059258028269.key)
[ssh-agent] Started.[Pipeline] {[Pipeline] sh[test-packer] Running shell script
$ ssh-agent -k
unset SSH_AUTH_SOCK;
unset SSH_AGENT_PID;
echo Agent pid 208 killed;
[ssh-agent] Stopped.


But when I try to use 


export SSH_KEY=$WORKSPACE/test-packer@tmp/private_key_614590059258028269.key


the file isn NOT there, that is, packer can't connect via ssh. I run the same 
Packer file on my Mac locally and it works.


How can I make this work in a Pipeline 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/00077961-036b-4385-be90-746997f237f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to Copy/Clone a Job via Groovy

2019-02-14 Thread ZillaYT
How do I use this to copy a job in a folder to another job in the same 
folder?

On Wednesday, November 23, 2011 at 11:59:14 AM UTC-5, domi wrote:
>
> Manuel, thats a cool idea - I would not have thought about this! :)
> btw. If you use the scriptler plugin [1], you get even around the copy 
> paste of groovy scripts
> /Domi
>
> [1] https://wiki.jenkins-ci.org/display/JENKINS/Scriptler+Plugin
>
> On 23.11.2011, at 16:17, Manuel Doninger wrote:
>
> > I wrote a small blog post about writing Groovy scripts for Jenkins:
> > 
> http://blog.doninger.net/2011/11/write-groovy-scripts-for-jenkins-with.html
> > This way you can use Eclipse with all code completion and Javadoc
> > features. For me this is a great help with writing scripts.
> > Executing the scripts of course won't work. However i thought about
> > writing an Eclipse plugin, which sends the script to the Jenkins
> > instance through the api. Don't know if that would work.
> > 
> > Manuel
> > 
> > On Wed, Nov 23, 2011 at 13:59, grayaii > 
> wrote:
> >> Hi Simon.  That is fricken awesome.  Way cleaner than the way I was 
> doing it.
> >> I'm still on the Jenkins learning curve, but it's not as hard as I 
> thought
> >> it would be and your link will definitely help out.
> >> Thanks!
> >> 
> >> --
> >> View this message in context: 
> http://jenkins.361315.n4.nabble.com/How-to-Copy-Clone-a-Job-via-Groovy-tp4097412p4099475.html
> >> Sent from the Jenkins users mailing list archive at Nabble.com.
> >> 
>
>

-- 
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/14a853b3-3a33-4783-a80e-d735a12ae0d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Help with using the scripts int he vars directory of shared libraries

2019-02-11 Thread ZillaYT
I'm writing share libraries by following Extending with Shared Libraries 
, and I have a 
simple example working.

I now have created a script in the vars directory called debugger.groovy, 
that has a class definition, like this

class MyDebugger {
  def logError(String msg) {
 log("ERROR", msg)
  }
  ...
  private def log(String msgType, String msg) {
String m = "$msgType: $msg" 
  }
}

MyDebugger getDebuggerObj() {
  return (new MyDebugger)
}


Now I have a script in my src/com/company directory called Deployer.groovy, 
and I want to use above MyDebugger like this because I want to use the same 
MyDebugger object all throughout my script.

package com.company.deployment

class MyDeployer {
  def dbgObj = debugger.getDebuggerObj()
}

def deploy() {
  Deployer d = new MyDeployer()
}


When I run it in my Jenkins pipeline, like this

pipeline {
  agent { label 'linux-devops' }
  stages {
stage('build') {
  steps {
script {
  // This is the Library configured in Jenkins main configuratin 
page
  @Library('my-library')
  def deployer = new com.zift.deployment.Deployer()
  deployer.deploy()
}
  }
}
  }




But I get

infrastructure/src/com/zift/deployment/EcsClusterBuilder.groovy: 9: Apparent 
variable 'debugger' was found in a static scope but doesn't refer to a local 
variable, static field or class. Possible causes: You attempted to reference a 
variable in the binding or an instance variable from a static context. You 
misspelled a classname or statically imported field. Please check the spelling. 
You attempted to use a method 'debugger' but left out brackets in a place not 
allowed by the grammar. 

 What's a better approach? I still want to keep the degugger.groovy 
structure, but am flexible on the Deployer.groovy script.

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/a2238ee5-12ff-4134-b62f-637ee6f72054%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Parameterized option in multibranch pipeline job

2018-12-23 Thread ZillaYT
Is there a fix for the disappearing "Build with parameters" link on a 
multi-branch pipeline? In my case, when a job fails, I see the link but 
when a job succeeds, the link disappears.

On Monday, July 3, 2017 at 2:26:13 PM UTC-4, Ajith David wrote:
>
> Okay, so I have to run the first build without parameter. 
>
> Is there any option to trigger the build without parameter at branch 
> initialization alone? I have set suppress automatic scm trigger in my 
> multibranch pipeline settings for all branches. So it doesn't trigger the 
> build for branch creation too. 
>
> If it allows to build at branch initialization alone, then I can trigger 
> further builds with parameters from webhook. 
>
> On Jul 3, 2017 11:13 PM, "Lee Meador" > 
> wrote:
>
>> Yep. That's how it works. Remember, the script can't set anything before 
>> it runs. When it runs, it builds. That's why lines of code in the script 
>> have no effect before you do a build. And changes to a script have no 
>> effect before you build. The effect of a properties statement is to change 
>> the build settings including some in the UI.
>>
>> On Mon, Jul 3, 2017 at 11:40 AM, ajith arthur > > wrote:
>>
>>> Thanks for the reply. I know, I already configured the parameters via 
>>> properties of jenkinsfile. The problem is, its not get parameterized for 
>>> the very first build. I suppress all branch scm trigger and I am manually 
>>> triggering the builds from webhook, so I can't pass the first build with 
>>> parameters. Once first build triggered without parameter, it can be 
>>> parameterized from the second build. 
>>>
>>> On Sunday, July 2, 2017 at 8:04:47 PM UTC+5:30, colourmeamused wrote:

 I am not sure I quire understand but:

 If you want to add new parameters you *have* to do it using 
 *properties* in Jenkinsfile - goto /pipeline-syntax and 
 generate code for the properties step.

 how to configure parameterized option in Jenkins multibranch pipeline 
 project from website

 You cannot. If you are using Jenkinsfile and multibranch pipeline you 
 have to set *all *properties including parameters in the Jenkinsfile 
 using the *properties* step. I think by *website* you mean the 
 configuration page at /configure. For multibranch pipelines, this 
 page is effectively *read only. *Unfortunately this isn't very clear 
 from the UI.

 If it's just a matter of adding parameters, just use the syntax 
 generator and copy the code into your Jenkinsfile.


 






 On Saturday, June 24, 2017 at 12:22:22 PM UTC+10, ajith arthur wrote:
>
> Hi Guys,
>
>  
>
> I have a Jenkins multibranch pipeline job, which always configure 
> build without parameter at branch initialization, but I need to configure 
> the branches as build with parameter.
>
>  
>
> We can use *properties* to configure the parameters in a Jenkinsfile, 
> but my question is how to configure parameterized option in Jenkins 
> multibranch pipeline project from website, not from Jenkinsfile?
>
>  
>
> Please refer the below report for further details.
>
>  
>
> https://issues.jenkins-ci.org/browse/JENKINS-45102
>
>  
>
> Regards,
>
> Ajith R
>
 -- 
>>> 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/57761515-0f7d-40d5-9387-a509be3e146d%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> -- Lee Meador
>> Sent from gmail. My real email address is lee AT leemeador.com
>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Jenkins Users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/jenkinsci-users/XqaCMb4Hjyk/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to 
>> jenkinsci-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/CAA4vtDRYmmv8cAJ8g%3DHStCFHtwtTTEUXX3m3k4C%3DuxUCqVpEoQ%40mail.gmail.com
>>  
>> 
>> .
>> For more options, visit 

Re: How to use folder properties?

2018-11-26 Thread ZillaYT
RTFM: https://wiki.jenkins.io/display/JENKINS/Folder+Properties+Plugin

Had to use in my Jenkinsfile
withFolderProperties {
projectName = env.PROJECT_NAME
}

On Monday, November 26, 2018 at 10:32:10 AM UTC-5, ZillaYT wrote:
>
> I wanted to clarify that I created a folder, and then jobs inside the 
> folder. I then configured the folder to have properties (e.g., 
> PROJECT_NAME) that I'm trying to use in the jobs inside the folder.
>
> On Monday, November 26, 2018 at 10:12:40 AM UTC-5, ZillaYT wrote:
>>
>> I have the folder properties plugin installed, and have defined some 
>> folder properties, e.g., key=PROJECT_NAME, value=foo. How do I use this in 
>> my jobs that belong in the folder? I tried env.PROJECT_NAME but it 
>> doesn't find it. 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/b9acdc5d-eace-4728-8c15-9196271f24ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use folder properties?

2018-11-26 Thread ZillaYT
I wanted to clarify that I created a folder, and then jobs inside the 
folder. I then configured the folder to have properties (e.g., 
PROJECT_NAME) that I'm trying to use in the jobs inside the folder.

On Monday, November 26, 2018 at 10:12:40 AM UTC-5, ZillaYT wrote:
>
> I have the folder properties plugin installed, and have defined some 
> folder properties, e.g., key=PROJECT_NAME, value=foo. How do I use this in 
> my jobs that belong in the folder? I tried env.PROJECT_NAME but it 
> doesn't find it. 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/77fdb116-d250-4c79-b65a-97d7855416b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to use folder properties?

2018-11-26 Thread ZillaYT
I have the folder properties plugin installed, and have defined some folder 
properties, e.g., key=PROJECT_NAME, value=foo. How do I use this in my jobs 
that belong in the folder? I tried env.PROJECT_NAME but it doesn't find it. 
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/ea57afac-daba-4cce-830e-84fb89f97f0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: calling another job from parent job

2018-11-13 Thread ZillaYT
Are you using a Jenkinsfile or are you doing this in the Jenkins job config 
page?

On Tuesday, November 13, 2018 at 12:56:57 AM UTC-5, Akshay Paturkar wrote:
>
> Hi All,
> i am trying to call job from another job and able to do it by following 
> below instructions .
> https://jenkins.io/doc/pipeline/steps/pipeline-build-step/
>
> But I am not able to see stages executed under called job.
> how do we enable stages of called job to be displayed under build job 
> 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/44eff6ba-5a24-4e3b-b313-8ae1c8e7a7b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to handle complex job dependency?

2018-11-13 Thread ZillaYT
I ended up following Martin's advice and tagged my docker images in AWS ECR 
accordingly by following the steps outlined Retagging an Image with the AWS 
CLI 
<https://docs.aws.amazon.com/AmazonECR/latest/userguide/retag-aws-cli.html>. 
So when I deploy 1.0.0 to sandbox successfully, the deploy-to-sandbox job 
retags it as 1.0.0-staging, and my deploy-to-staging job will use that tag 
for deployment. Obviously it it's not there, that is, has not been deployed 
to sandbox, the tag will not be there.

Chris

On Tuesday, November 13, 2018 at 11:56:45 AM UTC-5, ZillaYT wrote:
>
> thanks, this doesn't help me.
>
> On Tuesday, November 13, 2018 at 12:56:54 AM UTC-5, Matt Hicks wrote:
>>
>> It doesn't have pipeline support, but the promoted builds plugin 
>> <https://wiki.jenkins.io/display/JENKINS/Promoted+Builds+Plugin> can do 
>> this for freestyle jobs.
>>
>

-- 
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/5c07de56-618d-4f2a-a94d-bc643338d1c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Why are Folder Properties key/value pairs not recognized in multi-branch pipeline job?

2018-11-13 Thread ZillaYT
I installed the Folder Properties plug in, and define these

GIT_BRANC = feature/dev-1234-some-work
RUN_TESTS = true
DEPLOY_TO_SANDBOX = true

I then have this in my Jenkinsfile

def echoStr = """



Git branch: ${env.GIT_BRANCH}, Run tests: ${env.RUN_TESTS}, Deploy to 
sandbox: ${env.DEPLOY_TO_SANDBOX}



"""

println echoStr

and I get this in the console


Git branch: null, Run tests: null, Deploy to sandbox: null



Why is that?

Chris

-- 
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/871285c3-3053-419b-ba4b-4930b7c77d6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to handle complex job dependency?

2018-11-13 Thread ZillaYT
thanks, this doesn't help me.

On Tuesday, November 13, 2018 at 12:56:54 AM UTC-5, Matt Hicks wrote:
>
> It doesn't have pipeline support, but the promoted builds plugin 
>  can do 
> this for freestyle jobs.
>

-- 
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/2bd7ced4-38e0-4598-a341-00bb95e2d279%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to handle complex job dependency?

2018-11-12 Thread ZillaYT
Thanks Martin. I will explore tagging my docker images as we deploy them. 
So if I deploy dockerUrl/atrifact:1.0.0 to sandbox, I'll give it a 
dockerUrl/artifact:1.0.0-sandboxed tag. My deploy-to-staging job will then 
have to "look" for the "sandboxed" part in the tag.

Chris

On Monday, November 12, 2018 at 6:14:52 PM UTC-5, Martin d'Anjou wrote:
>
> I think you could use the Copy Artifacts 
> <https://wiki.jenkins.io/display/JENKINS/Copy+Artifact+Plugin> plugin to 
> share a file between jobs. But managing the list of releases in a file 
> becomes hairy IMO. I do not know your specific case, but I guess it will 
> grow over time, not to millions of records, but possibly to hundreds or 
> maybe thousands. There is also the question of rollbacks in case of 
> uncontrollable mistakes (how to erase an entry from the list).
>
> You could use a shared workspace for the purpose of storing that file, 
> using the external workspace manager plugin 
> <https://github.com/jenkinsci/external-workspace-manager-plugin/blob/master/README.md>
> .
>
> I would consider an external database of some kind and the httpRequest 
> <https://jenkins.io/doc/pipeline/steps/http_request/> plugin to access it.
>
> If you push your releases to a binary repository, there could be a way to 
> store that info there too.
>
> Martin
>
> On Monday, November 12, 2018 at 9:00:36 AM UTC-5, ZillaYT wrote:
>>
>> Thanks Martin, though you just reworded my post.
>>
>> But yes one approach to consider is being able to store which, for 
>> example, versions have been run by deploy-to-sandox. IOW if 
>> deploy-to-sandbox has run with versions 1.0.0 and 1.0.4, I want to store 
>> those versions in its property file, say sandboxed_versons.properties. How 
>> will I then tell deploy-to-staging to read 
>> /.../deploy-to-sandbox/sandboxed.properties file?
>>
>> Chris
>>
>> On Saturday, November 10, 2018 at 9:35:12 PM UTC-5, Martin d'Anjou wrote:
>>>
>>> I do not know of an automated way of doing that.
>>>
>>> If I understand correctly, the release number is assigned by the 
>>> build-and-test phase, and it published the docker repo.
>>> I assume that this release number is known one way or another by the 
>>> users, since it has been published to the docker repo.
>>> This release number is an input to the other jobs. So I suggest you make 
>>> the release number an input parameter to the other jobs.
>>>
>>> When each job runs, it needs to check that the released artifact has 
>>> reached the expected "quality" level for the job. If not the jobs would 
>>> fail with some meaningful error message.
>>> The quality levels would be 1) built and tested, 2) sandbox, 3) staging, 
>>> and 4) production.
>>> In other words, deploy-to-sandbox(1.0.11) needs to check that the 
>>> artifacts 1.0.11 exists in the docker repo before it attempts to deploy to 
>>> sandbox.
>>> You also need to store the quality level somewhere persistent, maybe as 
>>> a property of the artifacts in the docker repo (if that is possible?).
>>> Artifactory supports properties, or maybe you need a database.
>>>
>>> Hope this helps at least from a conceptual point of view.
>>>
>>> Martin
>>>
>>

-- 
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/57be66d4-ad61-4e7a-b3b7-237883e83b87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to handle complex job dependency?

2018-11-12 Thread ZillaYT
Thanks Martin, though you just reworded my post.

But yes one approach to consider is being able to store which, for example, 
versions have been run by deploy-to-sandox. IOW if deploy-to-sandbox has 
run with versions 1.0.0 and 1.0.4, I want to store those versions in its 
property file, say sandboxed_versons.properties. How will I then tell 
deploy-to-staging to read /.../deploy-to-sandbox/sandboxed.properties file?

Chris

On Saturday, November 10, 2018 at 9:35:12 PM UTC-5, Martin d'Anjou wrote:
>
> I do not know of an automated way of doing that.
>
> If I understand correctly, the release number is assigned by the 
> build-and-test phase, and it published the docker repo.
> I assume that this release number is known one way or another by the 
> users, since it has been published to the docker repo.
> This release number is an input to the other jobs. So I suggest you make 
> the release number an input parameter to the other jobs.
>
> When each job runs, it needs to check that the released artifact has 
> reached the expected "quality" level for the job. If not the jobs would 
> fail with some meaningful error message.
> The quality levels would be 1) built and tested, 2) sandbox, 3) staging, 
> and 4) production.
> In other words, deploy-to-sandbox(1.0.11) needs to check that the 
> artifacts 1.0.11 exists in the docker repo before it attempts to deploy to 
> sandbox.
> You also need to store the quality level somewhere persistent, maybe as a 
> property of the artifacts in the docker repo (if that is possible?).
> Artifactory supports properties, or maybe you need a database.
>
> Hope this helps at least from a conceptual point of view.
>
> Martin
>

-- 
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/74f83fca-f847-49d7-bbc5-a157feaa10cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Disappearing "Build with parameters" link for multi-branch pipeline job?

2018-11-09 Thread ZillaYT
I know that this is a known bug where I have a multi-branch pipeline job 
that has the following properties block, and the "Build with parameters" 
link shows up, I run the job, it succeeds, and the the "Build with 
parameters" link disappears with only the "Build now" link, which I run, 
and fails, and then the "Build with parameters" link shows up again.

properties([

 parameters([

   string(name: 'GIT_BRANCH', defaultValue: 
'feature/dev-26387-split-micro-deploy', description: 'zift-infrastructure 
branch to use'),

   booleanParam(name: 'RUN_TESTS', defaultValue: true, description: 'Boolean 
whether to run unit tests or not'),

   booleanParam(name: 'DEPLOY_TO_SANDBOX', defaultValue: true, description: 
'Boolean 
whether to deploy to sandbox or not')

 ])

])

Any workaround for this bug? I have not seen one online, or maybe I missed 
it?

Thanks,
Chris

-- 
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/28273d69-c4d6-4ca5-bd5b-1a08cdf5d54a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to handle complex job dependency?

2018-11-09 Thread ZillaYT
I have a folder with 4 jobs, namely,

   - build-and-test = a multi-branch pipeline job that builds and tests 
   code and, if successful, pushes a docker image to docker repo. So I can 
   have several versions of the docker image, say 1.0.0, 1.0.4, 1.0.11
   - deploy-to-sandbox = a pipeline job that pulls above docker image from 
   docker repo, with desired version from above build, and deploys it to a 
   sandbox environment
   - deploy-to-staging = similarly, = a pipeline job that pulls above 
   docker image from docker repo, with desired version from above build, and 
   deploys it to a staging environment, ONLY IF desired version has been 
   deployed to sandbox already
   - deploy-to-production = a pipeline job that pulls above docker image 
   from docker repo, with desired version from above build, and deploys it to 
   a production environment, ONLY IF desired version has been deployed to 
   staging already

So I should ONLY be able to run deploy-to-production(1.0.4) if I've already 
ran deploy-to-staging(1.0.4), and hence only if I've already ran 
deploy-to-sandbox(1.0.4). One job does NOT automatically trigger any 
downstream job.

Also, I don't need to have the same version in all environments. For 
example, I can have the scenario where...

   - deploy-to-sandbox(1.0.11)
   - deploy-to-staging(1.0.4)
   - deploy-to-production(1.0.0)

...again as long as what I'm deploying in production has already been 
deployed to staging, and as long as that version has already been deployed 
to sandbox.

Any pointers on how to do this?

Thanks!
Chris

-- 
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/86e31aad-ab3f-4e6a-9ba6-f7be9934653e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use environment variable in Jenkins Pipeline build?

2018-11-08 Thread ZillaYT
I got it answered in stackoverflow How to use environment variables in a 
Jenkins pipeline job? 
<https://stackoverflow.com/questions/53212940/how-to-use-environment-variables-in-a-jenkins-pipeline-job>
 I 
just had to uncheck the "Lightweight checkout" box at the bottom of that 
block, and it worked!

Thanks!

On Thursday, November 8, 2018 at 2:53:03 PM UTC-5, Mark Waite wrote:
>
> That's a good clarification.  I believe there is a known bug that the git 
> plugin does not expand variable references in some of the configuration 
> fields.  
>
> Use a multibranch Pipeline instead, then you can let the Pipeline script 
> expand the variable, and you won't have a confusing mix of changes in the 
> history of the job.
>
> Mark Waite
>
> On Thu, Nov 8, 2018 at 12:23 PM ZillaYT > 
> wrote:
>
>> Just to be clear, this is the text box in the job configuration page 
>> where I want to use an environment variable.
>>
>> [image: Screen Shot 2018-11-08 at 1.37.35 PM.png]
>>
>>
>> On Thursday, November 8, 2018 at 2:19:06 PM UTC-5, ZillaYT wrote:
>>>
>>> It should work, but doesn't!
>>>
>>> I define my environment variable in Manage Jenkins->System 
>>> Configuration, Global Properties, Environment variables. I use the variable 
>>> in other jobs so I know the variable definition works!
>>>
>>> Thanks.
>>>
>>> On Thursday, November 8, 2018 at 12:45:18 PM UTC-5, Cuong Tran wrote:
>>>>
>>>> Where do you define your "environment variable"?   
>>>>
>>>> It should work as ${BRANCH_TO_BUILD} if you define BRANCH_TO_BUILD 
>>>> under global environment variables, folder, inside your pipeline, etc.
>>>>
>>>>
>>>> On Thursday, November 8, 2018 at 8:56:38 AM UTC-8, ZillaYT wrote:
>>>>>
>>>>> Someone suggested using ${env.branchToBuild}, so I tried 
>>>>> env.branchToBuild, 
>>>>> $env.branchToBuild, ${env.branchToBuild}, and "${env.branchToBuild}" 
>>>>> all to NO avail.
>>>>>
>>>>> On Thursday, November 8, 2018 at 10:26:34 AM UTC-5, ZillaYT wrote:
>>>>>>
>>>>>> I have a Jenkins Pipeline job which uses "Pipeline script from SCM" 
>>>>>> as my pipeline. One of this block's parameters is "Branch to build" of 
>>>>>> course. How can I used an environment variable for the text block? I 
>>>>>> tried, 
>>>>>> for example , $branchToBuild, ${branchToBuild} or "${branchToBuild}"  
>>>>>> and it just takes those as literal values and does not extrapolate the 
>>>>>> string. I do have that variable defined and use it in other jobs.
>>>>>>
>>>>>> Is it just not possible to do 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-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/264ef2d4-3b6e-471c-8d98-40bc1e16496b%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/264ef2d4-3b6e-471c-8d98-40bc1e16496b%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Thanks!
> Mark Waite
>

-- 
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/7d86558f-42a6-4ff7-956b-149d9b719e34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use environment variable in Jenkins Pipeline build?

2018-11-08 Thread ZillaYT
Just to be clear, this is the text box in the job configuration page where 
I want to use an environment variable.

[image: Screen Shot 2018-11-08 at 1.37.35 PM.png]


On Thursday, November 8, 2018 at 2:19:06 PM UTC-5, ZillaYT wrote:
>
> It should work, but doesn't!
>
> I define my environment variable in Manage Jenkins->System Configuration, 
> Global Properties, Environment variables. I use the variable in other jobs 
> so I know the variable definition works!
>
> Thanks.
>
> On Thursday, November 8, 2018 at 12:45:18 PM UTC-5, Cuong Tran wrote:
>>
>> Where do you define your "environment variable"?   
>>
>> It should work as ${BRANCH_TO_BUILD} if you define BRANCH_TO_BUILD under 
>> global environment variables, folder, inside your pipeline, etc.
>>
>>
>> On Thursday, November 8, 2018 at 8:56:38 AM UTC-8, ZillaYT wrote:
>>>
>>> Someone suggested using ${env.branchToBuild}, so I tried env.branchToBuild, 
>>> $env.branchToBuild, ${env.branchToBuild}, and "${env.branchToBuild}" 
>>> all to NO avail.
>>>
>>> On Thursday, November 8, 2018 at 10:26:34 AM UTC-5, ZillaYT wrote:
>>>>
>>>> I have a Jenkins Pipeline job which uses "Pipeline script from SCM" as 
>>>> my pipeline. One of this block's parameters is "Branch to build" of 
>>>> course. 
>>>> How can I used an environment variable for the text block? I tried, for 
>>>> example , $branchToBuild, ${branchToBuild} or "${branchToBuild}"  and 
>>>> it just takes those as literal values and does not extrapolate the string. 
>>>> I do have that variable defined and use it in other jobs.
>>>>
>>>> Is it just not possible to do 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/264ef2d4-3b6e-471c-8d98-40bc1e16496b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use environment variable in Jenkins Pipeline build?

2018-11-08 Thread ZillaYT
It should work, but doesn't!

I define my environment variable in Manage Jenkins->System Configuration, 
Global Properties, Environment variables. I use the variable in other jobs 
so I know the variable definition works!

Thanks.

On Thursday, November 8, 2018 at 12:45:18 PM UTC-5, Cuong Tran wrote:
>
> Where do you define your "environment variable"?   
>
> It should work as ${BRANCH_TO_BUILD} if you define BRANCH_TO_BUILD under 
> global environment variables, folder, inside your pipeline, etc.
>
>
> On Thursday, November 8, 2018 at 8:56:38 AM UTC-8, ZillaYT wrote:
>>
>> Someone suggested using ${env.branchToBuild}, so I tried env.branchToBuild, 
>> $env.branchToBuild, ${env.branchToBuild}, and "${env.branchToBuild}" all 
>> to NO avail.
>>
>> On Thursday, November 8, 2018 at 10:26:34 AM UTC-5, ZillaYT wrote:
>>>
>>> I have a Jenkins Pipeline job which uses "Pipeline script from SCM" as 
>>> my pipeline. One of this block's parameters is "Branch to build" of course. 
>>> How can I used an environment variable for the text block? I tried, for 
>>> example , $branchToBuild, ${branchToBuild} or "${branchToBuild}"  and 
>>> it just takes those as literal values and does not extrapolate the string. 
>>> I do have that variable defined and use it in other jobs.
>>>
>>> Is it just not possible to do 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/1bea1dd6-9c66-4117-81b5-31bd55b8134d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to use environment variable in Jenkins Pipeline build?

2018-11-08 Thread ZillaYT
I have a Jenkins Pipeline job which uses "Pipeline script from SCM" as my 
pipeline. One of this block's parameters is "Branch to build" of course. 
How can I used an environment variable for the text block? I tried, for 
example , $branchToBuild, ${branchToBuild} or "${branchToBuild}"  and it 
just takes those as literal values and does not extrapolate the string. I 
do have that variable defined and use it in other jobs.

Is it just not possible to do 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/829ef574-de14-4277-b391-185d56e485aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Help running 'aws elbv2 modify-listener --default-actions' in Jenkins pipeline

2018-10-17 Thread ZillaYT
I'm able to run this on my terminal (Macbook)

$ aws elbv2 modify-listener --listener-arn arn:aws:elasticloadbalancing:us-
east-1:123456789012:listener/app/sb-zift-admin-lb/123456789012/abcdefghij12 
--default-actions Type=redirect,RedirectConfig=
"{Protocol=HTTPS,Port=443,Host='#{host}',Query='#{query}',Path='/#{path}',StatusCode=HTTP_301}"

or

$ aws elbv2 modify-listener --listener-arn arn:aws:elasticloadbalancing:us-
east-1:123456789012:listener/app/sb-zift-admin-lb/123456789012/abcdefghij12 
--default-actions '[{"Type": "redirect", "RedirectConfig": {"Protocol": 
"HTTPS", "Port": "443", "Host": "#{host}", "Query": "#{query}", "Path": 
"/#{path}", "StatusCode": "HTTP_301"}}]'

But when I script this into Jenkins pipeline, it doesn't work for me. Like 
this...

def httpListenerArn = arn:myAWSlistener
def defaultActions = 
'[{\\"Type\\":\\"redirect\\",\\"RedirectConfig\\":{\\"Protocol\\":\\"HTTPS\\",\\"Port\\":\\"443\\",\\"Host\\":\\"#{host}\\",\\"Query\\":\\"#{query}\\",\\"Path\\":\\"/#{path}\\",\\"StatusCode\\":\\"HTTP_301\\"}}]'
sh = """
aws elbv2 modify-listener --listener-arn $httpListenerArn 
--default-actions \\'$defaultActions\\'
"""


I get this output on the console

+ aws elbv2 modify-listener --listener-arn arm:mySWSListener --default-actions 
'[{"Type":"redirect","RedirectConfig":{"Protocol":"HTTPS","Port":"443","Host":"#{host}","Query":"#{query}","Path":"/#{path}","StatusCode":"HTTP_301"}}]'

Error parsing parameter '--default-actions': Expected: '=', received: ''' for 
input: 
'[{"Type":"redirect","RedirectConfig":{"Protocol":"HTTPS","Port":"443","Host":"#{host}","Query":"#{query}","Path":"/#{path}","StatusCode":"HTTP_301"}}]'
 ^

If I cut/paste what Jenkins spits out (command after + in output console) onto 
my terminal, it works. Any clues?


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/0eba2ba3-4f84-490a-9cca-d559f8d80574%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline (with Git) NOT honoring options?

2018-08-16 Thread ZillaYT
Wait, I think the above Git output is via this code. How can I pass no-tag 
fetch, shallow fetch, and timeout options to the fromGit() call?

stage('Loading Base Pipeline') {
pipeline = fileLoader.fromGit(jenkinsPipeline, gitPath, gitBranch, 
gitCredentialsId, jenkinsNode)
}



On Thursday, August 16, 2018 at 10:16:26 AM UTC-4, ZillaYT wrote:
>
> Jenkins v2.107.2
>
> We are have a Jenkins Pipeline job set up this way
>
>- Pipeline script from SCM
>- SCM: Git
>- Repositories: (Set up appropriately and correctly using SSH)
>- Additional Behaviors
>- Clean before checkout
>   - Advanced clone behaviours
>  - Fetch tags: unchecked
>  - Honor refspec on initial clone: unchecked
>  - Shallow clone: checked
>  - Shallow clone depth: 1
>  - Path of reference repo during clone: (blank)
>  - Timeout in minutes for clone and fetch operations: 30
>   - Advanced checkout behaviors:
>  - Timeout (in minutes) for checkout operation: 30
>   
> However, it seems like NONE of the "Advance..." options are used. I get 
> the following. See where it time out after 10 minutes instead of 30 as 
> specified in the options? Also, I unchecked "Fetch tags" but it's still 
> fetching tags? I thought this was fixed?
>
> Checking out g...@bitbucket.org:project/repo.git, 
> branch=dont-merge-test-build-only
> [Pipeline] checkout
> Cloning the remote Git repository
> Cloning repository g...@bitbucket.org:project/repo.git
>  > git init 
> /home/jenkins/workspace/Utilities/test-project-build-only/libLoader # 
> timeout=10
> Fetching upstream changes from g...@bitbucket.org:project/repo.git
>  > git --version # timeout=10
> using GIT_SSH to set credentials Bitbucket credentials
>  > git fetch --tags --progress g...@bitbucket.org:project/repo.git 
> +refs/heads/*:refs/remotes/origin/*
> ERROR: Timeout after 10 minutes
> ERROR: Error cloning remote repo 'origin'
> hudson.plugins.git.GitException: Command "git fetch --tags --progress 
> git@bitbucket.project/repo.git +refs/heads/*:refs/remotes/origin/*" returned 
> status code 128:
> stdout: 
> stderr: Warning: Permanently added 'bitbucket.org,xxx.xxx.xxx.xxx' (RSA) to 
> the list of known hosts.
>
>
>
>
>
>  
>

-- 
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/6d68b3dc-144b-4251-810e-19ccef7e5176%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Pipeline (with Git) NOT honoring options?

2018-08-16 Thread ZillaYT
Jenkins v2.107.2

We are have a Jenkins Pipeline job set up this way

   - Pipeline script from SCM
   - SCM: Git
   - Repositories: (Set up appropriately and correctly using SSH)
   - Additional Behaviors
   - Clean before checkout
  - Advanced clone behaviours
 - Fetch tags: unchecked
 - Honor refspec on initial clone: unchecked
 - Shallow clone: checked
 - Shallow clone depth: 1
 - Path of reference repo during clone: (blank)
 - Timeout in minutes for clone and fetch operations: 30
  - Advanced checkout behaviors:
 - Timeout (in minutes) for checkout operation: 30
  
However, it seems like NONE of the "Advance..." options are used. I get the 
following. See where it time out after 10 minutes instead of 30 as 
specified in the options? Also, I unchecked "Fetch tags" but it's still 
fetching tags? I thought this was fixed?

Checking out g...@bitbucket.org:project/repo.git, 
branch=dont-merge-test-build-only
[Pipeline] checkout
Cloning the remote Git repository
Cloning repository g...@bitbucket.org:project/repo.git
 > git init /home/jenkins/workspace/Utilities/test-project-build-only/libLoader 
 > # timeout=10
Fetching upstream changes from g...@bitbucket.org:project/repo.git
 > git --version # timeout=10
using GIT_SSH to set credentials Bitbucket credentials
 > git fetch --tags --progress g...@bitbucket.org:project/repo.git 
 > +refs/heads/*:refs/remotes/origin/*
ERROR: Timeout after 10 minutes
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --tags --progress 
git@bitbucket.project/repo.git +refs/heads/*:refs/remotes/origin/*" returned 
status code 128:
stdout: 
stderr: Warning: Permanently added 'bitbucket.org,xxx.xxx.xxx.xxx' (RSA) to the 
list of known hosts.





 

-- 
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/3137d472-62b1-4089-a07d-b9524652b750%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.