=========
$ jenkins-jobs update --help
usage: jenkins-jobs update [-h] [-r] [-x
EXCLUDE] [--delete-old] [-p PLUGINS_INFO_PATH] [--workers
N_WORKERS] [--existing-only] [--enabled-only] [-j | -v]
[path] [names ...]
=========
Looks like your parameter, env=SAM is treated as job name that should be selected. But code sample you provided does not generate job with such a name, but only job named `$env_$jobname`.
JJB does not support variable expansion from environment
variables.
Vsevolod.
Hi everyone,
I want to create a job in JJB with name {env}_job...
Here I want to give env as input paramter.
============================================
- view-template:
name: '{env}_lstview'
description: 'My View Description'
view-type: list
regex: '{env}_.*' # Include all jobs
- job-template:
name: '{env}_{jobname}'
parameters:
- string:
name: env
default: DEF
- string:
name: jobname
default: sampl_job
customerName: customerName
description: "Jenkins Job Template with Custom Configuration"
builders:
- shell: 'ls'
- project:
name: CC
views:
- '{env}_lstview':
env: $env
jobs:
- '{env}_{jobname}':
env: $env
jobname: $jobname
==============================
jenkins_jobs]# jenkins-jobs --conf jenkins_jobs update sampjobs env=SAM
WARNING:jenkins_jobs.config:Config file, jenkins_jobs, not found. Using default config values.
INFO:jenkins_jobs.config:Will use anonymous access to Jenkins if needed.
INFO:jenkins_jobs.cli.subcommand.base:Updating jobs in [PosixPath('sampjobs')] (['env=SAM'])
INFO:jenkins_jobs.builder:Number of jobs generated: 0
INFO:jenkins_jobs.cli.subcommand.update:Number of jobs updated: 0
INFO:jenkins_jobs.builder:Number of views generated: 0
INFO:jenkins_jobs.cli.subcommand.update:Number of views updated: 0
but no job is getting generated.
Please help me resolve this issue.
Thanks,--
You received this message because you are subscribed to the Google Groups "jenkins-job-builder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkins-job-bui...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkins-job-builder/7426dd07-b5c3-4160-9f1d-0748797c3362n%40googlegroups.com.
Hi, Suman.
You can use several approaches for this.
Vsevolod.
Thank you for the reply,
Actually I have some 50 jobs to be created in different environments like DEV, STG, PRD.
So that is the reason im using env_jobname, but here evertime i cannot change env to DEV or PRD, because the jobs list may increase...
Is there any alternative to acheive this?
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkins-job-builder/f72eb6a8-0304-4b5a-ab54-06d855ed8081n%40googlegroups.com.