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

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.get

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

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

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

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

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

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

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.

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

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

2019-04-16 Thread ZillaYT
er 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

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

2019-04-16 Thread ZillaYT
ou 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 &g

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).

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 >

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

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 &

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

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 }

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

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

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

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()}",

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

2019-02-15 Thread ZillaYT
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 prope

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

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

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 >

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

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

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

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

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

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 . >

Re: How to handle complex job dependency?

2018-11-13 Thread ZillaYT
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: >

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:

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

Re: How to handle complex job dependency?

2018-11-12 Thread ZillaYT
est > <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:

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

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

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

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

2018-11-08 Thread ZillaYT
ibranch 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

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

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

2018-11-08 Thread ZillaYT
ran 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, Z

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

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=

Re: Pipeline (with Git) NOT honoring options?

2018-08-16 Thread ZillaYT
) } 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 Be

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: