- systemd and ansbile files added.

This commit is contained in:
gazebo
2018-07-31 14:49:32 +08:00
parent b8cef23e9b
commit 88470319f5
3 changed files with 35 additions and 0 deletions

13
deploy/ansible.yml Normal file
View File

@@ -0,0 +1,13 @@
---
- hosts: {{ deploy_hosts }}
remote_user: ubuntu
tasks:
- name: copy execute file to dest
copy:
src: jx-callback
dest: /jxdata/jx-callback/jx-callback
owner: ubuntu
group: ubuntu
mode: u=rwx, g=rx, o=r
- name: shell
shell: sudo systemctl restart jx-callback

View File

@@ -0,0 +1,20 @@
[Unit]
Description=jx-callback service
Requires=mysql.service
After=network.target
After=mysql.service
[Service]
Environment="GOPATH=/home/ubuntu/go/"
Type=simple
User=ubuntu
Group=ubuntu
Restart=always
RestartSec=500ms
WorkingDirectory=/jxdata/jx-callback
ExecStart=/bin/sh -c '/jxdata/jx-callback/jx-callback >> /jxdata/jx-callback/jx-callback.log 2>&1'
[Install]
WantedBy=multi-user.target