Install and Configure Jenkins on GCE

Jai Chenchlani
Apr 21, 2022

Installation:

  1. Spin up a VM with CentOS
  2. sudo yum install wget -y This is needed as wget is not installed on centos base image
  3. sudo yum install git -y This will be needed to integrate Jenkins with GitHub
  4. Follow the steps below to install Jenkins.
sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
sudo yum install java-11-openjdk -y
sudo yum install jenkins -y
sudo systemctl daemon-reload

Configuration:

  1. Configure Jenkins (Log in using Admin password, Create users, etc.)
  2. ssh-keygen -t rsa #Create credentials to connect to GitHub. Note the private and public key folder locations. You will need those.
  3. Create Jenkins “SSH Username and SSH key” Credentials using the private key.
  4. Add ‘Deploy Key’ to your GitHub repo using the public key.
  5. ssh -T git@github.com # Test the connection
  6. Create a quick test pipeline to test.

--

--

Jai Chenchlani

Profession: Cloud Architect; Passion: Technology; Interests: Stand-up Comedy, Politics, Music.