How to share (non-secret) variables between jobs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to share (non-secret) variables between jobs

Ashish Sharma-2
Dear All,

We have a bunch of jobs which will use some common variables like user names, urls etc (which are not secrets or credentials). Is there a way (or plugin maybe) to share these variables between jobs (something like credentials plugin for secrets).

TIA,
Ashish

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/cb539948-33ce-4233-b5bc-965bbfd0d265n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to share (non-secret) variables between jobs

john levin
Simply parsing the required variables while triggering the downstream job.

stage ('Invoke_pipelineA') {
            steps {
                build job: 'pipelineA', parameters: [
                string(name: 'param1', value: "value1")
                ]
            }
        }
        

/BR
John

On Thu, 10 Sep, 2020, 6:17 am Ashish Sharma, <[hidden email]> wrote:
Dear All,

We have a bunch of jobs which will use some common variables like user names, urls etc (which are not secrets or credentials). Is there a way (or plugin maybe) to share these variables between jobs (something like credentials plugin for secrets).

TIA,
Ashish

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/cb539948-33ce-4233-b5bc-965bbfd0d265n%40googlegroups.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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAGJXh7qekzsg0oBFYmLP0yyP4HLoDHBLWT0Kz1N5E5RWnp-yDQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to share (non-secret) variables between jobs

Ashish Sharma-2
Hi John,

We don't have dependent (upstream-downstream) pipelines, these pipeline are in same hierarchy and triggered separately.
But since these are microservice for same project, we want to share some variables among these.

On Thursday, September 10, 2020 at 9:59:54 AM UTC+8 [hidden email] wrote:
Simply parsing the required variables while triggering the downstream job.

stage ('Invoke_pipelineA') {
            steps {
                build job: 'pipelineA', parameters: [
                string(name: 'param1', value: "value1")
                ]
            }
        }
        

/BR
John

On Thu, 10 Sep, 2020, 6:17 am Ashish Sharma, <[hidden email]> wrote:
Dear All,

We have a bunch of jobs which will use some common variables like user names, urls etc (which are not secrets or credentials). Is there a way (or plugin maybe) to share these variables between jobs (something like credentials plugin for secrets).

TIA,
Ashish

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/cb539948-33ce-4233-b5bc-965bbfd0d265n%40googlegroups.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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/5c42ac0f-7461-4d4a-ac78-ff53589f5181n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to share (non-secret) variables between jobs

john levin
Oh.. in that case I guess you have to handle it in your scripts only, if the values are dynamically created in one job and you have to pass to another which is not dependant.

May be you can check the job status and check if its running and then get some values from logs.


On Thu, 10 Sep, 2020, 7:59 am Ashish Sharma, <[hidden email]> wrote:
Hi John,

We don't have dependent (upstream-downstream) pipelines, these pipeline are in same hierarchy and triggered separately.
But since these are microservice for same project, we want to share some variables among these.

On Thursday, September 10, 2020 at 9:59:54 AM UTC+8 [hidden email] wrote:
Simply parsing the required variables while triggering the downstream job.

stage ('Invoke_pipelineA') {
            steps {
                build job: 'pipelineA', parameters: [
                string(name: 'param1', value: "value1")
                ]
            }
        }
        

/BR
John

On Thu, 10 Sep, 2020, 6:17 am Ashish Sharma, <[hidden email]> wrote:
Dear All,

We have a bunch of jobs which will use some common variables like user names, urls etc (which are not secrets or credentials). Is there a way (or plugin maybe) to share these variables between jobs (something like credentials plugin for secrets).

TIA,
Ashish

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/cb539948-33ce-4233-b5bc-965bbfd0d265n%40googlegroups.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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/5c42ac0f-7461-4d4a-ac78-ff53589f5181n%40googlegroups.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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAGJXh7q4cfv99m1MjA1Y5Ry%3D7Fn9G4t__tDhWxpRXQ1anm9orw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to share (non-secret) variables between jobs

Gianluca
In reply to this post by Ashish Sharma-2
You could maybe use https://www.jenkins.io/doc/book/pipeline/shared-libraries/ and load those variable from a global shared library and used inside the pipelines.


Il giorno giovedì 10 settembre 2020 alle 01:46:51 UTC+1 [hidden email] ha scritto:
Dear All,

We have a bunch of jobs which will use some common variables like user names, urls etc (which are not secrets or credentials). Is there a way (or plugin maybe) to share these variables between jobs (something like credentials plugin for secrets).

TIA,
Ashish

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/39f6c3f8-2880-445c-ac84-3cedb963d72an%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to share (non-secret) variables between jobs

Ashish Sharma-2
Thanks All, we are now saving these variables in shared groovy files and loading file in job pipeline to read variables. 

On Thursday, September 10, 2020 at 2:44:11 PM UTC+8 Gianluca wrote:
You could maybe use https://www.jenkins.io/doc/book/pipeline/shared-libraries/ and load those variable from a global shared library and used inside the pipelines.


Il giorno giovedì 10 settembre 2020 alle 01:46:51 UTC+1 [hidden email] ha scritto:
Dear All,

We have a bunch of jobs which will use some common variables like user names, urls etc (which are not secrets or credentials). Is there a way (or plugin maybe) to share these variables between jobs (something like credentials plugin for secrets).

TIA,
Ashish

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/de13b2f4-827f-4d17-a604-00bbf350a21dn%40googlegroups.com.