oonyeje-portfolio/ansible/playbook.staging.yml
oonyeje 86f4da9749 - added drone files
- added docker files
- added ansible deployment files
2023-10-09 07:45:57 -04:00

61 lines
1.5 KiB
YAML
Executable File

- name: deploy docker stack
hosts: localhost
tasks:
- name: Tear down existing services
community.docker.docker_compose:
project_src: ../
state: absent
- name: Create and start services
community.docker.docker_compose:
project_src: ../
register: output
- name: Show results
ansible.builtin.debug:
var: output
- name: Run `docker-compose up` again
community.docker.docker_compose:
project_src: ../
build: false
register: output
# - name: Show results
# ansible.builtin.debug:
# var: output
# - ansible.builtin.assert:
# that: not output.changed
# - name: Stop all services
# community.docker.docker_compose:
# project_src: ../
# build: false
# stopped: true
# register: output
- name: Show results
ansible.builtin.debug:
var: output
- name: Verify that app and db services are running
ansible.builtin.assert:
that:
- "not output.services.app.oonyeje-portfolio_app_1.state.running"
# - name: Restart services
# community.docker.docker_compose:
# project_src: ../
# build: false
# restarted: true
# register: output
- name: Show results
ansible.builtin.debug:
var: output
# - name: Verify that app and db services are running
# ansible.builtin.assert:
# that:
# - "not output.services.app.oonyeje-portfolio_app_1.state.running"