Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/safwanuddinmairaj/jenkins-learn
A collection of simple Jenkins pipelines and configurations for hands-on learning and practicing Continuous Integration (CI) concepts.
https://github.com/safwanuddinmairaj/jenkins-learn
aws devops docker jenkins
Last synced: about 1 month ago
JSON representation
A collection of simple Jenkins pipelines and configurations for hands-on learning and practicing Continuous Integration (CI) concepts.
- Host: GitHub
- URL: https://github.com/safwanuddinmairaj/jenkins-learn
- Owner: SafwanUddinMairaj
- Created: 2024-08-16T19:18:31.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-17T10:34:56.000Z (3 months ago)
- Last Synced: 2024-09-30T17:42:41.728Z (about 2 months ago)
- Topics: aws, devops, docker, jenkins
- Homepage:
- Size: 356 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Jenkins
## AWS EC2 Instance
- Go to AWS Console
- Instances(running)
- Launch instances### Install Jenkins.
Pre-Requisites:
- Java (JDK)### Run the below commands to install Java and Jenkins
Install Java
```
sudo apt update
sudo apt install openjdk-11-jre
```Verify Java is Installed
```
java -version
```Now, you can proceed with installing Jenkins
```
curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins
```**Note: ** By default, Jenkins will not be accessible to the external world due to the inbound traffic restriction by AWS. Open port 8080 in the inbound traffic rules as show below.
- EC2 > Instances > Click on
- In the bottom tabs -> Click on Security
- Security groups
- Add inbound traffic rules as shown in the image (you can just allow TCP 8080 as well, in my case, I allowed `All traffic`).### Login to Jenkins using the below URL:
http://:8080 [You can get the ec2-instance-public-ip-address from your AWS EC2 console page]
Note: If you are not interested in allowing `All Traffic` to your EC2 instance
1. Delete the inbound traffic rule for your instance
2. Edit the inbound traffic rule to only allow custom TCP port `8080`
After you login to Jenkins,
- Run the command to copy the Jenkins Admin Password - `sudo cat /var/lib/jenkins/secrets/initialAdminPassword`
- Enter the Administrator password
### Click on Install suggested plugins
Wait for the Jenkins to Install suggested plugins
Jenkins Installation is Successful. You can now play with jenkins
## Install the Docker Pipeline plugin in Jenkins:
- Log in to Jenkins.
- Go to Manage Jenkins > Manage Plugins.
- In the Available tab, search for "Docker Pipeline".
- Select the plugin and click the Install button.
- Restart Jenkins after the plugin is installed.
![alt text](image.png)Restart Jenkins, always remember to restart jenkins as it is important to get the changes and updates done seamlessly.
## Docker Slave Configuration
Run the below command to Install Docker
```
sudo apt update
sudo apt install docker.io
```
### Grant Jenkins user and Ubuntu user permission to docker deamon.```
sudo su -
usermod -aG docker jenkins
usermod -aG docker ubuntu
systemctl restart docker
```Restart Jenkins as it is a better approach
```
http://:8080/restart
```The docker agent configuration is now successful.