DEV Community

muckitymuck
muckitymuck

Posted on

GITHUB! Jenkins, pipeline

As a record of how to set up a new CI/CD pipeline from Github to Jenkins:

A good first step is to install Jenkins on a separate machine or VM to get this started.

https://www.jenkins.io/doc/book/installing/
You can pick Linux, Docker, Kubernetes. What ever is your preference as long as you can get the webserver running.

We will start by assuming you have a github repo and you set up the credentials such as tokens correctly.

image

Open a new pipeline and choose Github.
image

Enter your github token to access it initially for the wizard.
image
If you are associated with multiple accounts or organizations, pick the one of your choosing and then the repo from the list provided.
image
The fun part starts, you can start adding steps and actions. It even comes with a choice for Git.

One you are done you can run it, but it probably won't work if the repo is private. So we will need to add the login info.
image
You will find this under Configure of your Pipeline.
image
Because of Github security you will need your Token once more. It will be protected much like Github Secrets.
image

We will add the target machine. Go to the main page of Jenkins.
And click on Manage Jenkins.
image
Give it a new name. Go back to Main Dashboard and Manage Nodes. Click on the new node.
jenkinsMachine

Go under Configure and give it a name.
jenkinsMachine2
Add the IP address and credentials for the SSH.

This should do it to pull from github and apply to the target machine.

Top comments (0)