Professional Documents
Culture Documents
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.
CI Tools:
Team City, Jenkins, Bamboo
Jenkins Installation:
Create the AWS Ubuntu system .....
sai.krishna@Testing005-PC MINGW64 /d/Softwares/Devops
* Documentation: https://help.ubuntu.com/
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@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’
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
*************************************************************
*************************************************************
*************************************************************
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
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).
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/
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@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 :
[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 :
[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/
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 ]
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/