mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-19 05:55:51 +00:00
Adds basic ansible deployment
This commit is contained in:
parent
63d5dd3299
commit
f24fb87c1e
4 changed files with 55 additions and 2 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
@ -6,3 +6,10 @@ target/*
|
||||||
*.iml
|
*.iml
|
||||||
/target
|
/target
|
||||||
_site/
|
_site/
|
||||||
|
|
||||||
|
# Created by https://www.gitignore.io/api/ansible
|
||||||
|
|
||||||
|
### Ansible ###
|
||||||
|
*.retry
|
||||||
|
|
||||||
|
# End of https://www.gitignore.io/api/ansible
|
||||||
|
|
34
playbook.yaml
Normal file
34
playbook.yaml
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- hosts: all
|
||||||
|
become: yes
|
||||||
|
gather_facts: yes
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Copy systemd descriptor
|
||||||
|
copy:
|
||||||
|
src: src/main/systemd/spring-petclinic.service
|
||||||
|
dest: /etc/systemd/system/spring-petclinic.service
|
||||||
|
notify:
|
||||||
|
- reload systemd
|
||||||
|
|
||||||
|
- name: Copy spring-petclinic
|
||||||
|
copy:
|
||||||
|
src: target/spring-petclinic-1.5.1.jar
|
||||||
|
dest: /opt/spring-petclinic.jar
|
||||||
|
owner: deploy
|
||||||
|
mode: u+rwx
|
||||||
|
notify:
|
||||||
|
- restart service
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- name: reload systemd
|
||||||
|
systemd:
|
||||||
|
name: spring-petclinic
|
||||||
|
daemon_reload: yes
|
||||||
|
|
||||||
|
- name: restart service
|
||||||
|
service:
|
||||||
|
name: spring-petclinic
|
||||||
|
state: restarted
|
||||||
|
|
1
pom.xml
1
pom.xml
|
@ -130,6 +130,7 @@
|
||||||
<goal>build-info</goal>
|
<goal>build-info</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<executable>true</executable>
|
||||||
<additionalProperties>
|
<additionalProperties>
|
||||||
<encoding.source>${project.build.sourceEncoding}</encoding.source>
|
<encoding.source>${project.build.sourceEncoding}</encoding.source>
|
||||||
<encoding.reporting>${project.reporting.outputEncoding}</encoding.reporting>
|
<encoding.reporting>${project.reporting.outputEncoding}</encoding.reporting>
|
||||||
|
|
11
src/main/systemd/spring-petclinic.service
Normal file
11
src/main/systemd/spring-petclinic.service
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[Unit]
|
||||||
|
Description=spring-petclinic
|
||||||
|
After=syslog.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=deploy
|
||||||
|
ExecStart=/opt/spring-petclinic.jar
|
||||||
|
SuccessExitStatus=143
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in a new issue