Jenkins Pipeline using Openshift - jenkins

I am trying to create a Jenkins pipeline on Openshift, that automatically runs a Jenkins service when we start the pipeline build. I referred few templates online and created a Jenkins pod and a pipeline. But whenever I try to run the pipeline, It shows build status as "not started.
Later, I created a standalone Jenkins service in Openshift, created a Jenkins file in open shift and tried executing it. I encountered authentication issues while connecting with Openshift from Jenkins.
Can anyone guide me, if I am missing something or any other working templates for a pipeline?
Thanks

It’s because of permissions
Jenkins runs with Jenkins user and openshift doesn’t know how to connect to it
Create a new service account in openshift jenkins

Related

How to write jenkinsfile that will access openshift and run few commands

I am new to Jenkins, can someone help me to write Jenkinsfile that access openshift run few of commands, and return the report
I know commands to run manually in open shift but don't know how to do in Jenkins
There are a few good introductions available on how to access OpenShift using the OpenShift Jenkins Plugin or on how to run generic commands using sh:
Using OpenShift Pipeline Plugin with External Jenkins
Building Declarative Pipelines with OpenShift DSL Plugin
More generic: Jenkins Pipeline: running external programs with sh

support with Jenkins configuration

I installed Jenkins on my -AWS EC2 Ubuntu- and on the same server I'm running Docker. what I'm trying to do is to build a pipeline via Jenkins on that EC2 Instance. my jenkinsfile stored on Github
When I run the pipeline I get the following error:
Jenkins’ doesn’t have label ‘docker'
How to solve this problem?
I went to manage Jenkins -> global tools and also to configure system
but non of these solve the problem.
Any suggestions?

Integration of Jenkins Job result in Gitlab

I'm currently improving the integration of Jenkins that we have in Gitlab CE 10.6.0.
For now, we had a webhook that trigger a pipeline in Jenkins. The job was executing fine, but in Gitlab we had only a pipeline shown has pending until it eventually failed, because no runner were installed.
I managed to improve the groovy script on Jenkins side to have the status shown in gitlab as well, as in the picture here :
My problem now is that the parent job is still shown has pending, and still not running. I have not installed Gitlab Runner on my server (mostly because I'm not the administrator of it) and I don't think that could be an option.
Any idea on how I could have only the Jenkins part shown, and not the internal Gitlab part of the pipeline ?
After more research, it appears that I had a gitlab-ci.yml file in my project that someone had comitted months ago but no one was using anymore...
So The solution was just to delete it to have the pipeline with only Jenkins steps

Failed to create docker image using docker slave plugin for jenkins

I am trying to create a jenkins job that will build a github project inside a docker container that shall be generated from the Dockerfile contained in the github project itself. To do so, I am using docker slaves plugin but I am running into an issue when I run the jenkins job.
Error during container provisioning
The configuration I am using for the jenkins job is the following:
jenkins job config
So the job right now should only clone the repo and build the image. Any suggestions?
The solution to the problem was to set the remoting image to jenkinsci/slave in the global configuration of jenkins
Jenkins global config

How do I pass on my build file from Jenkins to Saltstack master

We have a Jenkins system to automate build from Github, now we are implementing a Saltstack system. So I need to integrate my Jenkins with Salt-master so that it passes all the new builds to the master which then sends it across the salt-clients(minions).
The saltstack setup is in AWS cloud and and the Jenkins machine is outside the cloud in a local setup.
You could enable the salt-api and using the following plugin: https://wiki.jenkins-ci.org/display/JENKINS/saltstack-plugin then all of your jenkins builds can execute states / orchestrations etc. to any minions on a per job basis.
Another way of doing this is to have a minion running on the salt-master and install the jenkins slave on the same box. Then restrict the jenkins jobs to that jenkins slave and execute the commands as if you were at the command line. NOTE: this option requires a bit more configuration.

Resources