Skip to content

Commit b8508d3

Browse files
chore: Updated java-maven deploy config (#1060)
1 parent c96b8f8 commit b8508d3

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

test/deploy/linux/java/javaApp/pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
<artifactId>junit</artifactId>
1414
<version>3.8.1</version>
1515
<scope>test</scope>
16-
</dependency>
16+
</dependency>
17+
<!--Add-the-newrelic-java-dependency-plugin-->
1718
</dependencies>
1819
<build>
1920
<finalName>javaApp</finalName>
2021
<plugins>
21-
<!-- Add the exec-maven-plugin below -->
22+
<!--Add-the-exec-maven-plugin-below-->
2223
<plugin>
2324
<groupId>org.codehaus.mojo</groupId>
2425
<artifactId>exec-maven-plugin</artifactId>

test/deploy/linux/java/redhat/roles/configure/tasks/main.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717
shell: chmod -R 777 /opt/tomcat/latest/bin
1818
become: true
1919

20+
- name: Change the permissions and ownership of javaApp & tomcat directories
21+
shell: chown -R ec2-user:ec2-user /home/ec2-user/javaApp/ &&
22+
chmod -R 755 /home/ec2-user/javaApp &&
23+
chown -R ec2-user:ec2-user /opt/tomcat/ &&
24+
chmod -R 755 /opt/tomcat/
25+
become: true
26+
2027
- name: Build Java App with Maven
2128
ansible.builtin.command:
2229
cmd: mvn clean package -f /home/ec2-user/javaApp/pom.xml
@@ -25,11 +32,6 @@
2532
PATH: "{{ ansible_env.PATH }}:/opt/jdk-14.0.1/bin:/opt/apache-maven/bin"
2633
JRE_HOME: "/opt/jdk-14.0.1"
2734
become: true
28-
29-
- name: Change the permissions and ownership of javaApp directory
30-
shell: chown -R ec2-user:ec2-user /home/ec2-user/javaApp/ &&
31-
chmod -R 755 /home/ec2-user/javaApp
32-
become: true
3335

3436
- name: Move the package
3537
shell: mv /home/ec2-user/javaApp/target/javaApp.war /opt/tomcat/latest/webapps

test/manual/definitions/apm/java/linux/java-tomcat-maven-linux2.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"resources": [
99
{
10-
"id": "dummyApp",
10+
"id": "java-mav-tom-testapp",
1111
"provider": "aws",
1212
"type": "ec2",
1313
"size": "t3.small",
@@ -20,14 +20,14 @@
2020
"source_repository": "https://github.com/newrelic/open-install-library.git",
2121
"deploy_script_path": "test/deploy/linux/tomcat/systemd/shScript/catalina/install/linux/roles",
2222
"port": 6001,
23-
"destinations": ["dummyApp"]
23+
"destinations": ["java-mav-tom-testapp"]
2424
},
2525
{
2626
"id": "javaApp",
2727
"source_repository": "https://github.com/newrelic/open-install-library.git",
2828
"deploy_script_path": "test/deploy/linux/java/redhat/roles",
2929
"port": 80,
30-
"destinations": ["dummyApp"]
30+
"destinations": ["java-mav-tom-testapp"]
3131
}
3232
]
3333
}

0 commit comments

Comments
 (0)