-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
48 lines (42 loc) · 1.15 KB
/
playbook.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
---
- name: web application deploy
hosts: west
remote_user: hank
vars:
branch: prod
homedir: "/home/{{ user }}"
org: aliencyborg
repo: shangri-lashow
user: hank
workdir: "{{ homedir }}/code/src/github.com/{{ org }}/{{ repo }}"
tasks:
- name: ensure workdir parent dir is present
file:
path: "{{ homedir }}/code/src/github.com/{{ org }}"
state: directory
- name: clone or update repo
git:
dest: "{{ workdir }}"
repo: "https://github.com/{{ org }}/{{ repo }}.git"
update: yes
version: "{{ branch }}"
- name: build docker image
docker_image:
force_source: yes
name: shangri-lashow
source: build
build:
path: "{{ workdir }}"
pull: no
- name: run docker container
docker_container:
expose: 80
image: shangri-lashow
name: shangri-lashow
recreate: yes
restart_policy: always
env:
HSTS: "off"
LETSENCRYPT_HOST: "www.shangri-lashow.com,shangri-lashow.com"
PORT: "80"
VIRTUAL_HOST: "www.shangri-lashow.com,shangri-lashow.com"