Continuous integration is there any job naming conventions in the jenkins
Asked Answered
S

3

10

I would like to know if we have any job naming conventions exist in the continuous integration. we are using Jenkins for Ci , please suggest .

naming conventions should be something like this , environment, service, purpose build or deploy etc.

any other suggestions are appreciated.

Survance answered 6/4, 2016 at 8:28 Comment(1)
to file under "any other suggestions" : wiki.jenkins.io/display/JENKINS/Jenkins+Best+PracticesStichous
S
5

I am using a convention that goes like this:

<primary purpose of the job | uppercase>_<(GitHub) project name>_<branch name / additional info>

So jobs would be named like

BUILD_my-project
DEPLOY_my-project_staging
TEST_my-project_staging
UTILITY_install-helpful-tool_staging
INFRA_run-job-dsl

To make things easier to maintain, especially when using the JobDSL I prefer to not have separate display names for jobs, at the cost of having both hyphens and underscores in job names.

Scatology answered 22/11, 2016 at 11:21 Comment(0)
C
1

It's a bit difficult to answer because there aren't official rules about naming conventions in Jenkins. Normally each organization is defining its own rules. (those rules could be about the repository-name, the project, the version, ...) It's useful to have name conventions when you're using a plugin like the nested view plugin. Think about what different types of jobs you will have an see if you can adopt a naming convention. Spaces in job names may make remote calling of this job hard so this isn't recommended.

Example of using name conventions in Jenkins:

For regular jobs, we name the Jenkins job after the git repository name. For example, the "ceph-deploy" package is at https://github.com/ceph/ceph-deploy, so the job name is "ceph-deploy".

Continental answered 6/4, 2016 at 9:42 Comment(1)
Yes , I agree with you. i just wanted to check if we can adopt something global conventions for naming the jobs in the industry. I am still open to discuss , however i am writing my own naming conventions to adoptSurvance
R
0

I think the best answer is: It depends. Each use case might need a self tailored convention.

The more teams that use the same Jenkins, the more complex the convention has to be in order to manage properly Roles and Permissions.

You can also lookup for Java/C#/python/powershell naming conventions to find useful ideas if you want to create your own convention.

In general, I would go for PREFIX_Name_SUFFIX:

- PREFIX: [a-zA-Z0-9]{3,5} (might be skipped if complexity level is low)
- Name: [a-zA-Z0-9-]+
- SUFFIX: [a-zA-Z0-9]{3,5} (might be skipped if complexity level is low)
Reprisal answered 10/1, 2020 at 19:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.