Skip to content

Commit

Permalink
chore: Updated java-maven deploy config (#1060)
Browse files Browse the repository at this point in the history
  • Loading branch information
pchinthapenta authored Mar 26, 2024
1 parent c96b8f8 commit b8508d3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
5 changes: 3 additions & 2 deletions test/deploy/linux/java/javaApp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependency>
<!--Add-the-newrelic-java-dependency-plugin-->
</dependencies>
<build>
<finalName>javaApp</finalName>
<plugins>
<!-- Add the exec-maven-plugin below -->
<!--Add-the-exec-maven-plugin-below-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
Expand Down
12 changes: 7 additions & 5 deletions test/deploy/linux/java/redhat/roles/configure/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
shell: chmod -R 777 /opt/tomcat/latest/bin
become: true

- name: Change the permissions and ownership of javaApp & tomcat directories
shell: chown -R ec2-user:ec2-user /home/ec2-user/javaApp/ &&
chmod -R 755 /home/ec2-user/javaApp &&
chown -R ec2-user:ec2-user /opt/tomcat/ &&
chmod -R 755 /opt/tomcat/
become: true

- name: Build Java App with Maven
ansible.builtin.command:
cmd: mvn clean package -f /home/ec2-user/javaApp/pom.xml
Expand All @@ -25,11 +32,6 @@
PATH: "{{ ansible_env.PATH }}:/opt/jdk-14.0.1/bin:/opt/apache-maven/bin"
JRE_HOME: "/opt/jdk-14.0.1"
become: true

- name: Change the permissions and ownership of javaApp directory
shell: chown -R ec2-user:ec2-user /home/ec2-user/javaApp/ &&
chmod -R 755 /home/ec2-user/javaApp
become: true

- name: Move the package
shell: mv /home/ec2-user/javaApp/target/javaApp.war /opt/tomcat/latest/webapps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"resources": [
{
"id": "dummyApp",
"id": "java-mav-tom-testapp",
"provider": "aws",
"type": "ec2",
"size": "t3.small",
Expand All @@ -20,14 +20,14 @@
"source_repository": "https://github.com/newrelic/open-install-library.git",
"deploy_script_path": "test/deploy/linux/tomcat/systemd/shScript/catalina/install/linux/roles",
"port": 6001,
"destinations": ["dummyApp"]
"destinations": ["java-mav-tom-testapp"]
},
{
"id": "javaApp",
"source_repository": "https://github.com/newrelic/open-install-library.git",
"deploy_script_path": "test/deploy/linux/java/redhat/roles",
"port": 80,
"destinations": ["dummyApp"]
"destinations": ["java-mav-tom-testapp"]
}
]
}

0 comments on commit b8508d3

Please sign in to comment.