support with Jenkins configuration - docker

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?

Related

Jenkins using aws is not recognized as an internal or external command - Windows 10

Jenkin Project - I configure the Build setup in Batch file in below statement
aws s3 cp ./dist/first-ci-project s3://first-ci-cd-project --recursive
but result is
'aws' is not recognized as an internal or external command,
But Command Prompt i run the above command its working good. Pl help me.
Are you running the aws command in a jankins slave? If so please check whether aws cli command tool is installed on the slave and the location of the aws cli is added to the environment variables.
If you are running on the jenkins master, same as above. Please check if you have added the aws cli folder location is added as environment variable under jenkins master.
I had the similar issue, I had make sure that the user with which aws CLI is installed is same as the one which Jenkins is using during the runtime

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

Jenkins JNLP Slave in Kubernetes (non-numeric user - jenkins)

I am setting up Dynamic Jenkins slaves provision in Kubernetes.
The default jenkins/jnlp-slave:alpine works fine but I see this below error in Kubernetes Agent:
W0129 19:09:42.310410 26799 kuberuntime_container.go:191] Non-root verification doesn't support non-numeric user (jenkins)
The job is just to check the environment variables and it runs fine & gives a proper output. But why do we have this error message?
It seems an authentication problem.
Take a look at these following:
https://github.com/kubernetes/kubernetes/issues/45487
Jenkins kubernetes plugin not working
Hope this helps.

Jenkins Pipeline using Openshift

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

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