forked from WSULib/state-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy-application.yml
74 lines (63 loc) · 2.06 KB
/
deploy-application.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
72
73
74
---
- name: deploy-application
hosts: all
become: yes
gather_facts: true
tasks:
- name: Deploy application
become_user: "{{ system_username }}"
shell: |
cd /opt/state-portal
docker-compose -p spotlight up --no-start
args:
executable: /bin/bash
- name: Wait for application to come online
pause:
seconds: 15
- name: Run DB scripts
become_user: "{{ system_username }}"
shell: |
cd /opt/state-portal
docker-compose -p spotlight run app bundle exec rake db:create
docker-compose -p spotlight run app bundle exec rake db:migrate
args:
executable: /bin/bash
- name: Create initial admin user
become_user: "{{ system_username }}"
expect:
command: docker-compose -p spotlight run app bundle exec rake spotlight:initialize
chdir: "/opt/state-portal"
responses:
.*Email.*: "{{ portal_email }}"
.*Password.*: "{{ portal_password }}"
- name: Create default exhibits
become_user: "{{ system_username }}"
shell: |
cd /opt/state-portal
docker-compose -p spotlight run app bundle exec rake db:seed
args:
executable: /bin/bash
- name: Deploy the entire application
become_user: "{{ system_username }}"
shell: |
cd /opt/state-portal
docker-compose -p spotlight up -d
args:
executable: /bin/bash
- name: Wait for application to fully deploy
pause:
seconds: 10
- name: Copy base configuration files to the Solr container
become_user: "{{ system_username }}"
shell: |
cd /opt/state-portal
docker cp -L solr/configsets/um $(docker ps -q -f "name=spotlight_solr"):/opt/solr/server/solr/configsets
args:
executable: /bin/bash
- name: Create Solr core
become_user: "{{ system_username }}"
shell: |
cd /opt/state-portal
docker exec $(docker ps -q -f "name=spotlight_solr") solr create_core -c portal -d um
args:
executable: /bin/bash