forked from miztiik/DevOps-Demos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mystique
committed
Aug 25, 2018
0 parents
commit 5c0693b
Showing
2 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Welcome To DevOps Repo | ||
This repository holds all of my experiments in the area of DevOps. | ||
|
||
Follow the demos in [YouTube](https://www.youtube.com/watch?v=8D46Pgbz0gg&list=PLxzKY3wu0_FJdJd3IKdiM4Om1hGo2Hsdt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Install Jenkins | ||
Jenkins is a self-contained Java-based program, ready to run out-of-the-box, with packages for Windows, Mac OS X and other Unix-like operating systems. As an extensible automation server, Jenkins can be used as a simple CI server or turned into the continuous delivery hub for any project. | ||
|
||
### Prerequisites | ||
1. EC2 RHEL 7.x Instance [Get help here](https://www.youtube.com/watch?v=KDtS6BzJo3A) | ||
- With Internet Access | ||
- Security Group with Port `8080` open for internet | ||
|
||
## Install Java | ||
We will be using open java for our demo, Get latest version from http://openjdk.java.net/install/ | ||
```sh | ||
yum install java-1.8* | ||
#yum -y install java-1.8.0-openjdk | ||
``` | ||
|
||
### Confirm Java Version | ||
Lets install java and set the java home | ||
```sh | ||
java -version | ||
find /usr/lib/jvm/java-1.8* | head -n 3 | ||
#JAVA_HOME= | ||
export JAVA_HOME | ||
PATH=$PATH:$JAVA_HOME | ||
# To set it permanently update your .bash_profile | ||
source ~/.bash_profile | ||
``` | ||
_The output should be something like this,_ | ||
``` | ||
[root@~]# java -version | ||
openjdk version "1.8.0_151" | ||
OpenJDK Runtime Environment (build 1.8.0_151-b12) | ||
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode) | ||
``` | ||
|
||
## Install Jenkins | ||
You can install jenkins using the rpm or by setting up the repo. We will setup the repo so that we can update it easily in future. | ||
Get latest version of jenkins from https://pkg.jenkins.io/redhat-stable/ | ||
```sh | ||
yum -y install wget | ||
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo | ||
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key | ||
yum -y install jenkins | ||
``` | ||
|
||
### Start Jenkins | ||
```sh | ||
# Start jenkins service | ||
systemctl start jenkins | ||
|
||
# Setup Jenkins to start at boot, | ||
systemctl enable jenkins | ||
``` | ||
|
||
#### Accessing Jenkins | ||
By default jenkins runs at port `8080`, You can access jenkins at | ||
```sh | ||
http://YOUR-SERVER-PUBLIC-IP:8080 | ||
``` | ||
#### Configure Jenkins | ||
- The default Username is `admin` | ||
- Grab the default password | ||
- Password Location:`/var/lib/jenkins/secrets/initialAdminPassword` | ||
- `Skip` Plugin Installation; _We can do it later_ | ||
- Change admin password | ||
- `Admin` > `Configure` > `Password` | ||
- Configure `java` path | ||
- `Manage Jenkins` > `Global Tool Configuration` > `JDK` | ||
- Create another admin user id | ||
|
||
### Test Jenkins Jobs | ||
1. Create “new item” | ||
1. Enter an item name – `My-First-Project` | ||
- Chose `Freestyle` project | ||
1. Under Build section | ||
Execute shell : echo "Welcome to Jenkins Demo" | ||
1. Save your job | ||
1. Build job | ||
1. Check "console output" | ||
|
||
### Next Step | ||
[ ] Setup Jenkins to run inside Tomcat Server |