You are on page 1of 20

JENKINS

Continous Integration:
Continuous Integration (CI) is a development practice that requires developers
to integrate code into a shared repository several times a day. Each check-in is then verified by an
automated build, allowing teams to detect problems early.

Different kinds of Activities do in CI(Continous Integration):


1. Get the code from version control (Git)
2. Execute the build/compile
3. Execute the unit tests and get the code coverage
4. Execute the Automated functional tests
5. Any other Tests Required
6. Execute static code analysis
7. Deploy the Artifact/build generated to Build Repository
8. Deliver the Artifact/build generated to test machine

CI Tools:
Team City, Jenkins, Bamboo

Jenkins Installation:
Create the AWS Ubuntu system .....
sai.krishna@Testing005-PC MINGW64 /d/Softwares/Devops

$ ssh -i "chefpractice.pem" ubuntu@ec2-13-59-189-130.us-east-2.compute.amazonaws.com


The authenticity of host 'ec2-13-59-189-130.us-east-2.compute.amazonaws.com
(13.59.189.130)' can't be established.
ECDSA key fingerprint is SHA256:QeNnZjFvAars2Q3xgqjZbHhgB2x1MY6WMCKAK/Unf3E.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ec2-13-59-189-130.us-east-
2.compute.amazonaws.com,13.59.189.130' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-125-generic x86_64)

* Documentation: https://help.ubuntu.com/

System information as of Thu Aug 31 04:39:05 UTC 2017

System load: 0.0 Memory usage: 5% Processes: 82


Usage of /: 10.1% of 7.74GB Swap usage: 0% Users logged in: 0

Graph this data and manage this system at:


https://landscape.canonical.com/

Get cloud support with Ubuntu Advantage Cloud Guest:


http://www.ubuntu.com/business/services/cloud

0 packages can be updated.


0 updates are security updates.

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by


applicable law.

ubuntu@ip-172-31-41-146:~$ pwd
/home/ubuntu
ubuntu@ip-172-31-41-146:~$ sudo -i
root@ip-172-31-41-146:~# apt-get update

Install Java:
>apt-get install openjdk-7-jdk

Install Jenkins:(Standlone)
root@ip-172-31-41-146:~# pwd
/root
root@ip-172-31-41-146:~# exit
logout
ubuntu@ip-172-31-41-146:~$ pwd
/home/ubuntu
ubuntu@ip-172-31-41-146:~$ mkdir jenkins_install
ubuntu@ip-172-31-41-146:~$ ls
jenkins_install
ubuntu@ip-172-31-41-146:~$ cd jenkins_install
ubuntu@ip-172-31-41-146:~/jenkins_install$ wget http://ftp.yz.yamagata-
u.ac.jp/pub/misc/jenkins/war-stable/2.19.1/jenkins.war
--2017-08-31 05:28:13-- http://ftp.yz.yamagata-u.ac.jp/pub/misc/jenkins/war-
stable/2.19.1/jenkins.war
Resolving ftp.yz.yamagata-u.ac.jp (ftp.yz.yamagata-u.ac.jp)... 133.24.248.19,
133.24.248.16, 133.24.248.17, ...
Connecting to ftp.yz.yamagata-u.ac.jp (ftp.yz.yamagata-u.ac.jp)|133.24.248.19|:80...
connected.
HTTP request sent, awaiting response... 200 OK
Length: 69754011 (67M)
Saving to: ‘jenkins.war’

100%[======================================>] 69,754,011 8.97MB/s in 11s

2017-08-31 05:28:25 (5.91 MB/s) - ‘jenkins.war’ saved [69754011/69754011]

ubuntu@ip-172-31-41-146:~/jenkins_install$ ls -l
total 68120
-rw-rw-r-- 1 ubuntu ubuntu 69754011 Oct 3 2016 jenkins.war
ubuntu@ip-172-31-41-146:~/jenkins_install$ java -jar jenkins.war
to open jenkins frequently we have to execute the above command
Running from: /home/ubuntu/jenkins_install/jenkins.war
webroot: $user.home/.jenkins
Aug 31, 2017 5:28:49 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Logging initialized @711ms
Aug 31, 2017 5:28:49 AM winstone.Logger logInternal
INFO: Beginning extraction from war file
Aug 31, 2017 5:28:51 AM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Empty contextPath
Aug 31, 2017 5:28:51 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: jetty-9.2.z-SNAPSHOT
Aug 31, 2017 5:28:52 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
Jenkins home directory: /home/ubuntu/.jenkins found at: $user.home/.jenkins
Aug 31, 2017 5:28:53 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started w.@1f4fc5e5{/,file:/home/ubuntu/.jenkins/war/,AVAILABLE}
{/home/ubuntu/.jenkins/war}
Aug 31, 2017 5:28:53 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started ServerConnector@48e76661{HTTP/1.1}{0.0.0.0:8080}
Aug 31, 2017 5:28:53 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started @3993ms
Aug 31, 2017 5:28:53 AM winstone.Logger logInternal
INFO: Winstone Servlet Engine v2.0 running: controlPort=disabled
Aug 31, 2017 5:28:53 AM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Aug 31, 2017 5:28:53 AM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Aug 31, 2017 5:28:55 AM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Aug 31, 2017 5:28:55 AM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Aug 31, 2017 5:28:55 AM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Aug 31, 2017 5:28:57 AM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Aug 31, 2017 5:28:57 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Started Download metadata
Aug 31, 2017 5:28:58 AM org.jenkinsci.main.modules.sshd.SSHD start
INFO: Started SSHD at port 53132
Aug 31, 2017 5:28:58 AM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
Aug 31, 2017 5:29:00 AM org.springframework.context.support.AbstractApplicationContext
prepareRefresh
INFO: Refreshing
org.springframework.web.context.support.StaticWebApplicationContext@4eae95ba: display
name [Root WebApplicationContext]; startup date [Thu Aug 31 05:29:00 UTC 2017]; root of
context hierarchy
Aug 31, 2017 5:29:00 AM org.springframework.context.support.AbstractApplicationContext
obtainFreshBeanFactory
INFO: Bean factory for application context
[org.springframework.web.context.support.StaticWebApplicationContext@4eae95ba]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@5a16d652
Aug 31, 2017 5:29:00 AM
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons
INFO: Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@5a16d652: defining
beans [authenticationManager]; root of factory hierarchy
Aug 31, 2017 5:29:01 AM org.springframework.context.support.AbstractApplicationContext
prepareRefresh
INFO: Refreshing
org.springframework.web.context.support.StaticWebApplicationContext@2be3b933: display
name [Root WebApplicationContext]; startup date [Thu Aug 31 05:29:01 UTC 2017]; root of
context hierarchy
Aug 31, 2017 5:29:01 AM org.springframework.context.support.AbstractApplicationContext
obtainFreshBeanFactory
INFO: Bean factory for application context
[org.springframework.web.context.support.StaticWebApplicationContext@2be3b933]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@4758581d
Aug 31, 2017 5:29:01 AM
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons
INFO: Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@4758581d: defining
beans [filter,legacy]; root of factory hierarchy
Aug 31, 2017 5:29:02 AM jenkins.install.SetupWizard init
INFO:

*************************************************************
*************************************************************
*************************************************************

Jenkins initial setup is required. An admin user has been created and a password
generated.
Please use the following password to proceed to installation:

426e1b0ba3de4b77bda4d2e11f745060

This may also be found at: /home/ubuntu/.jenkins/secrets/initialAdminPassword

*************************************************************
*************************************************************
*************************************************************

Aug 31, 2017 5:29:04 AM hudson.model.UpdateSite updateData


INFO: Obtained the latest update center data file for UpdateSource default
Aug 31, 2017 5:29:04 AM hudson.model.DownloadService$Downloadable load
INFO: Obtained the updated data file for hudson.tasks.Maven.MavenInstaller
Aug 31, 2017 5:29:06 AM hudson.model.DownloadService$Downloadable load
INFO: Obtained the updated data file for hudson.tools.JDKInstaller
Aug 31, 2017 5:29:06 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Finished Download metadata. 8,446 ms
Aug 31, 2017 5:29:07 AM hudson.model.UpdateSite updateData
INFO: Obtained the latest update center data file for UpdateSource default
Aug 31, 2017 5:29:07 AM hudson.WebAppMain$3 run
INFO: Jenkins is fully up and running

From the AWS take the


IPv4 Public IP 13.59.189.130

http://13.59.189.130:8080

The Above url will Open the Jenkins Logi Page as Follows

Enter Login Details and creat a project named my first pro and execute shell script “echo
“first project description” ” and Execute build
Aug 31, 2017 5:54:44 AM hudson.model.Run execute
INFO: myfirstpro #1 main build action completed: SUCCESS
Aug 31, 2017 5:54:49 AM hudson.model.Run execute
INFO: myfirstpro #2 main build action completed: SUCCESS
Aug 31, 2017 5:54:57 AM hudson.model.Run execute
INFO: myfirstpro #3 main build action completed: SUCCESS

Jenkins ----------- Username: kishankrishnan


Password: drdo.kishan202
ubuntu@ip-172-31-41-146:~/jenkins_install$ ls -la
total 68128
drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 31 05:28 .
drwxr-xr-x 8 ubuntu ubuntu 4096 Aug 31 05:38 ..
-rw-rw-r-- 1 ubuntu ubuntu 69754011 Oct 3 2016 jenkins.war
ubuntu@ip-172-31-41-146:~/jenkins_install$ cd ~
ubuntu@ip-172-31-41-146:~$ la -la
total 44
drwxr-xr-x 8 ubuntu ubuntu 4096 Aug 31 05:38 .
drwxr-xr-x 3 root root 4096 Aug 31 04:39 ..
-rw-r--r-- 1 ubuntu ubuntu 220 Apr 9 2014 .bash_logout
-rw-r--r-- 1 ubuntu ubuntu 3637 Apr 9 2014 .bashrc
drwx------ 2 ubuntu ubuntu 4096 Aug 31 05:01 .cache
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 05:38 .groovy
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 05:28 .java
drwxrwxr-x 13 ubuntu ubuntu 4096 Aug 31 06:13 .jenkins
drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 31 05:28 jenkins_install
-rw-r--r-- 1 ubuntu ubuntu 675 Apr 9 2014 .profile
drwx------ 2 ubuntu ubuntu 4096 Aug 31 04:39 .ssh
ubuntu@ip-172-31-41-146:~$ ls -la
total 44
drwxr-xr-x 8 ubuntu ubuntu 4096 Aug 31 05:38 .
drwxr-xr-x 3 root root 4096 Aug 31 04:39 ..
-rw-r--r-- 1 ubuntu ubuntu 220 Apr 9 2014 .bash_logout
-rw-r--r-- 1 ubuntu ubuntu 3637 Apr 9 2014 .bashrc
drwx------ 2 ubuntu ubuntu 4096 Aug 31 05:01 .cache
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 05:38 .groovy
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 05:28 .java
drwxrwxr-x 13 ubuntu ubuntu 4096 Aug 31 06:13 .jenkins
drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 31 05:28 jenkins_install
-rw-r--r-- 1 ubuntu ubuntu 675 Apr 9 2014 .profile
drwx------ 2 ubuntu ubuntu 4096 Aug 31 04:39 .ssh
ubuntu@ip-172-31-41-146:~$ cd .jenkins
ubuntu@ip-172-31-41-146:~/.jenkins$ ls -la
total 96
drwxrwxr-x 13 ubuntu ubuntu 4096 Aug 31 06:13 .
drwxr-xr-x 8 ubuntu ubuntu 4096 Aug 31 05:38 ..
-rw-rw-r-- 1 ubuntu ubuntu 1592 Aug 31 05:29 config.xml
-rw-rw-r-- 1 ubuntu ubuntu 159 Aug 31 05:28 hudson.model.UpdateCenter.xml
-rw-rw-r-- 1 ubuntu ubuntu 370 Aug 31 05:38 hudson.plugins.git.GitTool.xml
-rw------- 1 ubuntu ubuntu 1712 Aug 31 05:28 identity.key.enc
-rw-rw-r-- 1 ubuntu ubuntu 6 Aug 31 05:40
jenkins.install.InstallUtil.lastExecVersion
-rw-rw-r-- 1 ubuntu ubuntu 6 Aug 31 05:40 jenkins.install.UpgradeWizard.state
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 05:53 jobs
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 05:28 logs
-rw-rw-r-- 1 ubuntu ubuntu 907 Aug 31 05:28 nodeMonitors.xml
drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 31 05:28 nodes
drwxrwxr-x 74 ubuntu ubuntu 12288 Aug 31 05:38 plugins
-rw-rw-r-- 1 ubuntu ubuntu 129 Aug 31 06:13 queue.xml
-rw-rw-r-- 1 ubuntu ubuntu 64 Aug 31 05:28 secret.key
-rw-rw-r-- 1 ubuntu ubuntu 0 Aug 31 05:28 secret.key.not-so-secret
drwx------ 4 ubuntu ubuntu 4096 Aug 31 05:55 secrets
drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 31 05:38 updates
drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 31 05:28 userContent
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 05:40 users
drwxrwxr-x 10 ubuntu ubuntu 4096 Aug 31 05:28 war
drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 31 05:38 workflow-libs
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 05:54 workspace
ubuntu@ip-172-31-41-146:~/.jenkins$ cd workspace
ubuntu@ip-172-31-41-146:~/.jenkins/workspace$ ls -la
total 12
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 05:54 .
drwxrwxr-x 13 ubuntu ubuntu 4096 Aug 31 06:13 ..
drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 31 05:54 myfirstpro
ubuntu@ip-172-31-41-146:~/.jenkins/workspace$ cd myfirstpro
ubuntu@ip-172-31-41-146:~/.jenkins/workspace/myfirstpro$ ls -la
total 8
drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 31 05:54 .
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 05:54 ..
ubuntu@ip-172-31-41-146:~/.jenkins/workspace/myfirstpro$
ubuntu@ip-172-31-41-146:~/.jenkins/workspace/myfirstpro$ cd ~
ubuntu@ip-172-31-41-146:~$ pwd
/home/ubuntu
ubuntu@ip-172-31-41-146:~$ ls -la
total 44
drwxr-xr-x 8 ubuntu ubuntu 4096 Aug 31 05:38 .
drwxr-xr-x 3 root root 4096 Aug 31 04:39 ..
-rw-r--r-- 1 ubuntu ubuntu 220 Apr 9 2014 .bash_logout
-rw-r--r-- 1 ubuntu ubuntu 3637 Apr 9 2014 .bashrc
drwx------ 2 ubuntu ubuntu 4096 Aug 31 05:01 .cache
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 05:38 .groovy
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 05:28 .java
drwxrwxr-x 13 ubuntu ubuntu 4096 Aug 31 06:13 .jenkins
drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 31 05:28 jenkins_install
-rw-r--r-- 1 ubuntu ubuntu 675 Apr 9 2014 .profile
drwx------ 2 ubuntu ubuntu 4096 Aug 31 04:39 .ssh
ubuntu@ip-172-31-41-146:~$
ubuntu@ip-172-31-41-146:~$ cd ~/jenkins_install/
ubuntu@ip-172-31-41-146:~/jenkins_install$ pwd
/home/ubuntu/jenkins_install
ubuntu@ip-172-31-41-146:~/jenkins_install$

The "Build" is a process that covers all the steps required to create a "deliverable" of your
software. In the Java world, this typically includes:
1.Generating sources (sometimes).
2.Compiling sources.
3.Compiling test sources.
4.Executing tests (unit tests, integration tests, etc).
5.Packaging (into jar, war, ejb-jar, ear).
6.Running health checks (static analyzers like Checkstyle, Findbugs, PMD, test coverage, etc).
7.Generating reports.
So as you can see, compiling is only a (small) part of the build (and the best practice is to fully
automate all the steps with tools like Maven or Ant and to run the build continuously which is
known as Continuous Integration).

A Java package organizes Java classes into namespaces, providing a unique namespace for


each type it contains. Classes in the same package can access each other's package-private and
protected members.
Maven:

Apache Maven is a software project management and comprehension tool. Based on the
concept of a project object model (POM), Maven can manage a project's build, reporting and
documentation from a central piece of information. Using maven we can build and manage any Java
based project. This tutorial will teach you how to use Maven in your day-to-day life of any project
development using Java.
POM stands for Project Object Model. It is fundamental unit of work in Maven. It is an XML file
that resides in the base directory of the project as pom.xml.
The POM contains information about the project and various configuration detail used by
Maven to build the project(s).
POM also contains the goals and plugins. While executing a task or goal, Maven looks for the POM
in the current directory. It reads the POM, gets the needed configuration information, and then
executes the goal. Some of the configuration that can be specified in the POM are following −
project dependencies
plugins
goals
build profiles
project version
developers
mailing list
Before creating a POM, we should first decide
the project group(groupId),
its name (artifactId) and its version
as these attributes help in uniquely identifying the project in repository.
Let us create another Ubuntu system in AWS and install maven on that
sai.krishna@Testing005-PC MINGW64 /d/Softwares/Devops
$ ssh -i "chefpractice.pem" ubuntu@ec2-18-220-249-101.us-east-2.compute.amazonaws.com
The authenticity of host 'ec2-18-220-249-101.us-east-2.compute.amazonaws.com
(18.220.249.101)' can't be established.
ECDSA key fingerprint is SHA256:qXIXF0iSL1+WJaErfHne0xsECAr4OmKDurD5NPlSBx4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ec2-18-220-249-101.us-east-
2.compute.amazonaws.com,18.220.249.101' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-125-generic x86_64)

* Documentation: https://help.ubuntu.com/

System information as of Thu Aug 31 07:23:22 UTC 2017

System load: 0.0 Memory usage: 5% Processes: 82


Usage of /: 10.1% of 7.74GB Swap usage: 0% Users logged in: 0

Graph this data and manage this system at:


https://landscape.canonical.com/

Get cloud support with Ubuntu Advantage Cloud Guest:


http://www.ubuntu.com/business/services/cloud

0 packages can be updated.


0 updates are security updates.

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by


applicable law.

ubuntu@ip-172-31-39-234:~$ sudo apt-get update


ubuntu@ip-172-31-39-234:~$ apt-get install openjdk-7-jdk
ubuntu@ip-172-31-39-234:~$ sudo apt-cache search maven
ubuntu@ip-172-31-39-234:~$ sudo apt-get install maven
ubuntu@ip-172-31-39-234:~$ mvn -version
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-125-generic", arch: "amd64", family: "unix"
ubuntu@ip-172-31-39-234:~$ java -version
java version "1.7.0_151"
OpenJDK Runtime Environment (IcedTea 2.6.11) (7u151-2.6.11-0ubuntu1.14.04.1)
OpenJDK 64-Bit Server VM (build 24.151-b01, mixed mode)
ubuntu@ip-172-31-39-234:~$
ubuntu@ip-172-31-39-234:~$ sudo apt-get install git
ubuntu@ip-172-31-39-234:~$ git clone https://github.com/openmrs/openmrs-core.git
Cloning into 'openmrs-core'...
remote: Counting objects: 202679, done.
remote: Total 202679 (delta 0), reused 0 (delta 0), pack-reused 202679
Receiving objects: 100% (202679/202679), 220.66 MiB | 13.94 MiB/s, done.
Resolving deltas: 100% (113921/113921), done.
Checking connectivity... done.
ubuntu@ip-172-31-39-234:~$ ls -l
total 4
drwxrwxr-x 10 ubuntu ubuntu 4096 Aug 31 07:53 openmrs-core
ubuntu@ip-172-31-39-234:~$ cd openmrs-core
ubuntu@ip-172-31-39-234:~/openmrs-core$ ls -l
total 132
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 07:53 api
-rw-rw-r-- 1 ubuntu ubuntu 3798 Aug 31 07:53 checkstyle-suppressions.xml
-rw-rw-r-- 1 ubuntu ubuntu 15804 Aug 31 07:53 checkstyle.xml
-rw-rw-r-- 1 ubuntu ubuntu 8482 Aug 31 07:53 CONTRIBUTING.md
-rw-rw-r-- 1 ubuntu ubuntu 18165 Aug 31 07:53 LICENSE
-rw-rw-r-- 1 ubuntu ubuntu 430 Aug 31 07:53 license-header.txt
-rw-rw-r-- 1 ubuntu ubuntu 30306 Aug 31 07:53 pom.xml
-rw-rw-r-- 1 ubuntu ubuntu 13238 Aug 31 07:53 README.md
-rw-rw-r-- 1 ubuntu ubuntu 5076 Aug 31 07:53 ruleset.xml
drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 31 07:53 test
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 07:53 tools
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 07:53 web
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 07:53 webapp
ubuntu@ip-172-31-39-234:~/openmrs-core$
ubuntu@ip-172-31-39-234:~/openmrs-core$ sudo apt-get install tree
ubuntu@ip-172-31-39-234:~/openmrs-core$ mvn compile
ubuntu@ip-172-31-39-234:~$ cd openmrs-core
ubuntu@ip-172-31-39-234:~/openmrs-core$ ls -l
total 132
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 07:53 api
-rw-rw-r-- 1 ubuntu ubuntu 3798 Aug 31 07:53 checkstyle-suppressions.xml
-rw-rw-r-- 1 ubuntu ubuntu 15804 Aug 31 07:53 checkstyle.xml
-rw-rw-r-- 1 ubuntu ubuntu 8482 Aug 31 07:53 CONTRIBUTING.md
-rw-rw-r-- 1 ubuntu ubuntu 18165 Aug 31 07:53 LICENSE
-rw-rw-r-- 1 ubuntu ubuntu 430 Aug 31 07:53 license-header.txt
-rw-rw-r-- 1 ubuntu ubuntu 30306 Aug 31 07:53 pom.xml
-rw-rw-r-- 1 ubuntu ubuntu 13238 Aug 31 07:53 README.md
-rw-rw-r-- 1 ubuntu ubuntu 5076 Aug 31 07:53 ruleset.xml
drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 31 07:53 test
drwxrwxr-x 4 ubuntu ubuntu 4096 Aug 31 08:02 tools
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 07:53 web
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 07:53 webapp
ubuntu@ip-172-31-39-234:~/openmrs-core$ cd ~
ubuntu@ip-172-31-39-234:~$ ls -la
total 36
drwxr-xr-x 6 ubuntu ubuntu 4096 Aug 31 08:02 .
drwxr-xr-x 3 root root 4096 Aug 31 07:23 ..
-rw-r--r-- 1 ubuntu ubuntu 220 Apr 9 2014 .bash_logout
-rw-r--r-- 1 ubuntu ubuntu 3637 Apr 9 2014 .bashrc
drwx------ 2 ubuntu ubuntu 4096 Aug 31 07:29 .cache
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 .m2
drwxrwxr-x 10 ubuntu ubuntu 4096 Aug 31 07:53 openmrs-core
-rw-r--r-- 1 ubuntu ubuntu 675 Apr 9 2014 .profile
drwx------ 2 ubuntu ubuntu 4096 Aug 31 07:23 .ssh
ubuntu@ip-172-31-39-234:~$ cd .m2
ubuntu@ip-172-31-39-234:~/.m2$ ls -la
total 12
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 .
drwxr-xr-x 6 ubuntu ubuntu 4096 Aug 31 08:02 ..
drwxrwxr-x 11 ubuntu ubuntu 4096 Aug 31 08:02 repository
ubuntu@ip-172-31-39-234:~/.m2$ cd repository
ubuntu@ip-172-31-39-234:~/.m2/repository$ ls -la
total 44
drwxrwxr-x 11 ubuntu ubuntu 4096 Aug 31 08:02 .
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 ..
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 antlr
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 classworlds
drwxrwxr-x 4 ubuntu ubuntu 4096 Aug 31 08:02 com
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 commons-cli
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 commons-lang
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 junit
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 net
drwxrwxr-x 8 ubuntu ubuntu 4096 Aug 31 08:02 org
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 regexp
ubuntu@ip-172-31-39-234:~/.m2/repository$
ubuntu@ip-172-31-39-234:~/.m2/repository$ cd ~
ubuntu@ip-172-31-39-234:~$ pwd
/home/ubuntu
ubuntu@ip-172-31-39-234:~$ mkdir hello-world
ubuntu@ip-172-31-39-234:~$ cd hello-world
ubuntu@ip-172-31-39-234:~/hello-world$ touch pom.xml
ubuntu@ip-172-31-39-234:~/hello-world$ vi pom.xml
ubuntu@ip-172-31-39-234:~/hello-world$ cat pom.xml
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>wellness</groupId>
<artifactId>Healthcare</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
</project>

ubuntu@ip-172-31-39-234:~/hello-world$ mkdir src


ubuntu@ip-172-31-39-234:~/hello-world$ cd src
ubuntu@ip-172-31-39-234:~/hello-world/src$ mkdir main
ubuntu@ip-172-31-39-234:~/hello-world/src$ cd main
ubuntu@ip-172-31-39-234:~/hello-world/src/main$ mkdir java
ubuntu@ip-172-31-39-234:~/hello-world/src/main$ cd java
ubuntu@ip-172-31-39-234:~/hello-world/src/main/java$ touch hello.java
ubuntu@ip-172-31-39-234:~/hello-world/src/main/java$ vi hello.java
ubuntu@ip-172-31-39-234:~/hello-world/src/main/java$ cat hello.java
public class hello{

public static void main(String[] args) {


System.out.println("Hello world welcome");
}
}

ubuntu@ip-172-31-39-234:~/hello-world/src/main/java$ cd ..
ubuntu@ip-172-31-39-234:~/hello-world/src/main$ cd ..
ubuntu@ip-172-31-39-234:~/hello-world/src$ cd ..
ubuntu@ip-172-31-39-234:~/hello-world$ ls -l
total 8
-rw-rw-r-- 1 ubuntu ubuntu 192 Aug 31 09:48 pom.xml
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 09:52 src
ubuntu@ip-172-31-39-234:~/hello-world$ mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Healthcare 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ Healthcare ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e.
build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ubuntu/hello-world/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ Healthcare ---
[INFO] Compiling 1 source file to /home/ubuntu/hello-world/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.170s
[INFO] Finished at: Thu Aug 31 10:03:04 UTC 2017
[INFO] Final Memory: 7M/20M
[INFO] ------------------------------------------------------------------------
ubuntu@ip-172-31-39-234:~/hello-world$
ubuntu@ip-172-31-39-234:~/hello-world$ ls -l
total 12
-rw-rw-r-- 1 ubuntu ubuntu 192 Aug 31 09:48 pom.xml
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 09:52 src
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 09:58 target
ubuntu@ip-172-31-39-234:~/hello-world$ cd target
ubuntu@ip-172-31-39-234:~/hello-world/target$ tree
.
└── classes
└── hello.class

1 directory, 1 file
ubuntu@ip-172-31-39-234:~/hello-world/target$ cd ..
ubuntu@ip-172-31-39-234:~/hello-world$ mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Healthcare 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
surefire-plugin/2.10/maven-surefire-plugin-2.10.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-
plugin/2.10/maven-surefire-plugin-2.10.pom (11 KB at 43.9 KB/sec)
Downloading:
http://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.10/surefire-
2.10.pom
Downloaded:
http://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.10/surefire-
2.10.pom (12 KB at 375.6 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/20/maven-
parent-20.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/20/maven-
parent-20.pom (0 B at 0.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/apache/9/apache-9.pom
apache.org/maven2/org/apache/maven/shared/maven-common-artifact-filters/1.3/maven-
common-artifact-filters-1.3.pom (4 KB at 129.1 KB/sec)
Doters-1.3.jar
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-
api/e-common-2.10.jar (60 KB at 756.0 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-
utils/2.1/plexus-utils-2.1.jar (220 KB at 1543.9 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-
api/2.10/surefire-api-2.10.jar (158 KB at 486.2 KB/sec)
[INFO] No tests to run.
[INFO] Surefire report directory: /home/ubuntu/hello-world/target/surefire-reports
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-
junit3/2.10/surefire-junit3-2.10.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-
junit3/2.10/surefire-junit3-2.10.pom (2 KB at 57.4 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-
providers/2.10/surefire-providers-2.10.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-
providers/2.10/surefire-providers-2.10.pom (3 KB at 76.3 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-
junit3/2.10/surefire-junit3-2.10.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-
junit3/2.10/surefire-junit3-2.10.jar (26 KB at 472.7 KB/sec)

-------------------------------------------------------
T E S T S
-------------------------------------------------------

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.2:jar (default-jar) @ Healthcare ---
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-
project/2.0.7/maven-project-2.0.7.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven-
project/2.0.7/maven-project-2.0.7.pom (3 KB at 88.8 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven/2.0.7/maven-
2.0.7.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven/2.0.7/maven-
2.0.7.pom (11 KB at 355.7 KB/sec)
iver-1.0-alpha-9.jar (154 KB at 3652.2 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-
utils/1.4.9/plexus-utils-1.4.9.jar (200 KB at 2973.6 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/commons-lang/commons-lang/2.1/commons-
lang-2.1.jar (203 KB at 2504.4 KB/sec)
[INFO] Building jar: /home/ubuntu/hello-world/target/Healthcare-0.0.1-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.934s
[INFO] Finished at: Thu Aug 31 10:13:19 UTC 2017
[INFO] Final Memory: 8M/20M
[INFO] ------------------------------------------------------------------------
ubuntu@ip-172-31-39-234:~/hello-world$ tree
.
├── pom.xml
├── src
│   └── main
│   └── java
│   └── hello.java
└── target
├── classes
│   └── hello.class
├── Healthcare-0.0.1-SNAPSHOT.jar
├── maven-archiver
│   └── pom.properties
└── surefire

7 directories, 5 files
ubuntu@ip-172-31-39-234:~/hello-world$ cat pom.xml
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>wellness</groupId>
<artifactId>Healthcare</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
</project>
ubuntu@ip-172-31-39-234:~/hello-world$ mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Healthcare 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-
plugin/2.3/maven-install-plugin-2.3.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-
plugin/2.3/maven-install-plugin-2.3.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-
plugin/2.3/maven-install-plugin-2.3.jar (23 KB at 472.3 KB/sec)
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ Healthcare ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e.
build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ubuntu/hello-world/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ Healthcare ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.3:testResources (default-testResources) @ Healthcare
---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e.
build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ubuntu/hello-world/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) @ Healthcare
---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ Healthcare ---
[INFO] No tests to run.
[INFO] Surefire report directory: /home/ubuntu/hello-world/target/surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.2:jar (default-jar) @ Healthcare ---
[INFO]
[INFO] --- maven-install-plugin:2.3:install (default-install) @ Healthcare ---
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-
digest/1.0/plexus-digest-1.0.pom
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-
di/maven2/org/codehaus/plexus/plexus-digest/1.0/plexus-digest-1.0.jar (12 KB at 373.6
KB/sec)
[INFO] Installing /home/ubuntu/hello-world/target/Healthcare-0.0.1-SNAPSHOT.jar to
/home/ubuntu/.m2/repository/wellness/Healthcare/0.0.1-SNAPSHOT/Healthcare-0.0.1-
SNAPSHOT.jar
[INFO] Installing /home/ubuntu/hello-world/pom.xml to
/home/ubuntu/.m2/repository/wellness/Healthcare/0.0.1-SNAPSHOT/Healthcare-0.0.1-
SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.502s
[INFO] Finished at: Thu Aug 31 10:19:33 UTC 2017
[INFO] Final Memory: 8M/20M
[INFO] ------------------------------------------------------------------------
ubuntu@ip-172-31-39-234:~/hello-world$ cd ~
ubuntu@ip-172-31-39-234:~$ cd .m2
ubuntu@ip-172-31-39-234:~/.m2$ ls -la
total 12
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 .
drwxr-xr-x 7 ubuntu ubuntu 4096 Aug 31 10:02 ..
drwxrwxr-x 12 ubuntu ubuntu 4096 Aug 31 10:19 repository
ubuntu@ip-172-31-39-234:~/.m2$ cd repository
ubuntu@ip-172-31-39-234:~/.m2/repository$ ls -la
total 48
drwxrwxr-x 12 ubuntu ubuntu 4096 Aug 31 10:19 .
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 ..
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 antlr
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 classworlds
drwxrwxr-x 4 ubuntu ubuntu 4096 Aug 31 08:02 com
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 commons-cli
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 commons-lang
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 junit
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 net
drwxrwxr-x 8 ubuntu ubuntu 4096 Aug 31 08:02 org
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 regexp
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 10:19 wellness
ubuntu@ip-172-31-39-234:~/.m2/repository$ cd wellness
ubuntu@ip-172-31-39-234:~/.m2/repository/wellness$ ls
Healthcare
ubuntu@ip-172-31-39-234:~/.m2/repository/wellness$ cd Healthcare
ubuntu@ip-172-31-39-234:~/.m2/repository/wellness/Healthcare$ ls
0.0.1-SNAPSHOT maven-metadata-local.xml
ubuntu@ip-172-31-39-234:~/.m2/repository/wellness/Healthcare$ cd 0.0.1-SNAPSHOT
ubuntu@ip-172-31-39-234:~/.m2/repository/wellness/Healthcare/0.0.1-SNAPSHOT$ ls
Healthcare-0.0.1-SNAPSHOT.jar maven-metadata-local.xml
Healthcare-0.0.1-SNAPSHOT.pom _maven.repositories
ubuntu@ip-172-31-39-234:~/.m2/repository/wellness/Healthcare/0.0.1-SNAPSHOT$ cd ~
ubuntu@ip-172-31-39-234:~$ ls
hello-world openmrs-core
ubuntu@ip-172-31-39-234:~$ cd hello-world
ubuntu@ip-172-31-39-234:~/hello-world$ ls
pom.xml src target
ubuntu@ip-172-31-39-234:~/hello-world$ mvn clean
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Healthcare 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-
plugin/2.5/maven-clean-plugin-2.5.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-
plugin/2.5/maven-clean-plugin-2.5.pom (4 KB at 16.9 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
plugins/22/maven-plugins-22.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
plugins/22/maven-plugins-22.pom (13 KB at 310.6 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/21/maven-
parent-21.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/21/maven-
parent-21.pom (0 B at 0.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/apache/10/apache-10.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/apache/10/apache-10.pom (0 B
at 0.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-
plugin/2.5/maven-clean-plugin-2.5.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-
plugin/2.5/maven-clean-plugin-2.5.jar (25 KB at 559.4 KB/sec)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ Healthcare ---
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-
utils/3.0/plexus-utils-3.0.pom
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-
utils/3.0/plexus-utils-3.0.pom (4 KB at 137.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-
utils/3.0/plexus-utils-3.0.jar
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-
utils/3.0/plexus-utils-3.0.jar (221 KB at 2323.9 KB/sec)
[INFO] Deleting /home/ubuntu/hello-world/target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.411s
[INFO] Finished at: Thu Aug 31 10:27:02 UTC 2017
[INFO] Final Memory: 7M/16M
[INFO] ------------------------------------------------------------------------
ubuntu@ip-172-31-39-234:~/hello-world$ ls
pom.xml src
ubuntu@ip-172-31-39-234:~/hello-world$
Compile
Test (unit test)
Package
install
Deploy

In Windows
Install jenkins as A service of Tomcat7:
sai.krishna@Testing005-PC MINGW64 /d/Softwares/Devops
$ ssh -i "chefpractice.pem" ubuntu@ec2-18-220-249-101.us-east-2.compute.amazonaws.com
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-125-generic x86_64)

* Documentation: https://help.ubuntu.com/

System information as of Thu Aug 31 13:09:32 UTC 2017

System load: 0.0 Processes: 97


Usage of /: 19.9% of 7.74GB Users logged in: 0
Memory usage: 9% IP address for eth0: 172.31.39.234
Swap usage: 0%

Graph this data and manage this system at:


https://landscape.canonical.com/

Get cloud support with Ubuntu Advantage Cloud Guest:


http://www.ubuntu.com/business/services/cloud

New release '16.04.3 LTS' available.


Run 'do-release-upgrade' to upgrade to it.
ubuntu@ip-172-31-39-234:~$ sudo apt-get update
Ign http://us-east-2.ec2.archive.ubuntu.com trusty InRelease
Get:1 http://us-east-2.ec2.archive.ubuntu.com trusty-updates InRelease [65.9 kB]
Hit http://us-east-2.ec2.archive.ubuntu.com trusty-backports InRelease
Hit http://us-east-2.ec2.archive.ubuntu.com trusty Release.gpg
Hit http://us-east-2.ec2.archive.ubuntu.com trusty Release
Get:2 http://us-east-2.ec2.archive.ubuntu.com trusty-updates/main Sources [404 kB]
Get:3 http://us-east-2.ec2.archive.ubuntu.com trusty-updates/restricted Sources [6,331
B]
Get:4 http://us-east-2.ec2.archive.ubuntu.com trusty-updates/universe Sources [188 kB]
Garchive.ubuntu.com/ubuntu/ trusty-updates/main libtomcat7-java all 7.0.52-1ubuntu0.11
[3,654 kB]
Get:6 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main tomcat7-common
all 7.0.52-1ubuntu0.11 [47.9 kB]
Get:7 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main tomcat7 all
7.0.52-1ubuntu0.11 [36.0 kB]
Get:8 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty/main authbind amd64 2.1.1
[19.6 kB]
Fetched 5,375 kB in 0s (37.4 MB/s)
Preconfiguring packages ...
Selecting previously unselected package libcommons-pool-java.
ubuntu@ip-172-31-39-234:~$ sudo apt-get install tomcat7
Reading package lists... Done
Building dependency tree
Reading state information... Done
Te following extra packages will be installed:
authbind libcommons-dbcp-java libcommons-pool-java libecj-java
libglled, 0 to remove and 18 not upgraded.
Need to get 5,375 kB of archives.
After this operation, 6,871 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Processing triggers for man-db (2.6.7.1-1ubuntu1) .buntu1) ...
Setting up libtomcat7-java (7.0.52-1ubuntu0.11) ...
Setting up tomcat7-common (7.0.52-1ubuntu0.11) ...
Setting up tomcat7 (7.0.52-1ubuntu0.11) ...
Creating config file /etc/default/tomcat7 with new version
Adding system user `tomcat7' (UID 106) ...
Adding new user `tomcat7' (UID 106) with group `tomcat7' ...
Not creating home directory `/usr/share/tomcat7'.
Creating config file /etc/logrotate.d/tomcat7 with new version
* Starting Tomcat servlet engine tomcat7 [ OK ]
Setting up authbind (2.1.1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ubuntu@ip-172-31-39-234:~$ sudo service tomcat7 status
* Tomcat servlet engine is running with pid 14702
ubuntu@ip-172-31-39-234:~$ sudo -i
root@ip-172-31-39-234:~# exit
logout
ubuntu@ip-172-31-39-234:~$ pwd
/home/ubuntu
ubuntu@ip-172-31-39-234:~$ cd ~
ubuntu@ip-172-31-39-234:~$ pwd
/home/ubuntu
ubuntu@ip-172-31-39-234:~$ ls -la
total 48
drwxr-xr-x 7 ubuntu ubuntu 4096 Aug 31 12:38 .
drwxr-xr-x 3 root root 4096 Aug 31 07:23 ..
-rw------- 1 ubuntu ubuntu 593 Aug 31 12:38 .bash_history
-rw-r--r-- 1 ubuntu ubuntu 220 Apr 9 2014 .bash_logout
-rw-r--r-- 1 ubuntu ubuntu 3637 Apr 9 2014 .bashrc
drwx------ 2 ubuntu ubuntu 4096 Aug 31 07:29 .cache
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 10:27 hello-world
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 08:02 .m2
drwxrwxr-x 10 ubuntu ubuntu 4096 Aug 31 07:53 openmrs-core
-rw-r--r-- 1 ubuntu ubuntu 675 Apr 9 2014 .profile
drwx------ 2 ubuntu ubuntu 4096 Aug 31 07:23 .ssh
-rw------- 1 ubuntu ubuntu 1162 Aug 31 10:02 .viminfo
ubuntu@ip-172-31-39-234:~$ cd ..
ubuntu@ip-172-31-39-234:/home$ ls -la
total 12
drwxr-xr-x 3 root root 4096 Aug 31 07:23 .
drwxr-xr-x 22 root root 4096 Aug 31 07:23 ..
drwxr-xr-x 7 ubuntu ubuntu 4096 Aug 31 12:38 ubuntu
ubuntu@ip-172-31-39-234:/home$ cd ..
ubuntu@ip-172-31-39-234:/$ ls -la
total 84
drwxr-xr-x 22 root root 4096 Aug 31 07:23 .
drwxr-xr-x 22 root root 4096 Aug 31 07:23 ..
drwxr-xr-x 2 root root 4096 Jul 18 20:45 bin
drwxr-xr-x 3 root root 4096 Jul 18 20:45 boot
drwxr-xr-x 13 root root 3820 Aug 31 07:23 dev
drwxr-xr-x 98 root root 4096 Sep 1 04:52 etc
drwxr-xr-x 3 root root 4096 Aug 31 07:23 home
lrwxrwxrwx 1 root root 34 Jul 18 20:44 initrd.img -> boot/initrd.img-3.13.0-125-
generic
drwxr-xr-x 21 root root 4096 Jul 18 20:43 lib
drwxr-xr-x 2 root root 4096 Jul 18 20:43 lib64
drwx------ 2 root root 16384 Jul 18 20:45 lost+found
drwxr-xr-x 2 root root 4096 Jul 18 20:42 media
drwxr-xr-x 2 root root 4096 Apr 10 2014 mnt
drwxr-xr-x 2 root root 4096 Jul 18 20:42 opt
dr-xr-xr-x 110 root root 0 Aug 31 07:23 proc
drwx------ 3 root root 4096 Sep 1 05:03 root
drwxr-xr-x 18 root root 660 Sep 1 04:52 run
drwxr-xr-x 2 root root 4096 Jul 18 20:45 sbin
drwxr-xr-x 2 root root 4096 Jul 18 20:42 srv
dr-xr-xr-x 13 root root 0 Aug 31 07:23 sys
drwxrwxrwt 8 root root 4096 Sep 1 04:52 tmp
drwxr-xr-x 10 root root 4096 Jul 18 20:42 usr
drwxr-xr-x 12 root root 4096 Jul 18 20:45 var
lrwxrwxrwx 1 root root 31 Jul 18 20:44 vmlinuz -> boot/vmlinuz-3.13.0-125-generic
ubuntu@ip-172-31-39-234:/$ cd var
ubuntu@ip-172-31-39-234:/var$ ls -la
total 48
drwxr-xr-x 12 root root 4096 Jul 18 20:45 .
drwxr-xr-x 22 root root 4096 Aug 31 07:23 ..
drwxr-xr-x 2 root root 4096 Apr 10 2014 backups
drwxr-xr-x 11 root root 4096 Sep 1 04:52 cache
drwxrwxrwt 2 root root 4096 Jul 18 20:44 crash
drwxr-xr-x 43 root root 4096 Sep 1 04:52 lib
drwxrwsr-x 2 root staff 4096 Apr 10 2014 local
lrwxrwxrwx 1 root root 9 Jul 18 20:42 lock -> /run/lock
drwxrwxr-x 9 root syslog 4096 Sep 1 04:52 log
drwxrwsr-x 2 root mail 4096 Jul 18 20:42 mail
drwxr-xr-x 2 root root 4096 Jul 18 20:42 opt
lrwxrwxrwx 1 root root 4 Jul 18 20:42 run -> /run
drwxr-xr-x 5 root root 4096 Jul 18 20:42 spool
drwxrwxrwt 2 root root 4096 Jul 18 20:45 tmp
ubuntu@ip-172-31-39-234:/var$ cd lib
ubuntu@ip-172-31-39-234:/var/lib$ ls -la
total 172
drwxr-xr-x 43 root root 4096 Sep 1 04:52 .
drwxr-xr-x 12 root root 4096 Jul 18 20:45 ..
drwxr-xr-x 4 root root 4096 Jul 18 20:43 AccountsService
drwxr-xr-x 3 root root 4096 Jul 18 20:43 apparmor
drwxr-xr-x 6 root root 4096 Sep 1 04:52 apt
drwxr-xr-x 2 root root 4096 Feb 18 2014 aptitude
drwxr-xr-x 2 root root 4096 Aug 31 07:23 belocs
drwxr-xr-x 8 root root 4096 Aug 31 07:23 cloud
drwxr-xr-x 2 root root 4096 Jul 18 20:43 dbus
drwxr-xr-x 2 root root 4096 Aug 31 07:23 dhcp
drwxr-xr-x 7 root root 4096 Sep 1 04:52 dpkg
drwxr-xr-x 2 root root 4096 Aug 11 00:00 git
drwxr-xr-x 2 root root 4096 Jul 18 20:44 initramfs-tools
drwxr-xr-x 2 root root 4096 Mar 13 2014 initscripts
drwxr-xr-x 2 root root 4096 Mar 13 2014 insserv
drwxr-xr-x 2 root root 4096 Mar 24 18:07 landscape
drwxrwsr-x 2 libuuid libuuid 4096 Jul 18 20:42 libuuid
drwxr-xr-x 3 root root 4096 Jul 18 20:42 locales
drwxr-xr-x 2 root root 4096 Jan 22 2014 logrotate
drwxr-xr-x 2 root root 4096 Jul 18 20:44 man-db
drwxr-xr-x 2 root root 4096 Apr 10 2014 misc
drwxr-xr-x 2 root root 4096 Jun 20 2013 mlocate
drwxr-xr-x 2 root root 4096 Aug 31 07:31 nssdb
drwxr-xr-x 2 root root 4096 Oct 9 2013 ntpdate
drwxr-xr-x 2 root root 4096 Jan 12 2016 os-prober
drwxr-xr-x 2 root root 4096 Jul 18 20:44 pam
drwxr-xr-x 2 root root 4096 Aug 31 07:23 plymouth
drwx------ 3 root root 4096 Jul 18 20:43 polkit-1
drwxr-xr-x 2 root root 4096 Jul 18 20:43 python
drwxr-xr-x 2 root root 4096 Jul 18 20:44 sgml-base
drwxr-xr-x 2 root root 4096 Feb 10 2014 sudo
drwxr-xr-x 3 root root 4096 Jul 18 20:42 systemd
drwxr-xr-x 7 root root 4096 Sep 1 04:52 tomcat7
drwxr-xr-x 2 root root 4096 Aug 31 07:23 ubuntu-release-upgrader
drwxr-xr-x 3 root root 4096 Sep 1 04:52 ucf
drwxr-xr-x 2 root root 4096 Aug 31 07:23 update-manager
drwxr-xr-x 4 root root 4096 Sep 1 04:47 update-notifier
drwxr-xr-x 2 root root 4096 May 18 2013 update-rc.d
drwxr-xr-x 2 root root 4096 Aug 31 07:23 urandom
drwxr-xr-x 3 root root 4096 Jul 18 20:42 ureadahead
drwxr-xr-x 2 root root 4096 Jul 18 20:43 usbutils
drwxr-xr-x 3 root root 4096 Jul 18 20:42 vim
drwxr-xr-x 2 root root 4096 Jul 18 20:44 xml-core
ubuntu@ip-172-31-39-234:/var/lib$ cd tomcat7
ubuntu@ip-172-31-39-234:/var/lib/tomcat7$ ls -la
total 28
drwxr-xr-x 7 root root 4096 Sep 1 04:52 .
drwxr-xr-x 43 root root 4096 Sep 1 04:52 ..
drwxr-xr-x 3 tomcat7 tomcat7 4096 Sep 1 04:52 common
lrwxrwxrwx 1 root root 12 Apr 5 18:58 conf -> /etc/tomcat7
lrwxrwxrwx 1 root root 17 Apr 5 18:58 logs -> ../../log/tomcat7
drwxr-xr-x 2 root root 4096 Sep 1 04:52 policy
drwxr-xr-x 3 tomcat7 tomcat7 4096 Sep 1 04:52 server
drwxr-xr-x 3 tomcat7 tomcat7 4096 Sep 1 04:52 shared
drwxrwxr-x 3 tomcat7 tomcat7 4096 Sep 1 04:52 webapps
lrwxrwxrwx 1 root root 19 Apr 5 18:58 work -> ../../cache/tomcat7
ubuntu@ip-172-31-39-234:/var/lib/tomcat7$ cd webapps
ubuntu@ip-172-31-39-234:/var/lib/tomcat7/webapps$ ls -la
total 12
drwxrwxr-x 3 tomcat7 tomcat7 4096 Sep 1 04:52 .
drwxr-xr-x 7 root root 4096 Sep 1 04:52 ..
drwxr-xr-x 3 root root 4096 Sep 1 04:52 ROOT
ubuntu@ip-172-31-39-234:/var/lib/tomcat7/webapps$ pwd
/var/lib/tomcat7/webapps
ubuntu@ip-172-31-39-234:/var/lib/tomcat7/webapps$

root@ip-172-31-39-234:/var/lib/tomcat7/webapps# cd ~
root@ip-172-31-39-234:~# pwd
/root
root@ip-172-31-39-234:~# cd /home/ubuntu
root@ip-172-31-39-234:/home/ubuntu# wget http://ftp.yz.yamagata-
u.ac.jp/pub/misc/jenkins/war-stable/2.19.1/jenkins.war
root@ip-172-31-39-234:/home/ubuntu# ls
hello-world jenkins.war openmrs-core
root@ip-172-31-39-234:/home/ubuntu# cp jenkins.war /var/lib/tomcat7/webapps/
root@ip-172-31-39-234:/home/ubuntu# cd /var/lib/tomcat7/webapps
root@ip-172-31-39-234:/var/lib/tomcat7/webapps# ls -la
total 68136
drwxrwxr-x 4 tomcat7 tomcat7 4096 Sep 1 05:39 .
drwxr-xr-x 7 root root 4096 Sep 1 04:52 ..
drwxr-xr-x 10 tomcat7 tomcat7 4096 Sep 1 05:39 jenkins
-rw-r--r-- 1 root root 69754011 Sep 1 05:39 jenkins.war
drwxr-xr-x 3 root root 4096 Sep 1 04:52 ROOT
root@ip-172-31-39-234:/var/lib/tomcat7/webapps# service tomcat7 restart
* Stopping Tomcat servlet engine tomcat7 [ OK ]
* Starting Tomcat servlet engine tomcat7 [ OK ]

Set Security Group open 8080 port


http://18.220.249.101:8080

http://18.220.249.101:8080/jenkins/

ubuntu@ip-172-31-39-234:~$ pwd
/home/ubuntu
ubuntu@ip-172-31-39-234:~$ cd ..
ubuntu@ip-172-31-39-234:/home$ cd ..
ubuntu@ip-172-31-39-234:/$ cd /usr/share/tomcat7
ubuntu@ip-172-31-39-234:/usr/share/tomcat7$ ls
bin defaults.template logrotate.md5sum
defaults.md5sum lib logrotate.template
ubuntu@ip-172-31-39-234:/usr/share/tomcat7$ sudo mkdir .jenkins
ubuntu@ip-172-31-39-234:/usr/share/tomcat7$ sudo chown -R tomcat7:nogroup .jenkins
ubuntu@ip-172-31-39-234:/usr/share/tomcat7$ sudo service tomcat7 restart
* Stopping Tomcat servlet engine tomcat7
[ OK ]
* Starting Tomcat servlet engine tomcat7
[ OK ]
ubuntu@ip-172-31-39-234:/usr/share/tomcat7$ cd /usr/share/tomcat7/.jenkins/secrets
-bash: cd: /usr/share/tomcat7/.jenkins/secrets: Permission denied
ubuntu@ip-172-31-39-234:/usr/share/tomcat7$ sudo -i
root@ip-172-31-39-234:~# cd /usr/share/tomcat7/.jenkins/secrets/
root@ip-172-31-39-234:/usr/share/tomcat7/.jenkins/secrets# ls -la
total 44
drwx------ 4 tomcat7 tomcat7 4096 Sep 4 16:23 .
drwxr-xr-x 10 tomcat7 nogroup 4096 Sep 4 16:24 ..
drwxr-xr-x 2 tomcat7 tomcat7 4096 Sep 4 16:23 filepath-filters.d
-rw-r--r-- 1 tomcat7 tomcat7 272 Sep 4 16:23 hudson.util.Secret
-rw-r----- 1 tomcat7 tomcat7 33 Sep 4 16:23 initialAdminPassword
-rw-r--r-- 1 tomcat7 tomcat7 32 Sep 4 16:23 jenkins.model.Jenkins.crumbSalt
-rw-r--r-- 1 tomcat7 tomcat7 48 Sep 4 16:23 jenkins.security.ApiTokenProperty.seed
-rw-r--r-- 1 tomcat7 tomcat7 256 Sep 4 16:23 master.key
-rw-r--r-- 1 tomcat7 tomcat7 272 Sep 4 16:23
org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY
-rw-r--r-- 1 tomcat7 tomcat7 5 Sep 4 16:23 slave-to-master-security-kill-switch
drwxr-xr-x 2 tomcat7 tomcat7 4096 Sep 4 16:23 whitelisted-callables.d
root@ip-172-31-39-234:/usr/share/tomcat7/.jenkins/secrets# cat initialAdminPassword
704b0898cd3544d7804ed41e069420c3
root@ip-172-31-39-234:/usr/share/tomcat7/.jenkins/secrets#

http://18.220.249.101:8080/jenkins/

Initial Password: 704b0898cd3544d7804ed41e069420c3

Then Start Jenkins .........


Username: kishankrishnan
password : drdo.kishan202

You might also like