Skip to content

Commit

Permalink
added jenkins_installation file
Browse files Browse the repository at this point in the history
  • Loading branch information
yankils committed May 19, 2020
1 parent 23e7f6b commit 3513838
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 5 deletions.
80 changes: 80 additions & 0 deletions jenkins/jenkins_installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Install Jenkins on AWS EC2
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 Instance
- With Internet Access
- Security Group with Port `8080` open for internet
1. Java v1.8.x

## Install Java
1. We will be using open java for our demo, Get the latest version from http://openjdk.java.net/install/
```sh
yum install java-1.8*
#yum -y install java-1.8.0-openjdk-devel
```

1. Confirm Java Version and set the java home
```sh
java -version
find /usr/lib/jvm/java-1.8* | head -n 3
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-<Java version which seen in the above output>
export JAVA_HOME
PATH=$PATH:$JAVA_HOME
# To set it permanently update your .bash_profile
vi ~/.bash_profile
```
_The output should be something like this,_
```sh
[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 set up the repo so that we can update it easily in the future.
1. Get the latest version of jenkins from https://pkg.jenkins.io/redhat-stable/ and install
```sh
yum -y install wget
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
yum -y install jenkins
```

### Start Jenkins
```sh
# Start jenkins service
service jenkins start

# Setup Jenkins to start at boot,
chkconfig jenkins on
```

### 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 the Build section
Execute shell: echo "Welcome to Jenkins Demo"
1. Save your job
1. Build job
1. Check "console output"

10 changes: 5 additions & 5 deletions maven/How_to_deploy_warfile_on_tomcat_server_using_maven.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ Procedure
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat8-maven-plugin</artifactId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>TomcatServer</server>
<path>/helloworld-webapp</path>
</configuration>
</plugin>
</plugins>
</configuration>
</plugin>
</plugins>
```

1. create settings.xml for credentials
Expand Down

0 comments on commit 3513838

Please sign in to comment.