I am currently trying to configure a remote VPS (running ubuntu) in a way that it automatically pulls my latest commit from gitlab and deploys it to its tomcat7 instance. Short notice: I am not very experienced when it comes to linux, java, tomcat and related stuff.
So far I managed to install tomcat7 and jenkins. Tomcat7 is in /var/lib/tomcat7
and jenkins is installed in /var/lib/tomcat7/webapps/jenkins
. Furthermore I added a Job to Jenkins using Source Code Management, that automatically pulls my latest commit. The commit is placed in /var/lib/tomcat7/webapps/jenkins/workspace/Bigdaxta_build_test
.
The question is: How can I deploy automatically deploy this folder / project to tomcat? I guess I have to add a "post build task" script to do the job. However I cannot find any helpful / comprehensible information on how to do it.
Note: the project pulled by Jenkins hast the following structure:
+-- build
¦ +-- classes
¦ +-- bigdaxta
¦ +-- EchoServlet.class
¦ +-- Printer.class
+-- jsch-0.1.53.jar
+-- mysql-connector-java-5.1.39-bin.jar
+-- pom.xml
+-- README.md
+-- src
¦ +-- bigdaxta
¦ +-- DBConnector.java
¦ +-- EchoServlet.java
¦ +-- Printer.java
+-- target
¦ +-- classes
¦ +-- bigdaxta
¦ +-- DBConnector.class
¦ +-- EchoServlet.class
¦ +-- Printer.class
+-- WebContent
+-- index.jsp
+-- META-INF
¦ +-- MANIFEST.MF
+-- test.gif
+-- WEB-INF
+-- web.xml
Any help would be appreciated.
Regards Jan