

- #Git change branch tomcat how to
- #Git change branch tomcat install
- #Git change branch tomcat full
- #Git change branch tomcat registration
- #Git change branch tomcat verification
#Git change branch tomcat full
The full solution began with git update-index -no-assume-unchanged before proceeding with the steps above.
#Git change branch tomcat how to
Service: name=tomcat state=started enabled=yesĪlso,you can check more articles on how to manage ansible playbook/inventories/multiple environments Jenkins Pipeline Path: "/opt/apache-tomcat-7.0.61/webapps/samples"Ĭopy: src=./target/LoginWebApp-1.war dest=/opt/apache-tomcat-7.0.61/webapps/Ĭopy: src=tomcat-initscript.sh dest=/etc/init.d/tomcat mode=0755 Template: src=server.xml dest=/usr/share/tomcat/conf/ name: Change ownership of Tomcat installationįile: path=/usr/share/tomcat/ owner=tomcat group=tomcat state=directory recurse=yes Get_url: url= dest=/opt/apache-tomcat-7.0.61.tar.gzĬommand: chdir=/usr/share /bin/tar xvf /opt/apache-tomcat-7.0.61.tar.gz -C /opt/ creates=/opt/apache-tomcat-7.0.61įile: src=/opt/apache-tomcat-7.0.61 path=/usr/share/tomcat state=link User: name= home=/usr/share/tomcat createhome=no Yum: name=java-1.7.0-openjdk state=present
#Git change branch tomcat install
Role to install java, configure tomcat and deploy the war file on the tomcat server - name: Install Java 1.7 I have following folder structure to manage ansible playbook for inventories and the variables as shown below Now we will create main.yml file which will call our roles to install tomcat and java - hosts: all
#Git change branch tomcat verification
If you will not use this file, then when you run your playbook using jenkins it will fail with the error Host key verification is falied This is required to bypass the hostkey checking while making a ssh connection with the tomcat servers. In the git repo, we have created first ansible.cfg file with the below entries Now, we will write the ansible roles to do all the tasks and configure it to run inside a Jenkins job Ansible Playbook Previously, we used to install tomcat and java manually on the server and then copy the war file under webapps folder and restart the service. Now we have generated the war file and we can deploy it on our tomcat server. Clone the git repo and run the mvn command, this will generate a war file under target folder git clone Compile and package the project using MavenĬreated a pom.xml file to compile and package the project in war file.

#Git change branch tomcat registration
Create a pipeline job in Jenkins and trigger the buildįirstly, create a sample registration and login page in jsp.Deploy the war file on tomcat server using ansible playbook.Create a role in Ansible to install java and tomcat.Make sure ssh connection is already setup between for jenkins user between two AWS EC2 Instances.Integration between Jenkins and Ansible.Follow Jenkins Installation article if not already installed.Two AWS EC2 instance ( one is Jenkins Server and another is tomcat server).If you want to see the video for this article, click here Prerequisite: At last,this process will help us in achieving continuous integration and continuous deployment for your application. We will deploy the sample java application using Ansible on the tomcat servers. In this blog, we will explore the CI/CD process using Jenkins and Ansible.
