Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
95e50a1
commit faebf8f
Showing
5 changed files
with
59 additions
and
60 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,13 @@ | ||
|
||
setup: | ||
ansible-playbook -vv --exclude-tags vhost playbooks/setup.py | ||
|
||
deploy: | ||
tar cpf - playbooks | ssh -t apps@54.205.144.51 " \ | ||
tar xpf - -C /tmp && \ | ||
cd /tmp/playbooks && \ | ||
bash /tmp/playbooks/deploy.sh && \ | ||
rm -rf /tmp/playbooks \ | ||
" | ||
restart: | ||
ssh -t apps@54.205.144.51 'bash -s' < playbooks/restart.sh |
This file was deleted.
Oops, something went wrong.
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,43 @@ | ||
# yaml-language-server: $schema=https://json.schemastore.org/ansible-playbook.json | ||
|
||
- hosts: web1 | ||
gather_facts: no | ||
|
||
vars: | ||
ansible_user: apps | ||
ansible_ssh_user: apps | ||
|
||
IMAGE_NAME: ghcr.io/somosaseb/somosaseb-api:latest | ||
CONTAINER_NAME: api.aseb.bo | ||
ENV_FILE: "/home/apps/.env" | ||
|
||
container_default: &container_default | ||
container_default_behavior: no_defaults | ||
image: "{{IMAGE_NAME}}" | ||
env_file: "{{ENV_FILE}}" | ||
network_mode: host | ||
pull: yes | ||
init: yes | ||
|
||
tasks: | ||
- name: Run migrations | ||
community.docker.docker_container: | ||
<<: *container_default | ||
name: run-migrations | ||
detach: no | ||
cleanup: yes | ||
command: gosu app python src/manage.py migrate | ||
tags: | ||
- migrations | ||
|
||
- name: Restart container | ||
community.docker.docker_container: | ||
<<: *container_default | ||
name: "{{ CONTAINER_NAME }}" | ||
detach: yes | ||
restart: yes | ||
recreate: yes | ||
hostname: backend | ||
restart_policy: unless-stopped | ||
command: "/app/bin/runserver" | ||
stop_timeout: 0 |
This file was deleted.
Oops, something went wrong.