Unable to understand scm sync pop up message on Jenkins - jenkins

We are using Multi-branch pipeline Jenkins jobs with SCM sync
Configuration plugin installed. Since few days a warning is being popping up at the end of Jenkins console. Can anyone explain what it is trying to inform us.
Error: Delete jobs/wbe-middle-layer-inbound/branches/feature-LMS-4271-Release2.83lj1k
Here we in git we don't have branch feature-LMS-4271-Release2.83lj1k under wbe-middle-layer-inbound repo but having feature-LMS-4271-Release2.

Periodically the multi-branch pipeline job just scan your repo to determine if any of it's branches meet the criteria for a pipeline to be created for them. It also tells you the pipelines it deletes because the branch that it was matched to is no longer there. Could that be what you're seeing?

Related

Jenkins BlueOcean stuck at "Pipeline Creation Pending."

My pipeline creation is stuck at pending stage on Jenkins server. Nothing shows up on dashboard even after an hour. Tried multiple times but no luck.
When I try from my local Jenkins, it easily creates the pipeline for the same Git repository.
Solved this by updating Git API and Blueocean plugins in Jenkins to the latest version.

jenkins Multibranch pipeline plan runs with bitbucket merge event

I need to run jenkin plan branch from bitbucket merge event.I have configure the jenkin plan branch source behaviours to discover merging pull request and identified when the time i have save that configs the plan get activated. Then the second code merge happen plan will not invoke.
Jenkin can not identify branch indexing for Multibranch pipeline plans.Can some one help me with this issue.I do not need to config webhooks from bitbucket server.

Can't configure Scan Multibranch Pipeline Triggers in Jenkins Pipeline

In our Jenkins pipeline setup, I am only able to view configuration for Repo and Branch level. Scan Multibranch Pipeline Triggers is set for 1 day. I think because of this setting Scan periodically starts rebuilding all the BitBucket pull requests when it sees changes on the source branch. I want to disable this auto-building somehow, configuration settings are not an option. Even though I am an administrator on Jenkins with full power, I get the following message when I view configuration "username missing the Job/Configure permission" . Is there any way to fix this setting or something I can do in the Jenkinsfile to prevent building PRs every time there is a new MultiBranch Pipeline scan.

Jenkins Pipeline - How to maintain over time

I am currently using Cloudbees Jenkins Coreas my Jenkins solution.
I am using Jenkins Pipelines to write our Jenkins job configuration. These pipelines are stored in GitHub repositories. Each Jenkins job when created is connected to a GitHub Repository where the source code is pulled from, and that's where the Jenkinsfile is stored and Jenkins reads from.
Below are some high-level photos for how our Jenkins jobs are configured.
The advantage of the way these jobs are configured is the Jenkinsfile is always read from the master branch. Meaning if a rouge developer tries to remove stages from the Jenkinsfile from within there own branch, it doesn't matter because the Jenkinsfile is always read from the master branch (which is always protected).
However, the one massive drawback to this - is how do teams and developers who are devops engineerings make changes to the Jenkinsfile? For example, let's say a developer creates a branch called feature-jenkins-search and they edit the Jenkinsfile adding a new stage in the pipeline. Whenever they push these changes to GitHub to test - they can't test as it's always read from the master branch? Meaning devops engineerings have to work directly on the master branch? Surely this is not the best way to go and there is a better configuration to set?
We do want to still provide the security that if a developer is rougue and
You should really look into the Jenkins multi-branch pipeline feature. The Jenkins multi-branch pipeline allows to create a single configuration item in Jenkins (a bit like a folder) that can detect all the branches and pull requests in a GitHub repository with a Jenkinsfile and build them using automatically created jobs. Inside this multi-branch pipeline object when it is configured in Jenkins, you will find a number of jobs to build the various branches and pull-requests in the GitHub repository.
So your developers should maintain a Jenkinsfile in every branch they work on in GitHub to build that branch in your Jenkins server.
It is possible to make the Jenkinsfile do branch specific handling if required with conditional stages / when conditions in the Jenkinsfile pipelines in each branch.
You can lock down the master branch so that code and Jenkinsfile changes from other branches can only be merged with an approved PR (pull request). There is good integration between Jenkins and GitHub such that you can configure the master branch to only allow a PR to be merged if the PR is buildable in Jenkins. So if developers add new stages / processing to a Jenkinsfile on a branch being merged to master, it should be validated so that builds of your master branch are not broken.
There is a lot of configurability in the Jenkins multi-branch pipeline object for detection and handling of branches and it may be necessary to experiment to get it right for what you need with your team. If you cannot find this feature in Jenkins, it is probably because the correct Jenkins pipeline and GitHub related plugins are not installed.
You could also have a look at a similar Jenkins feature called the Jenkins GitHub Organization Folder which allows to detect and build all repos and branches at a GitHub Organization level. But when starting out, I would suggest to look into the multi-branch pipeline at the single repo level first.
These features are discussed in the Jenkins pipeline documentation. We use these features with our internal GitHub and Jenkins server and it works very well.
I think you will find the idea of using a single Jenkinsfile in the master branch to be used for building all branches is unworkable, as you have seen!

Jenkins pipeline automatic branch detection

I am migrating my old Jenkins free-style job to multi-branch pipeline. I also want to use GitLab hook with them.
My problem is the branch detection. I am doing it manually but I want it to be automatic: when a new branch is pushed to git, GitLab trigger a Jenkins job that trigger the branch detection if the branch parameter from GitLab is not known for Jenkins at the moment. Is this possible to do it or doesn't this exist?
FYI: I tried to launch the multi-branch pipeline job but Jenkins says:
ERROR: No parameterized job named XXX found.
Enable "Build Periodcally" in your multibranch job configuration and the branch indexing will automatically started.
What you really need is a branch source plugin for GitLab with webhook integration, which is tracked as an RFE in JIRA.
Failing that, use a plain Git branch source and configure GitLab to send Jenkins notifications to /git/notifyCommit (IIRC) as documented on the Git plugin wiki. Need specify only a url, no other details. The branch indexing this triggers should both detect new or removed branches, and changes to the head of an existing branch, and schedule builds accordingly.
You can set webhook in GitLab for push events and URL like http://<yourserver>/git/notifyCommit?url=<URL of the Git repository>.
See https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin#GitPlugin-Pushnotificationfromrepository
GitLab notifies Jenkins on push events which should trigger branch detection also for multibranch pipeline.
I didn't receive the answer I wanted and I ran into this issue today that answered the question :
https://github.com/jenkinsci/gitlab-plugin/issues/298
TLDR: Multi-branch pipeline are not supported yet to be triggered by gitlab commit easily. There is a workaround. Look at the link above.

Resources