Tony
Tony

Reputation: 1155

Determining the type of Jenkins project

Ideally I would like to clone a jenkins project, but it is in say /dir1/dir2/dir3/dir4/dir5 and I am in /dir1/dir2/dir6/dir7/dir8 and I can "copy existing item from" but it does not offer a browse, and I don't know how to specify a project from a different directory. If someone knows, you could let me know.

In the meantime, I will just have two window open. One window displaying the current project and the other window creating a new one, and I will just copy the things over. My problem, and I bet it is very simple but I could not find out during research or else it is so simple I overlooked it ;-) Jenkins wants me to specify the type (Freestyle project, MultiJob Project, Maven project, Pipeline, etc) and I am not sure. I want to make it the same as the existing project, but I can't figure out how to tell what type the existing project is. It does check out files from SVN and build via Java.

Can someone tell me how to find out what type of project an existing maven project is?

Upvotes: 14

Views: 14647

Answers (4)

zenith13
zenith13

Reputation: 53

You can go to the script page on jenkins(http://replace_with_your_jenkins_url/script) and execute the below script:

def jenkins = Jenkins.getInstance()
def jobName = "name_of_your_job"
def job = jenkins.getItem(jobName)
println "Job type: ${job.getClass()}"

Upvotes: 3

timcoder
timcoder

Reputation: 31

On Jenkins' Dashboard, each project type has a different icon representation on the left of the project table. For example, Folder project has a Folder icon. When you hover your mouse over the icon, it will show a tooltip that is the project type.

Jenkins Dashboard Project Type Illustration

Upvotes: 3

CodeObsession
CodeObsession

Reputation: 145

You don't need to know the project type. Just click on 'New Item' and enter the name of the new project and enter the name of the project you want to clone from, in 'Copy from' input and click OK

Upvotes: 1

vashishth
vashishth

Reputation: 3370

There is no specific tag, but if you open a project, delete button have the type of project information available. pipleline project will have "Delete Pipeline" button, maven project will have "Delete Maven Project" button and a freestyle project will only have "Delete Project" button.

In addition one should have description text about this information.

Upvotes: 25

Related Questions