-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Symlinking on deploys & Rollback functionality (#8)
* Changes glimesh-web role to symlink deploys with states * Moves Glimesh shutdown to last possible place * Removes redundant comment in glimesh-web * Adds quick Ansible script to rollback Glimesh to prev version * Forgot to quote Ansible variable * Adds delegation & deletion to synchronize symlink deploys * Adds checking /opt/glimesh.tv dir exists * Changes deploys to use git hash * Fixed link target by disabling follow * Fixing missed prod build path to synchronize * Fixed bad when indent on delete old dirs * Maybe fixes directory deleting - fully tested in docker
- Loading branch information
Showing
2 changed files
with
157 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
- name: web | ||
hosts: web | ||
serial: 1 | ||
|
||
tasks: | ||
- name: Get old deployed hash | ||
stat: | ||
path: /opt/glimesh.tv-old | ||
follow: no | ||
get_checksum: no | ||
register: old_deploy | ||
|
||
- name: Change the symlink | ||
file: | ||
src: "{{ old_deploy.stat.lnk_target }}" | ||
dest: /opt/glimesh.tv | ||
state: link | ||
owner: nobody | ||
force: yes | ||
|
||
- name: restart glimesh | ||
systemd: | ||
name: glimesh | ||
daemon_reload: yes | ||
state: restarted | ||
|
||
- name: wait for service to be online | ||
wait_for: | ||
port: 8080 | ||
delay: 5 | ||
|
||
- name: pause to make sure the other node can take over | ||
pause: | ||
seconds: 15 |