Last active
September 25, 2015 16:03
-
-
Save dltj/81dca4e22f4f747cc639 to your computer and use it in GitHub Desktop.
CollectionSpace Redeploy Config Playbook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Redeploy CSpace Code to CSpace Tomcat | |
hosts: all | |
tasks: | |
- name: Shut down CSpace Tomcat before deployment | |
sudo: true | |
service: | |
name: cspace-tomcat | |
state: stopped | |
- name: Ensure application tenant resource file is hard linked | |
file: | |
src: "~/{{ tenant_source }}/application-tenant.xml" | |
dest: "~/collectionspace-source/application/tomcat-main/src/main/resources/{{ tenant_shortname }}-tenant.xml" | |
state: hard | |
force: true | |
- name: Build CSpace application | |
shell: source ~/bash-env && mvn clean install -DskipTests | |
args: | |
chdir: collectionspace-source/application | |
executable: /bin/bash | |
- name: Build CSpace services | |
shell: source ~/bash-env && ant deploy_services_artifacts | |
args: | |
chdir: collectionspace-source/services/services/JaxRsServiceProvider | |
executable: /bin/bash | |
- name: Build CSpace ui | |
shell: source ~/bash-env && mvn clean install -DskipTests | |
args: | |
chdir: collectionspace-source/ui | |
executable: /bin/bash | |
- name: Start CSpace Tomcat after deployment | |
sudo: true | |
service: | |
name: cspace-tomcat | |
state: started | |
- name: Wait for Tomcat to start | |
wait_for: | |
host: "{{ inventory_hostname }}" | |
port: 8180 | |
state: started | |
delay: 10 | |
- name: Wait for CSpace UI and get login cookie | |
uri: | |
url: http://{{ inventory_hostname }}:8180/collectionspace/tenant/{{ tenant_shortname }}/login | |
method: POST | |
body: "userid={{ web_csadmin_user}}&password={{ web_csadmin_pass }}" | |
status_code: 303 | |
follow_redirects: none | |
timeout: 120 | |
HEADER_Content-Type: "application/x-www-form-urlencoded" | |
register: login_register | |
- name: Initialize UI | |
uri: | |
url: http://{{ inventory_hostname }}:8180/collectionspace/tenant/{{ tenant_shortname }}/init | |
method: GET | |
status_code: 200 | |
timeout: 120 | |
HEADER_Cookie: "{{ login_register.set_cookie }}" | |
- name: Initialize Authorities | |
uri: | |
url: http://{{ inventory_hostname }}:8180/collectionspace/tenant/{{ tenant_shortname }}/authorities/initialise | |
method: GET | |
status_code: 200 | |
timeout: 120 | |
HEADER_Cookie: "{{ login_register.set_cookie }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment