Re: Script result interpreted a a command to execute?

2018-08-26 Thread Idan Adar
Thanks Slide! On Sun, Aug 26, 2018 at 4:25 PM Slide wrote: > It's because your shell command has $() around it. This will try and eval > the subshell value. You don't need the $() at all > > On Sun, Aug 26, 2018, 03:44 Idan Adar wrote: > >> The following block fails... ap

Script result interpreted a a command to execute?

2018-08-26 Thread Idan Adar
The following block fails... appreciate any insights: workerVersion = sh(script:"\$(ic cs workers ${clusterName} --json | jq -r .[0].kubeVersion)", returnStdout: true).trim() // This returns "1.9.9.1522" slackSend (channel: "certmgr-health", color: '#199515', message: "*$JOB_NAME*,

Re: Is it possible to detect TIMEOUT event and act upon it?

2018-03-19 Thread Idan Adar
In declarative pipeline there is also the option for a script {} block where "traditional" Jenkins scripting can be done, so what you're suggesting can be done there. However, I'm not looking to adding the user prompt like in your example, which seems like SYSTEM depends on, in your example.

Re: Is it possible to detect TIMEOUT event and act upon it?

2018-03-19 Thread Idan Adar
e web visit https://groups.google.com/d/ > msgid/jenkinsci-users/7b34bb58-d0e0-4d38-8d47-eff33f4839c8%40googlegroups. > com > <https://groups.google.com/d/msgid/jenkinsci-users/7b34bb58-d0e0-4d38-8d47-eff33f4839c8%40googlegroups.com?utm_medium=email_source=footer> > . > For

Is it possible to detect TIMEOUT event and act upon it?

2018-03-18 Thread Idan Adar
In a declarative pipeline's Jenkinsfile it is possible to add a timeout option both global as well as override it per stage. E.g.: stage ("SonarQube analysis") { options { timeout(time: 5, unit: 'MINUTES') } steps { script { STAGE_NAME = "SonarQube analysis"

Re: Can I load a declarative Jenkinsfile via a shared library?

2018-01-10 Thread Idan Adar
Any prerequisites? On Wed, Jan 10, 2018 at 8:46 PM, Daniel Butler <danielsimonbut...@gmail.com> wrote: > I believe this was added a month or two ago. > > On 10 Jan 2018 6:33 pm, "Idan Adar" <i...@adar.me> wrote: > >> Is the following feasible? >&g

Can I load a declarative Jenkinsfile via a shared library?

2018-01-10 Thread Idan Adar
Is the following feasible? 1. Setup a Shared Library in the Jenkins settings 2. In every repository requiring the Jenkinsfile (it is the same one used in multiple repos...), use the following in the Jenkinsfile of the repository instead: (based on

Can shell script be executed from an Extensible Choice -> Groovy Script?

2017-11-09 Thread Idan Adar
In a paramatized job that displays to the user some options before executing it, I also need to show a "dynamic" dropdown. I believe the way to do this is using the Extensible Choice option. Can I execute a shell script in this option's Groovy Script textarea? The below does not seem to be

Can shell variables be read outside of the shell block while in a script block?

2017-10-14 Thread Idan Adar
script { ... ... sh """ X = ... """ } Can X be read directly, outside of the sh block? Right now I'm echoing X to file (echo X > myfile.txt) and then read the contents of the file (def y = readFile("myfile.txt).trim). There has to be a better way to do this? -- You

Re: Accessing a variable in shell

2017-09-28 Thread Idan Adar
Indeed. This is long resolve. Thanks! On Sunday, July 30, 2017 at 2:56:47 PM UTC+3, Idan Adar wrote: > > Given the following script block in a stage (Declarative pipeline), how > can I access the repoName variable? > > stages { > stage("...") { > scr

Re: String manipulation in sh block

2017-09-24 Thread Idan Adar
Okay, got it at last. The backslashes weren't needed. version=$(jq \".version\" package.json | tr -d '\"') On Sunday, September 24, 2017 at 3:27:15 PM UTC+3, Idan Adar wrote: > Appreciate help with getting the following block right (I always get > confused with stri

String manipulation in sh block

2017-09-24 Thread Idan Adar
Appreciate help with getting the following block right (I always get confused with strings and double/single/escaped quotes): Right now the below puts the message "Bump version number (${version}) [ci skip]" in the commit message. The wanted result is for ${version} to actually be the extracted

Re: GitHub Branch Source Plugin - upgrade messed up jobs

2017-09-22 Thread Idan Adar
The solution was to add "PR*" to the filter list. -- 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

Re: GitHub Branch Source Plugin - upgrade messed up jobs

2017-09-22 Thread Idan Adar
didn't configure "discover from origin" then it won't discover from > origin > > (likely the upgrade/rollback/upgrade screwed up the auto-migration) > > On 22 September 2017 at 03:18, Idan Adar <id...@adar.me > > wrote: > >> Why is it saying this? >> >

Re: GitHub Branch Source Plugin - upgrade messed up jobs

2017-09-22 Thread Idan Adar
Why is it saying this? > Checking pull request #215 > Submitted from origin repository, skipping I have a repository and in this repository I have two branches: develop and master. I created another

Re: GitHub Branch Source Plugin - upgrade messed up jobs

2017-09-22 Thread Idan Adar
UTC+3, Daniel Beck wrote: > > > > On 22. Sep 2017, at 11:33, Idan Adar <id...@adar.me > > wrote: > > > > credentials("${JENKINSBOT_USERNAME_PASSWORD}") > > This is equivalent to: > > credentials(JENKINSBOT_USERNAME_PASSWORD) >

Re: GitHub Branch Source Plugin - upgrade messed up jobs

2017-09-22 Thread Idan Adar
Okay, the problem was lines like this: JENKINSBOT = credentials('${JENKINSBOT_USERNAME_PASSWORD}') In v2.46 this worked. Once I upgraded to 2.73 I had to change it to: JENKINSBOT = credentials("${JENKINSBOT_USERNAME_PASSWORD}") -- You received this message because you are subscribed to the

Re: GitHub Branch Source Plugin - upgrade messed up jobs

2017-09-22 Thread Idan Adar
And yes, I do have a backup from yesterday. If all fails I'll ask to restore to yesterday... -- 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

Re: GitHub Branch Source Plugin - upgrade messed up jobs

2017-09-22 Thread Idan Adar
unsubscribe. > To unsubscribe from this group and all its topics, 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/CC2B4CB9-2D1C-4E56-802E-4328F42EE730%40beckweb.net. > For

Re: GitHub Branch Source Plugin - upgrade messed up jobs

2017-09-22 Thread Idan Adar
l definition. > > Upgrading updated some other plugins, and *those* other plugins are > causing the stack trace > > On Fri 22 Sep 2017 at 06:51, Idan Adar <id...@adar.me > > wrote: > >> The plug-in author is stephen connolly, but I'm not sure how to contact >

GitHub Branch Source Plugin - upgrade messed up jobs

2017-09-21 Thread Idan Adar
I had the unfortunate luck of upgrading said plug-in. Now any job fails with the error below. The upgrade warning does say: Warning: the new version of this plugin claims to use a different settings format than the installed version. Jobs using this plugin may need to be reconfigured, and/or

Re: How to pass paramater to process environment variable?

2017-09-21 Thread Idan Adar
r build discarder when the job runs. > > To access the parameters in your pipeline, use the params object: > > parameters { > string(defaultValue: 'master', description: 'Git Branch', name: > 'gitBranch') > } > > > ... > > > myProperty = "${par

Re: How to pass paramater to process environment variable?

2017-09-20 Thread Idan Adar
ook/pipeline/syntax/#parameters > > currently there is some disconnect in the project configuration UI for > pipeline jobs, many of the options there need to actually be defined in the > pipeline. > > On Wednesday, September 20, 2017 at 8:29:32 AM UTC+1, Idan Adar wrote: >&

How to pass paramater to process environment variable?

2017-09-20 Thread Idan Adar
The following is my current pipeline: stage ("My Stage") { environment { cloudcerts_iamConfig_preprod = credentials( '${cloudcerts_iamConfig_preprod}') } steps { // Setup packages and run tests sh '''

Solid approach to starting Jenkins jobs from Slack?

2017-08-10 Thread Idan Adar
I've scored the web, tried all sort of Hubot plug-ins, Slash Command integration in Slack, but it's pretty bad... they either don't work, don't support multi-branch jobs, etc... Has anyone found a solid way to start Jenkins jobs from Slack and can share with the rest of us? -- You received

Re: Accessing a variable in shell

2017-08-08 Thread Idan Adar
Damn. I had those there before... Thanks. The combination of the more standard loop and the return of the double-quotes now made it work. On Tuesday, August 8, 2017 at 6:37:28 PM UTC+3, Björn Pedersen wrote: > > > > sh ''' > > >^^^ > > You are

Re: Accessing a variable in shell

2017-08-08 Thread Idan Adar
the C-style for loop syntax when using >> pipeline (that's why I've used it in my previous example) : >> >> for (int i = 0; i < moduleList.size(); i++) { >>def moduleName = moduleList[i] >>... >> } >> >> See >> https://github.com/jenkins

Re: Accessing a variable in shell

2017-08-08 Thread Idan Adar
I've made some changes and now I'm getting: java.lang.NullPointerException: Cannot get property '$repoName' on null object def repoList = ReposToUpdate.tokenize(","); def moduleList = npmDependencies.tokenize(","); pipeline { agent { label '' } stages { stage

Re: Accessing a variable in shell

2017-08-08 Thread Idan Adar
st[i] > sh "ncu -u -f \"${moduleName}\"" > } > sh "stat -t . > folderStat2.txt" > } > > Hopefully it helps. > > 2017-08-07 14:49 GMT+02:00 Idan Adar <id...@adar.me >: > >> I have tried this, but it complains: &

Re: Accessing a variable in shell

2017-08-07 Thread Idan Adar
Update failed. Review the build logs." ) } } } On Sunday, July 30, 2017 at 10:48:39 PM UTC+3, Joachim Nilsson wrote: > > As I understand, it is written in Groovy. That means you can access a > variable in a (Groovy)string using dollar and optionally curly brackets. >

Re: How to use "secret text" credential inside NodeJS app as part of a pipeline?

2017-08-06 Thread Idan Adar
Working now. The problem was with another property that was defined as username/password credential and not secret text credential. -- 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

Re: How to use "secret text" credential inside NodeJS app as part of a pipeline?

2017-08-06 Thread Idan Adar
Also, if I will print all of process.env when running npm test via the Jenkinsfile, I can see the Jenkins logs that the not-working value is printed... -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop

Re: How to use "secret text" credential inside NodeJS app as part of a pipeline?

2017-08-06 Thread Idan Adar
ork for running applications on a > server. It should be noted that if you need to specify the secret within a > shell step line, that line must use double quotes to resolve the variable > properly. > > Another way of doing this would be: > > withCredentials([string(creden

How to use "secret text" credential inside NodeJS app as part of a pipeline?

2017-08-03 Thread Idan Adar
I have done the following: 1. Create a "secret text" type credential 2. Put in the credential a password 3. Create a Global Variable, mySecret, with its value being the credential ID 4. In the declarative pipeline: stage ("E2E tests") { environment { mySecret =

Accessing a variable in shell

2017-07-30 Thread Idan Adar
Given the following script block in a stage (Declarative pipeline), how can I access the repoName variable? stages { stage("...") { script { for (String repoName: repoList) { sshagent (credentials: [ 'e276113e-0ec9-4eaa-88f9-a7db5c9635b6']) {

Re: Can we construct a more complex slackSend notification?

2017-06-30 Thread Idan Adar
oservice_ in _${clusterName}_ successfully updated.", "fallback": "*Production Deployer*: operation succeeded." } ] ]) On Friday, June 30, 2017 at 6:23:18 PM UTC+3, Idan Adar wrote: > > Ohhh, nice! > Thanks for the example Michael. > > On Friday, June 30

Re: Can we construct a more complex slackSend notification?

2017-06-30 Thread Idan Adar
ady using it :)) > > > 2017-06-30 16:11 GMT+02:00 Idan Adar <id...@adar.me >: > >> Anyone? :) >> >> On Tuesday, June 27, 2017 at 8:13:35 PM UTC+3, Idan Adar wrote: >>> >>> In a Node.js app, one can use the slack-notify package to send

Re: Can we construct a more complex slackSend notification?

2017-06-30 Thread Idan Adar
Anyone? :) On Tuesday, June 27, 2017 at 8:13:35 PM UTC+3, Idan Adar wrote: > > In a Node.js app, one can use the slack-notify package to send something > like this: > > > slack.send({ > "username": "myBotName", > "ic

Re: Unable to pass variables into multiple lines sh section

2017-06-25 Thread Idan Adar
/prod/$clusterName/kubernetes/deployment.yaml > spec.template.spec.containers[0].image > registry.ng.bluemix.net/certmgmt_prod/instmgr:$instmgr > ;; > esac > """ > >

Re: Unable to pass values into multiple lines sh section

2017-06-25 Thread Idan Adar
There are actually two additional def's. def repoName = "" def clusterName = "" On Sunday, June 25, 2017 at 12:25:14 PM UTC+3, Idan Adar wrote: > > I'm having difficulty passing parameters into a multiple lines sh section > like below. > Can someon

Unable to pass values into multiple lines sh section

2017-06-25 Thread Idan Adar
I'm having difficulty passing parameters into a multiple lines sh section like below. Can someone help with spotting the problem? Specifically, 1. $datacenter is empty 2. $clusterName is empty 3. I suspect $repoName is empty too stage ("Update Deployments") { steps {

Unable to pass variables into multiple lines sh section

2017-06-25 Thread Idan Adar
I'm having difficulty passing parameters into a multiple lines sh section like below. Can someone help with spotting the problem? Specifically, 1. $datacenter is empty 2. $clusterName is empty 3. I suspect $repoName is empty too stage ("Update Deployments") { steps {

Re: Fastest way to git tag in a Jenkinsfile?

2017-06-18 Thread Idan Adar
I eventually used the following to accomplish my goal: https://stackoverflow.com/questions/44612496/bash-variable-escaping-in-a-jenkinsfile#44612844 Still looking forward to changes in "checkout"! -- You received this message because you are subscribed to the Google Groups "Jenkins Users"

Re: Fastest way to git tag in a Jenkinsfile?

2017-06-17 Thread Idan Adar
the whole process... On Sunday, June 18, 2017 at 6:49:36 AM UTC+3, Idan Adar wrote: > > >- An intentionally narrow refspec (like >+refs/heads/master:refs/remotes/origin/master) reduces the objects copied >in the clone to only those in that refspec (typically the desired b

Re: Fastest way to git tag in a Jenkinsfile?

2017-06-17 Thread Idan Adar
Okay, so looks like what I should try in order to: 1. make checkouts faster 2. be able to git tag & push Is the following: 1. Try with: checkout( extensions: [ [$class: 'CloneOption', depth: 1, shallow: true ] ] ) 2. Wait for Stephen... BTW, I thought the

Re: Fastest way to git tag in a Jenkinsfile?

2017-06-17 Thread Idan Adar
Another question, if I do customize "checkout", do I need to include everything like in your example, or only what I want specifically, like depth, and if nothing else is mentioned that the defaults are taken...? -- You received this message because you are subscribed to the Google Groups

Re: Fastest way to git tag in a Jenkinsfile?

2017-06-17 Thread Idan Adar
Oh, hm, interesting... In my multibranch job I selected "GitHub" as the "Branch source"... for "GitHub" there aren't many options... but for "Git" there are... and I guess these play fine with Jenkinsfile... Question. Lets say I setup "Git" as the branch source and add some "additional

Re: Fastest way to git tag in a Jenkinsfile?

2017-06-17 Thread Idan Adar
Oh, hm, interesting... In my multibranch job I selected "GitHub" as the "Branch source"... for "GitHub" there aren't many options... but for "Git" there are... and I guess these play fine with Jenkinsfile... Question. Lets say I setup "Git" as the branch source and in my Jenkinsfile I set:

Re: Fastest way to git tag in a Jenkinsfile?

2017-06-17 Thread Idan Adar
https://github.com/MarkEWaite/jenkins-bugs/blob/JENKINS-33827/Jenkinsfile . > The "pipeline syntax" for checkout will add that behavior for you as well > (though as Stephen notes, the UI is not pretty and shows you many things as > options which you should not use). > > Sorr

Re: Fastest way to git tag in a Jenkinsfile?

2017-06-17 Thread Idan Adar
I take it back, not good workaround for me after all... -- 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

Re: Fastest way to git tag in a Jenkinsfile?

2017-06-17 Thread Idan Adar
I'm sorry, but could you please elaborate? :) What changes to which plug-in and an example implementation... Right now instead of "checkout scm" in the checkout stage and "git clone" in the stage where I need to do git tag/push, I do only the following in the checkout stage: sshagent

Fastest way to git tag in a Jenkinsfile?

2017-06-17 Thread Idan Adar
Checkouts in Jenkins, AFAIK, are headless, meaning that I cannot do git operations on them. If I want to do an operation, like git tag and then git push... I need to first do git clone inside an sshagent block or similar. For large repositories this can be a problem, as the process becomes

Re: Shallow clone example for declarative pipeline?

2017-06-16 Thread Idan Adar
I mean, for the checkout scm part above... not a separate "git clone --depth 1 ..." -- 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

Shallow clone example for declarative pipeline?

2017-06-16 Thread Idan Adar
Could someone please provide an example for shallow clone in a declarative pipeline? pipeline { options { ansiColor('xterm') skipDefaultCheckout() disableConcurrentBuilds() } stages { steps { checkout scm ... } } } --

Re: Can a Jenkins global variable be used inside running code as part of a job?

2017-06-16 Thread Idan Adar
I forgot about parameters option in a Jenkinsfile... thanks. On Thursday, June 15, 2017 at 8:12:15 PM UTC+3, Stephen Connolly wrote: > > > On Thu 15 Jun 2017 at 17:44, Idan Adar <id...@adar.me > > wrote: > >> Well that's a deadlock... I need both those variables and

Re: Can a Jenkins global variable be used inside running code as part of a job?

2017-06-15 Thread Idan Adar
Well that's a deadlock... I need both those variables and the parameter provided to me via parametrized build... parametrized build is available in pipeline but not multibranch -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe

Re: Can a Jenkins global variable be used inside running code as part of a job?

2017-06-15 Thread Idan Adar
Question: It seems that $CHANGE_ID and $CHANGE_URL are not available in a pipeline job but are available in a multibranch job? -- 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,

Re: Can a Jenkins global variable be used inside running code as part of a job?

2017-06-15 Thread Idan Adar
. that will expose the parameter. you can have the parameter > be a drop-down with the two clusters (and even nice names) > >> On 15 June 2017 at 06:12, Idan Adar <i...@adar.me> wrote: >> Here's the situation: >> >> I have 2 clusters, each with its own unique

Re: Can a Jenkins global variable be used inside running code as part of a job?

2017-06-15 Thread Idan Adar
; thing from the command line. > > Pipeline is the glue to wire it all together at the end (same goes for > non-pipeline job types, except it is harder to fall into the trap and hence > less likely... but it can still happen) > > > On 15 June 2017 at 05:19, Idan Adar

Can a Jenkins global variable be used inside running code as part of a job?

2017-06-15 Thread Idan Adar
Currently I have in a node project a .json file with certain values. Is it possible to externalize these values into a Jenkins global variable and then consume these properties in my code? -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To

Re: Can environment directive be used in post?

2017-06-15 Thread Idan Adar
io/doc/pipeline/steps/workflow-basic-steps/#code-withenv-code-set-environment-variables > > On Wednesday, June 14, 2017 at 8:43:43 AM UTC-4, Idan Adar wrote: >> >> In a stage I can do the following: >> >> stage ("Merge pull request") { >>

Can environment directive be used in post?

2017-06-14 Thread Idan Adar
In a stage I can do the following: stage ("Merge pull request") { environment { JENKINSBOT = credentials('${JENKINSBOT_GHE_ACCESS_TOKEN}') } ... ... steps { } } Can this done also in post? post { success {

Re: How to disable jobs of type Multi-branch?

2017-06-01 Thread Idan Adar
I ended with updating a file in a repo if the tests fail. Any job that then tries to run will first check for the contents of the file, if it's not what it should be the job will exit. -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To

Re: How to disable jobs of type Multi-branch?

2017-06-01 Thread Idan Adar
Thanks for the suggestions Stephen. I'd like to try a couple more ideas... Is it possible to modify a global variable? What are my options to deal with variables cross-jobs? On Wednesday, May 31, 2017 at 5:00:50 PM UTC+3, Stephen Connolly wrote: > > > > On 31 May 2017 at 14:17, I

Re: How to disable jobs of type Multi-branch?

2017-05-31 Thread Idan Adar
ou want to turn the multbranch source to be > something like[image: Inline images 1] > or (assuming you want master to still build automatically) > [image: Inline images 2] > > Should be possible to configure that by groovy or a plugin > > On 30 May 2017 at 20:19, Idan Adar <

Re: How to disable jobs of type Multi-branch?

2017-05-30 Thread Idan Adar
To disable, can I point to a branch like so? def job = Jenkins.instance.getItem("job-name/branch-name"); job.disable(); And then to enable, maybe it could be achieved also programmatically? def job = Jenkins.instance.getItem("job-name/branch-name"); job.enable(); -- You received this message

Re: How to disable jobs of type Multi-branch?

2017-05-30 Thread Idan Adar
hen Connolly <stephen.alan.conno...@gmail.com> > wrote: > > >> On Tue 30 May 2017 at 20:36, Idan Adar <i...@adar.me> wrote: >> I thought this would be possible after the fix in >> https://issues.jenkins-ci.org/browse/JENKINS-27299, but apparently not so... &g

How to disable jobs of type Multi-branch?

2017-05-30 Thread Idan Adar
I thought this would be possible after the fix in https://issues.jenkins-ci.org/browse/JENKINS-27299, but apparently not so... Hence asking here. Assuming in a Jenkinsfile, that is run as part of a multi-branch type job, I decide to disable some jobs, e.g: post { failure { script {

Re: How to start a job from another job in a declarative pipeline?

2017-04-13 Thread Idan Adar
That was it... just had to specify the branch. d'oh. build job: '/master', wait: false On Thursday, April 13, 2017 at 10:42:46 AM UTC+3, Idan Adar wrote: > > I should mention that both jobs are multi-branch jobs... > should the job name also somehow incorporate the branch

Re: How to start a job from another job in a declarative pipeline?

2017-04-13 Thread Idan Adar
I should mention that both jobs are multi-branch jobs... should the job name also somehow incorporate the branch name? i.e. "develop" -- 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

Re: How to start a job from another job in a declarative pipeline?

2017-04-12 Thread Idan Adar
alue: "xxx"), > string(name: 'PARAM2, value: "yyy") > ] > } > } > } > > > On Wed, Apr 12, 2017 at 10:53 AM Idan Adar <id...@adar.me > > wrote: > >> Hi, >> >> Lets assume there are two job: >> >> 1. a

How to start a job from another job in a declarative pipeline?

2017-04-12 Thread Idan Adar
Hi, Lets assume there are two job: 1. a job for a micro-service repository 2. a job for end-to-end tests I'd like, in specific cases, to start the end-to-end tests job from the micro-service job. For example, after introducing a change that even though passed unit testing and integration

Re: How to use trigger directive in a declarative pipeline?

2017-04-07 Thread Idan Adar
and submit a pull request with your > information. That will help others use what you've learned. > > Mark Waite > > On Fri, Apr 7, 2017 at 8:27 AM Idan Adar <id...@adar.me > > wrote: > >> Okay, I guess that after the first time the Jenkinsfile is read Jenkins >

Re: How to use trigger directive in a declarative pipeline?

2017-04-07 Thread Idan Adar
Okay, I guess that after the first time the Jenkinsfile is read Jenkins must have saved this info somewhere as when looking at the job in Jenkins there is a "View Configuration" button and there you can see the specified schedule. sigh. I wish that'd be documented... -- You received this

Re: How to use trigger directive in a declarative pipeline?

2017-04-07 Thread Idan Adar
fields. > > I think you want 'H 12,16,20 * * 1-4,7' or if you really want it at the > start of the hour rather than at some time during the hour, then '0 > 12,16,20 * * 1-4,7'. > > Mark Waite > > On Fri, Apr 7, 2017 at 8:00 AM Idan Adar <id...@adar.me >

Re: How to use trigger directive in a declarative pipeline?

2017-04-07 Thread Idan Adar
Okay, I tried various variations, this one works: 0 12,16,20 * * 1-4,7 Meaning: "At minute 0 past hour 12, 16, and 20 on every day-of-week from Monday through Thursday and Sunday." Could someone now explain to me how this is supposed to work in Jenkins? How will Jenkins know when to actually

Re: How to use trigger directive in a declarative pipeline?

2017-04-07 Thread Idan Adar
oops... disregard the snippet, it was wrong (but the failure is there anyway). The following is the cron used. I am attempting to run the job at 12:00, 16:00 and 20:00 on Sunday-Thursday... (every week, every month, every year). triggers { cron '0 12,16,20 * * 1-4,7 *' } The error is the

Re: How to use trigger directive in a declarative pipeline?

2017-04-07 Thread Idan Adar
FYI, The log is from my actual pipeline. The code snippet is just usage example. -- 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

Re: Getting result of a stage in a pipeline job?

2017-04-07 Thread Idan Adar
You could something like the following, where if all actions have worked, it'll simply read the slack action and perform it. stage ("Publish CF app") { environment { JENKINSBOT = credentials('...') } when { branch "develop" }

How to use trigger directive in a declarative pipeline?

2017-04-07 Thread Idan Adar
It sounds obvious from reading the docs , but... In a multi-branch pipeline there is no UI in Jenkins for defining a schedule to decide when should the job run automatically. It seems that the following should do

Re: After uninstalling Blue Ocean 1.0, link to build in GitHub remains with /blue, leading to 404

2017-04-06 Thread Idan Adar
> Sounds like there needs to be a setting for that. > > Please file an issue on https://issues.jenkins-ci.org . > > I just popped over to the gitter channel for blue ocean ( > https://gitter.im/jenkinsci/blueocean-plugin) to ask about this, too. > > > On Thursda

Re: How to replace withCredentials([usernamePassword ... with credentials(...)

2017-04-06 Thread Idan Adar
The problem was that it's not "PWD" but "PSW"... On Thursday, April 6, 2017 at 6:26:00 PM UTC+3, Idan Adar wrote: > > In declarative pipeline, one can use credentials() instead > of withCredentials, but I am not really sure how this works. In general, &

Re: How to replace withCredentials([usernamePassword ... with credentials(...)

2017-04-06 Thread Idan Adar
, Idan Adar wrote: > > The following resulted in an exception during runtime. > > groovy.lang.MissingPropertyException: No such property: UP_PWD for class: > groovy.lang.Binding > at groovy.lang.Binding.getVariab

Re: How to replace withCredentials([usernamePassword ... with credentials(...)

2017-04-06 Thread Idan Adar
ote: > > FOO = credentials('id') will create environment variables FOO_USR and > FOO_PWD > > On Apr 6, 2017 8:42 AM, "Idan Adar" <id...@adar.me > wrote: > > Perhaps Robert (CCed) can help? > > > On Thursday, April 6, 2017 at 6:26:00 PM UTC+3, Idan

Re: Valid use of environment directive

2017-04-06 Thread Idan Adar
script { } it is... :/ On Thursday, April 6, 2017 at 7:39:27 PM UTC+3, Andrew Bayer wrote: > > No, that's definitely not intended to work that way, and it probably won't > work. > > On Apr 6, 2017 9:09 AM, "Idan Adar" <id...@adar.me > wrote: > >> Yes, tha

Re: Valid use of environment directive

2017-04-06 Thread Idan Adar
clarative pipeline inside a Stage. > > No need to declare it with-in environment { }. > > On Thu, Apr 6, 2017, 18:42 Idan Adar <id...@adar.me > wrote: > >> Perhaps Robert (CCed) can help? >> >> >> On Thursday, April 6, 2017 at 6:08:18 PM UTC+3, Idan Adar wrote

Re: After uninstalling Blue Ocean 1.0, link to build in GitHub remains with /blue, leading to 404

2017-04-06 Thread Idan Adar
Perhaps Liam (CCed) can help? On Thursday, April 6, 2017 at 5:41:03 PM UTC+3, Idan Adar wrote: > > Apparently after installing Blue Ocean, the build check links in GitHub > were changed to /blue. Was this mentioned somewhere? > After uninstalling Blue Ocean (I uninstalled all

Re: How to replace withCredentials([usernamePassword ... with credentials(...)

2017-04-06 Thread Idan Adar
Perhaps Robert (CCed) can help? On Thursday, April 6, 2017 at 6:26:00 PM UTC+3, Idan Adar wrote: > > In declarative pipeline, one can use credentials() instead > of withCredentials, but I am not really sure how this works. In general, > lots of examples are missing... > > Ass

Re: Valid use of environment directive

2017-04-06 Thread Idan Adar
Perhaps Robert (CCed) can help? On Thursday, April 6, 2017 at 6:08:18 PM UTC+3, Idan Adar wrote: > > Is this a valid use of environment directive and variables in declarative > pipeline? > > pipeline { >environment { >MY_VAR = null >} > &g

How to replace withCredentials([usernamePassword ... with credentials(...)

2017-04-06 Thread Idan Adar
In declarative pipeline, one can use credentials() instead of withCredentials, but I am not really sure how this works. In general, lots of examples are missing... Assuming I've created in Jenkins a credential for an access token, I can do this: stage ("Merge pull request") { environment

Valid use of environment directive

2017-04-06 Thread Idan Adar
Is this a valid use of environment directive and variables in declarative pipeline? pipeline { environment { MY_VAR = null } stages { stage ("...") { steps { MY_VAR = "this_stage" } } stage ("...") { steps {

After uninstalling Blue Ocean 1.0, link to build in GitHub remains with /blue, leading to 404

2017-04-06 Thread Idan Adar
Apparently after installing Blue Ocean, the build check links in GitHub were changed to /blue. Was this mentioned somewhere? After uninstalling Blue Ocean (I uninstalled all "blue ocean" plugins), the link remains... but now it leads to 404, because whatever /blue is, it's no longer available.

Re: Blue Ocean 1.0 is now available

2017-04-05 Thread Idan Adar
Looks great! Question: in the 'regular UI' I can separate/organize jobs into categories/different tabs. In Blue Ocean there is no such separation? Can this be achieved somehow? A use case would be two teams using the same Jenkins instance, so need some sort of job ordering/separation. On

Re: Disable new jobs if a build fails

2017-04-05 Thread Idan Adar
Looks like this is the solution: https://issues.jenkins-ci.org/browse/JENKINS-27299 But only once it actually get merged. Otherwise this is a no-go for multi-branch pipelines... On Tuesday, April 4, 2017 at 12:07:55 PM UTC+3, Idan Adar wrote: > > Thanks! > > I looked at th

Re: Disable new jobs if a build fails

2017-04-04 Thread Idan Adar
ers@googlegroups.com> wrote: > Idan Adar (2017-04-03 15:11): > > Hello, > > I received a request, which sounds kinda far-fetched to me, but maybe I > wrong. > > Lets assume there is a job that is scheduled to run 3 times ago. End to > end sort of tests. And at som

Disable new jobs if a build fails

2017-04-03 Thread Idan Adar
Hello, I received a request, which sounds kinda far-fetched to me, but maybe I wrong. Lets assume there is a job that is scheduled to run 3 times ago. End to end sort of tests. And at some point one of the job runs fails. The request here is to block all future PRs for any repository in GitHub

Re: How to skip a build after a "git push" done by a Jenkinsfile

2017-03-25 Thread Idan Adar
At last, resolved using parameters, when and expression blocks. See here: http://stackoverflow.com/questions/43016942/can-a-jenkins-job-be-aborted-with-success-result -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this

Re: How to skip a build after a "git push" done by a Jenkinsfile

2017-03-25 Thread Idan Adar
I am now attempting to solve this use the environment, when and expression blocks. Could some please take a look? http://stackoverflow.com/questions/43016942/can-a-jenkins-job-be-aborted-with-success-result -- You received this message because you are subscribed to the Google Groups "Jenkins

Re: How to skip a build after a "git push" done by a Jenkinsfile

2017-03-25 Thread Idan Adar
you want is a build step that stops the build with an "ignore" status > of some sort. > > On Sat 25 Mar 2017 at 09:52, Idan Adar <id...@adar.me > > wrote: > >> As Mark mentioned, the alternative is to trigger an exception... (which >> will in turn show

Re: How to skip a build after a "git push" done by a Jenkinsfile

2017-03-25 Thread Idan Adar
As Mark mentioned, the alternative is to trigger an exception... (which will in turn show the row in red color). I do it as follows. After checking out, if a git commit includes "[ci skip]" I use a "success" keyword (this keyword does not exit) hence the build stops. I would love for this

  1   2   >