-
Notifications
You must be signed in to change notification settings - Fork 0
/
play.yml
71 lines (58 loc) · 2.74 KB
/
play.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
- hosts: localhost
tasks:
- name: Build images
command: docker build -t lotaris/{{ item }} {{ item }}
with_items:
- bash
- serf-srv
# - unicorn-rbenv
# - redis-data
# - redis-srv
# - pg-data
# - pg-srv
# - pg-init
# - rox-center
# - rox-center-commander
# - resque
# - nginx
- java-serf
- glassfish-base
- jenkins-base
- mysql-data
- mysql-srv
- mysql-init
# - sonarqube-mysql-init
# - sonarqube-srv
- glassfish-data
- glassfish-node
- jenkins-srv
- nginx-glassfish-lb
- nginx-angular-lb
- nginx-angular-data
- nginx-angular-node
# - name: Docker cleanup
# shell: "docker rmi $(docker images -f 'dangling=true' -q)"
- name: Start serf server
command: docker run -dP --name serf-gf-cluster lotaris/serf-srv
- name: Prepare data container for todolist backend
command: docker run -v /data --name mysql-data lotaris/mysql-data
- name: Inialize mysql for todolist backend
command: docker run --rm --volumes-from mysql-data lotaris/mysql-init
- name: Start mysql container for todolist backend
command: docker run -dP --volumes-from mysql-data --name mysql-srv lotaris/mysql-srv
- name: Prepare data container for glassfish and jenkins
command: docker run -v /artifacts --name gf-data lotaris/glassfish-data
- name: Prepare data container for todolist frontend
command: docker run -v /frontend --name nginx-angular-data lotaris/nginx-angular-data
- name: Start Jenkins container for todolist backend
command: docker run -dP --volumes-from gf-data --volumes-from nginx-angular-data --link /mysql-srv:mysql-srv --link /serf-gf-cluster:serf-gf-cluster --name jenkins-srv lotaris/jenkins-srv
- name: Start the Glassfish Load balancer
command: docker run -dP --link /serf-gf-cluster:serf-gf-cluster --name nginx-gf-lb lotaris/nginx-glassfish-lb
- name: Start the Angular Load balancer
command: docker run -dP --link /serf-gf-cluster:serf-gf-cluster --name nginx-angular-lb lotaris/nginx-angular-lb
- name: Start Glassfish nodes container for todolist backend
command: docker run -dP --volumes-from gf-data --link /mysql-srv:mysql-srv --link /serf-gf-cluster:serf-gf-cluster --env NODE_NAME=gf-node-{{ item }} --name gf-node-{{ item }} lotaris/glassfish-node
with_sequence: count=2
- name: Start the frontend application containers
command: docker run -dP --volumes-from nginx-angular-data --link /serf-gf-cluster:serf-gf-cluster --env NODE_NAME=nginx-angular-node-{{ item }} --name nginx-angular-node-{{ item }} lotaris/nginx-angular-node
with_sequence: count=2