- systemd and ansbile files added.
This commit is contained in:
13
deploy/ansible.yml
Normal file
13
deploy/ansible.yml
Normal 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
|
||||
20
deploy/jx-callback.service
Normal file
20
deploy/jx-callback.service
Normal 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
|
||||
Reference in New Issue
Block a user