diff --git a/JENKINS-INSTALLATION/Jenkins-Docker-Installation.md b/JENKINS-INSTALLATION/Jenkins-Docker-Installation.md new file mode 100644 index 00000000..7182ae0a --- /dev/null +++ b/JENKINS-INSTALLATION/Jenkins-Docker-Installation.md @@ -0,0 +1,69 @@ + +# Jenkins Installation And Setup In AWS EC2 Ubuntu or Amazon Linux Instnace Using Docker. + +#### Prerequisite + + AWS Acccount. + + Create Ubuntu or Amazon Linux EC2 t2.medium Instance with 4GB RAM. + + Create Security Group and open Required ports. + + 8080 got Jenkins, ..etc + + Attach Security Group to EC2 Instance. + + +## Step 1 +### A. Install Docker on Ubuntu +``` sh +sudo apt-get update +sudo apt-get install docker.io -y +``` +--------OR--------- + +### B. Install Docker on Amazon Linux +``` sh +sudo yum install docker-io +sudo service docker start +``` + +## Step 2 +## Run Jenkins Using Docker +``` sh +sudo docker run --name jenkins -p 8080:8080 -d --restart=on-failure jenkins/jenkins:lts-jdk11 +``` + + +## Step 3 +## Retrieve Jenkins Password +``` sh +sudo docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword +``` +password will be display, copy the password and use to login to Jenkins server on the browser + + + + +## Step 4 +## Access Jenkins from the browser +```sh +public-ip:8080 +curl ifconfig.co +``` + + + +## Jenkins Nexus Integration (WIP) +## Access Jenkins from the browser + +In your Jenkins docker server, run these commands: + +```sh +docker exec -u 0 -it jenkins bash +``` + + +```sh +apt-get update +apt-get install nano +nano /var/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/maven3.*.*/conf/settings.xml +``` +Add nexus repo url to the distributionManagement tag in Pom.xml (in your GitHub repo) + +(Replace * with the version of maven tool you installed in Jenkins) diff --git a/JENKINS-INSTALLATION/Jenkins-redhat8-installation-userdata b/JENKINS-INSTALLATION/Jenkins-redhat8-installation-userdata new file mode 100644 index 00000000..d03735c5 --- /dev/null +++ b/JENKINS-INSTALLATION/Jenkins-redhat8-installation-userdata @@ -0,0 +1,10 @@ +#!/bin/bash +sudo hostnamectl set-hostname jenkins +sudo yum -y install unzip wget tree git +sudo yum install java-11-openjdk -y +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-2023.key +sudo yum -y install jenkins --nobest +sudo systemctl start jenkins +sudo systemctl enable jenkins +sudo systemctl status jenkins diff --git a/JENKINS-INSTALLATION/READme.md b/JENKINS-INSTALLATION/READme.md index c11b6cfd..51a9e9c3 100644 --- a/JENKINS-INSTALLATION/READme.md +++ b/JENKINS-INSTALLATION/READme.md @@ -17,7 +17,7 @@ ### Install other softwares - git, unzip and wget ``` sh -sudo hostnamectl set-hostname ci +sudo hostnamectl set-hostname jenkins sudo yum -y install unzip wget tree git sudo yum install java-11-openjdk -y ``` @@ -28,6 +28,13 @@ cd /etc/yum.repos.d/ sudo curl -O https://pkg.jenkins.io/redhat-stable/jenkins.repo ``` +### Add Jenkins Repository and key (Use this) +```sh +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-2023.key +``` + + ## Install Jenkins ```sh sudo yum -y install jenkins --nobest diff --git a/Maven-installation/READme.md b/Maven-installation/READme.md index 2594fbb2..175504b1 100644 --- a/Maven-installation/READme.md +++ b/Maven-installation/READme.md @@ -15,11 +15,17 @@ ### Install Java JDK 11+ and other softares (GIT, wget and tree) + ``` sh -# install Java JDK 11+ as a pre-requisit for maven to run. +# set hostname as maven. sudo hostnamectl set-hostname maven sudo su - ec2-user + +``` + +``` sh +# install Java JDK 11+ as a pre-requisite for maven to run. cd /opt sudo yum install wget nano tree unzip git-all -y sudo yum install java-11-openjdk-devel java-1.8.0-openjdk-devel -y @@ -30,10 +36,10 @@ git --version ## 2. Download, extract and Install Maven ``` sh #Step1) Download the Maven Software -sudo wget https://dlcdn.apache.org/maven/maven-3/3.9.2/binaries/apache-maven-3.9.2-bin.zip -sudo unzip apache-maven-3.9.2-bin.zip -sudo rm -rf apache-maven-3.9.2-bin.zip -sudo mv apache-maven-3.9.2/ maven +sudo wget https://dlcdn.apache.org/maven/maven-3/3.9.3/binaries/apache-maven-3.9.3-bin.zip +sudo unzip apache-maven-3.9.3-bin.zip +sudo rm -rf apache-maven-3.9.3-bin.zip +sudo mv apache-maven-3.9.3/ maven ``` ## .#Step3) Set Environmental Variable - For Specific User eg ec2-user ``` sh diff --git a/Tomcat-installation/READme.md b/Tomcat-installation/READme.md index cd76f1c6..f9946e23 100644 --- a/Tomcat-installation/READme.md +++ b/Tomcat-installation/READme.md @@ -17,21 +17,25 @@ # change hostname to tomcat sudo hostnamectl set-hostname tomcat sudo su - ec2-user -cd /opt +``` + + +``` sh # install Java JDK 1.8+ as a pre-requisit for tomcat to run. +cd /opt sudo yum install git wget -y sudo yum install java-1.8.0-openjdk-devel -y # install wget unzip packages. sudo yum install wget unzip -y ``` -## Install Tomcat version 9.0.75 +## Install Tomcat version 9.0.76 ### Download and extract the tomcat server ``` sh -sudo wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.75/bin/apache-tomcat-9.0.75.zip -sudo unzip apache-tomcat-9.0.75.zip -sudo rm -rf apache-tomcat-9.0.75.zip +sudo wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.76/bin/apache-tomcat-9.0.76.zip +sudo unzip apache-tomcat-9.0.76.zip +sudo rm -rf apache-tomcat-9.0.76.zip ### rename tomcat for good naming convention -sudo mv apache-tomcat-9.0.75 tomcat9 +sudo mv apache-tomcat-9.0.76 tomcat9 ### assign executable permissions to the tomcat home directory sudo chmod 777 -R /opt/tomcat9 sudo chown ec2-user -R /opt/tomcat9 diff --git a/kubeadm/READme.md b/kubeadm/READme.md index d9f41277..15bb2294 100644 --- a/kubeadm/READme.md +++ b/kubeadm/READme.md @@ -27,6 +27,7 @@ sudo -i #i1) Switch to root user [ sudo -i] sudo hostnamectl set-hostname node1 +# sudo hostnamectl set-hostname $1 #2) Disable swap & add kernel settings