Skip to content

Commit 76eeb10

Browse files
committed
Update App Deployment Automation
1 parent 08f1c3d commit 76eeb10

File tree

6 files changed

+36
-40
lines changed

6 files changed

+36
-40
lines changed

app_deployment_demo/download_package.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,8 @@
11
---
2-
f5_lb_method: 'round-robin'
3-
f5_monitors: '/Common/http'
4-
f5_pool_name: 'http_pool'
5-
f5_provider:
6-
server: "{{ f5_bigip_server }}"
7-
user: "{{ f5_bigip_user }}"
8-
password: "{{ f5_bigip_password }}"
9-
server_port: 8443
10-
f5_virtual_server: 'webapp_vip'
11-
infoblox_username: 'cloudadmin'
12-
nios_provider:
13-
host: "{{ grid_manager }}"
14-
username: "{{ infoblox_username }}"
15-
password: "{{ infoblox_password }}"
16-
paloalto_username: 'admin'
17-
subnet_netmask: '255.255.255.0'
18-
vm_domain: 'domain.com'
19-
vm_network: 'VM Network'
20-
webapp_port: 80
21-
workflow_tower_inventory: 'VMWare_Workflow'
2+
app_artifact_id: "hello"
3+
artifact_extension_type: "jar"
4+
app_folder: "/opt/app"
5+
app_group_id: "com.redhat.app"
6+
app_version: "1.0"
7+
maven_repository_url: "http://nexus.domain.com:8081/repository/maven-releases/"
8+
web_app_url: "http://app-server1:9080/hello
Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
---
22
- name: "Check for any existing running process of {{ app_name }}"
3-
shell: "ps -ef | grep {{ app_name }} | grep -v grep | awk '{print $2}'"
3+
shell: "ps -ef | grep {{ app_artifact_id }}-{{ app_version }} | grep -v grep | awk '{print $2}'"
44
register: app_process_id
55

66
- name: Terminate existing process
77
command: "kill -9 {{ app_process_id.stdout }}"
88
when: app_process_id.stdout != ''
99

10-
- name: Copy Package
11-
copy:
12-
src: "/tmp/{{ app_name }}.jar"
13-
dest: "{{ app_folder }}/{{ app_name }}.jar"
10+
- name: Remove any existing artifact
11+
file:
12+
path: "{{ app_folder }}/{{ app_artifact_id }}-{{ app_version }}.{{ artifact_extension_type }}"
13+
state: absent
1414

15-
- name: Deploy Software
16-
shell: "nohup java -jar {{ app_folder }}/{{ app_name }}.jar &"
15+
- name: Download artifact
16+
maven_artifact:
17+
group_id: "{{ app_group_id }}"
18+
artifact_id: "{{ app_artifact_id }}"
19+
repository_url: "{{ maven_repository_url }}"
20+
extension: "{{ artifact_extension_type }}"
21+
version: "{{ app_version }}"
22+
dest: "{{ app_folder }}/{{ app_artifact_id }}-{{ app_version }}.{{ artifact_extension_type }}"
23+
24+
- name: Deploy artifact
25+
shell: "nohup java -jar {{ app_folder }}/{{ app_artifact_id }}-{{ app_version }}.jar &"

app_deployment_demo/roles/download_package/tasks/main.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
- name: Perform simple health checks to ensure web page is still running properly
3+
uri:
4+
url: "{{ web_app_url }}"
5+
method: GET
6+
return_content: yes

app_deployment_demo/sanity_test.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
- name: Check that web app is still running after updates
3+
hosts: localhost
4+
gather_facts: false
5+
6+
roles:
7+
- sanity_test

0 commit comments

Comments
 (0)