- Dockerhub and Github Account
- Server with linux setup. For this case ubuntu
- Your application is already configured on your test instances
- This tutorial assumes you have set up a Jenkins file in your project. View reference and make necessary changes
sudo apt update
search of all available packages & pick one from the options
sudo apt search openjdk
For this case I will be using version 11, so
sudo apt install openjdk-11-jdk
Confirm installation with running version check
Now we are ready to install Jenkins. We start off by appending the Debian package repository address to the server's sources.list
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add - sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > \
We'll run update so that apt will use the new repo
sudo apt-get update
sudo apt-get install jenkins=2.289.3
Login into your Github, and head over to your developer settings :
Profile -> Settings -> Developer settings -> Personal access tokens
Note: I wouldn't consider this optional but it's good practice to set an expiration duration for your token.
repo: *repo_status*. Jenkins likes to access the repo commit status
Click "Generate token" and save your token somewhere.
1.SSH in your Jenkins instance
2.To retrieve your temporary password
sudo "cat /var/lib/jenkins/secrets/initialAdminPassword"
4.Paste retrieved password into Jenkins start up page.
5.Go ahead and set up a permanent admin user on Jenkins
1.Log into Jenkins
2.Set up credentials in Jenkins will use to login into servers.
Click Credentials -> click global -> click add credentials and input your instance username: deploy, password :+++++, id: webserver_login
3.Set up docker hub credentials too:
username: username, password :access-token, id: docker_hub_login
4.Set up global properties in Jenkins for staging server
Click "Manage Jenkins" - "Configure System" - "Global properties and select Environment Variables" -> Add
input "name: staging_ip" and "value:staging-ip-address"
5.Set up Jenkins project
Give your project a name -> Select Multibranch pipeline for project type
Under branch sources: click add source ->
Enter the details and use your GitHub access token as password and Github username as the username, set id e.g "github_key" and description
github_key for credentials
Input your GitHub name into owner field
Set repository as intended repo
Go a head and Save
Jenkins will scan your repo and run an initial build
Click Jenkins, In the project - click
Powering up and down developer AWS instances using Slack and Jenkins