How to use jenkins for CI with perforce - jenkins

Looking for some information on how to setup Perforce and Jenkins for CI. Any kick start information will be greatly helpful.

You can use https://wiki.jenkins-ci.org/display/JENKINS/P4+Plugin
for Perforce Integration.
Also one of the key plugin you would need in future for CI would be https://wiki.jenkins-ci.org/display/JENKINS/Multijob+Plugin

You can use Perforce Plugin for jenkins. Check
this

Related

trigger a Jenkins from bamboo

My requirement:
My build pipeline is in Bamboo and Test integration pipeline is implemented in Jenkins. So once CI pipeline is completed in Bamboo, there should be a trigger from Bamboo to Jenkins job.
I'm aware this can be done via API call to Jenkins, however I also saw that there is some kind of plugin in Bamboo which can integrate with Jenkins.
I could not find the name of that plugin anywhere, can someone of you help me is providing the plugin name ?
Please do let me know for more question.
You might be referring to the following plugin: https://marketplace.atlassian.com/apps/1211284/webhook-to-jenkins-for-bitbucket. However, this plugin is for Bitbucket and not Bamboo. As far as I'm aware, there is no Jenkins specific plugin for Bamboo.
There is however a generic webhooks plugin for Bamboo: https://marketplace.atlassian.com/apps/1220844/webhooks-for-bamboo, which can be configured to trigger Jenkins at the end of a build.

How to move Jenkins towards IAAC?

We have got an old style Jenkins environment administration and managing Jobs using GUI . We are interested to move towards Infrastructure as a code. Could you please advise me on the transition plan and new tools required for this migration.
Any advise to choose between Jenkins builtin DSL or Groovy script to create pipelines?
Cheers,
Joseph
Write Declarative style Jenkins Pipeline
its easy and faat ro convert to IAC for jenkins job configuration.
I have mentioned link for your reference
https://www.jenkins.io/doc/book/pipeline/syntax/

Do I need build integration scripts to automate Checkmarx scan in Jenkins?

I want to automate Checkmarx scan in Jenkins. Means it has to trigger new scan for every build.
For that, do I need any build integration scripts? If I do, where can I find them?
If don't, do you know how can I achieve it?
Thank you in advance and appreciate your help.
As far as I understand the documentation of the Checkmarx CxSAST Jenkins Plugin the plugin enables automatic code scan on CxSAST server, upon each build triggered by Jenkins. So you may need to install a plugin and his dependencies.

How to enable SCM polling with the Jenkins Pipeline plugin

This is a question related to How to make SCM polling work with the Jenkins Workflow plugin. That thread answers how to use SCM polling in a pipeline script once SCM polling is enabled but does not cover how to enable SCM polling.
For example, if you wanted to use the mulit-branch pipeline plugin to create jobs automatically using a Jenkinsfile there is not a way I know of to have the "Poll SCM" option enabled in the job. This makes it difficult to provision on-demand environments such as creating a docker container that has the jobs setup from the beginning. Because you would have to sign-in to Jenkins and go to the configuration and select the "Poll SCM" option once the container was started. Cloudbees offers a template plugin to help solve this problem.
However this is not available to Jenkins using the free version. Is there any workaround or solution for users on the free version of Jenkins?
if you wanted to use the multi-branch pipeline plugin to create jobs automatically using a Jenkinsfile there is not a way I know of to have the "Poll SCM" option enabled in the job
Nor is any needed. Multibranch projects have a configurable polling interval for the branch indexing as a whole, which also serves as a per-branch build trigger, and will also receive webhooks automatically.
To answer the question how to enable SCM polling, you need to do the following.
Using the Pipeline Syntax generator and "properties: Set job properties" you can generate the following which will enable SCM polling.
properties([pipelineTriggers([pollSCM('H * * * *')])])
However as Jesse Glick points out for Multibranch pipelines you don't need to enable SCM polling.
I am thinking about the same problem.
If you are using a online Git service like Github or Bitbucket, I think you could use their Webhooks features to solve it. I have not been able to test the solution yet, but it should work.
In your Multibranch Pipeline configuration, enable the Trigger builds remotely option.
Then you need to enable your Github/Bitbucket Webhook on your repository, using the path (as described in the Jenkins configuration descrition): JENKINS_URL/job/test/build?token=TOKEN_NAME
In order to get my Bitbucket to connect to the web hook, I had to add the following to my declarative pipeline:
pipeline {
stages {
stage('Initialize') {
steps {
//enable remote triggers
script {
properties([pipelineTriggers([pollSCM('')])])
}
//define scm connection for polling
git branch: BRANCH_NAME, credentialsId: 'my-credentials', url: 'ssh://git#stash.server.fqdn/stash/my-project.git'
}
}
}
}
This allows to rebuild a branch, without scanning the entire multibranchiverse. This is especially valuable, when using Bitbucket Project /Github Team-multibranch projects. There a scan can take a few minutes, once you have a few repos/branches.
By directly being able to hook into the branch, you can get a build result much faster, and without any side effects.
NB: In a declarative pipeline the properties call has to be wrapped by a script-block.

Puppet Plugin for Jenkins

How to integrate Jenkins with Puppet?
As of now i am integrating Jenkins with Puppet. But We dont know which puppet plugin will support for jenkins. Can you please help on us.
It depends on what you want to achieve. If you simply want to deploy the manifests, there is no need for a puppet plugin. You could use the Publish over SSH plugin or something that let you push your code to the puppet master.
To actually execute puppet commands a generic job configuration would be fine.
If you are looking for a full chain of source control, tests and deployment for your manifests, you should take a look at Gerrit and how to integrate it with Jenkins using the Gerrit Trigger plugin

Resources