0
0
Jenkinsdevops~10 mins

Organization folders in Jenkins - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a new Organization Folder in Jenkins using the Jenkins CLI.

Jenkins
java -jar jenkins-cli.jar -s http://jenkins.example.com create-job [1] < orgfolder-config.xml
Drag options to blanks, or click blank then click option'
AMyOrgFolder
BNewJob
CPipelineJob
DSimpleFolder
Attempts:
3 left
💡 Hint
Common Mistakes
Using a job name instead of an organization folder name.
2fill in blank
medium

Complete the code to list all Organization Folders in Jenkins using the REST API.

Jenkins
curl -s http://jenkins.example.com/api/json?tree=jobs[name,[1]] | jq '.'
Drag options to blanks, or click blank then click option'
Acolor
Bclass
Cdescription
Durl
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'url' or 'color' which do not identify job types.
3fill in blank
hard

Fix the error in the Jenkins pipeline script to create an Organization Folder using the Jenkins Job DSL plugin.

Jenkins
organizationFolder('[1]') {
  displayName('My Organization')
}
Drag options to blanks, or click blank then click option'
Asimple-folder
Bpipeline-job
Cmy-org-folder
Dfreestyle-job
Attempts:
3 left
💡 Hint
Common Mistakes
Using job names instead of folder names.
4fill in blank
hard

Fill both blanks to configure an Organization Folder with a source and a strategy in Jenkins Job DSL.

Jenkins
organizationFolder('MyOrg') {
  [1] {
    id('github')
  }
  [2] {
    strategy('AllBranches')
  }
}
Drag options to blanks, or click blank then click option'
Asources
Btriggers
Cscm
DfolderProperties
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'triggers' or 'scm' incorrectly in this context.
5fill in blank
hard

Fill all three blanks to define an Organization Folder with a GitHub source, a branch discovery strategy, and a trigger in Jenkins Job DSL.

Jenkins
organizationFolder('MyOrg') {
  sources {
    [1] {
      id('github')
      repoOwner('my-org')
      repository('my-repo')
    }
  }
  [2] {
    strategy('DiscoverBranches')
  }
  [3] {
    cron('H/15 * * * *')
  }
}
Drag options to blanks, or click blank then click option'
Agithub
BfolderProperties
Ctriggers
Dscm
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up 'scm' and 'github' or placing triggers incorrectly.