Files
obs-deploy/obs/frontend.yml
2025-11-13 15:56:45 +08:00

43 lines
1.5 KiB
YAML

- name: OBS API Service Bundle
hosts: obs_frontend
tasks:
- name: Create Deployment Root Directory
ansible.builtin.file:
path: "{{ OBS_DEPLOY_LOCATION }}/frontend"
state: directory
- name: Copy Files
block:
- ansible.builtin.copy:
src: dockerfiles/Dockerfile.frontend
dest: "{{ OBS_DEPLOY_LOCATION }}/frontend/Dockerfile.frontend"
notify: Restart Container
- ansible.builtin.copy:
src: dockerfiles/common-files/
dest: "{{ OBS_DEPLOY_LOCATION }}/frontend/common-files"
mode: preserve
notify: Restart Container
- ansible.builtin.copy:
src: dockerfiles/frontend-files/
dest: "{{ OBS_DEPLOY_LOCATION }}/frontend/frontend-files"
mode: preserve
notify: Restart Container
- name: Populate Docker Compose
ansible.builtin.template:
src: docker-compose/api/docker-compose.yml
dest: "{{ OBS_DEPLOY_LOCATION }}/frontend/docker-compose.yml"
notify: Restart Container
- name: Force Restart Containers
when: restart_container is defined
changed_when: true
ansible.builtin.debug:
msg: "Force Restart Container"
notify: Restart Container
handlers:
- name: Restart Container
ansible.builtin.shell:
chdir: "{{ OBS_DEPLOY_LOCATION }}/frontend"
cmd: |
docker compose down || true
docker compose build --no-cache
docker compose up -d