-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.yml
57 lines (47 loc) · 1.41 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
- name: Deploy web-site
hosts: aghost
gather_facts: no
vars:
ansible_python_interpreter: /usr/bin/python
remote_path: /home/tabula/projectmanager
vars_prompt:
- name: commit
prompt: "What is the commit name?"
private: no
tasks:
- name: build assets & binary for production
delegate_to: localhost
shell: make build
- name: git push
delegate_to: localhost
shell: git add -A && git commit -m "{{ commit }}" ; git push origin master
- name: Copy config directory
copy:
src: "{{ playbook_dir }}/config/config.yml"
dest: "{{ remote_path }}/config/"
- name: Copy assets directory
copy:
src: "{{ playbook_dir }}/public/assets/"
dest: "{{ remote_path }}/public/assets/"
- name: Copy views directory
copy:
src: "{{ playbook_dir }}/views/"
dest: "{{ remote_path }}/views/"
- name: Creates directory
file:
path: "{{ remote_path }}/logs"
state: directory
- name: Copy service binary
copy:
src: "{{ playbook_dir }}/projectmanager-go"
dest: "{{ remote_path }}/"
mode: 0755
- name: Copy periodic task binary
copy:
src: "{{ playbook_dir }}/periodic-go"
dest: "{{ remote_path }}/"
mode: 0755
- name: restart service
shell: systemctl restart projectmanager
become: yes