create blue/green compose files
Some checks failed
ci / test (push) Failing after 7m55s
fp/our CI/CD / build (push) Successful in 1m46s

This commit is contained in:
CJ_Clippy 2025-10-05 08:19:50 -08:00
parent 6b33ef7816
commit 91b26b4120
4 changed files with 25 additions and 31 deletions

View File

@ -20,19 +20,17 @@
clone: true
force: true
- name: Copy the db compose file
- name: Copy compose files
ansible.builtin.copy:
remote_src: true
src: /tmp/checkout/services/our/compose.db.yaml
dest: /etc/futureporn/our/compose.db.yaml
mode: "0744"
- name: Copy the compose file
ansible.builtin.copy:
remote_src: true
src: /tmp/checkout/services/our/compose.production.yaml
dest: /etc/futureporn/our/compose.production.yaml
src: "/tmp/checkout/services/our/{{ item }}"
dest: "/etc/futureporn/our/{{ item }}"
mode: "0744"
loop:
- compose.db.yaml
- compose.production.yaml
- compose.green.yaml
- compose.blue.yaml
- name: Deploy db stack
community.docker.docker_stack:
@ -47,14 +45,7 @@
name: our-green
compose:
- /etc/futureporn/our/compose.production.yaml
- version: "3"
services:
server:
ports:
- target: 5000 # container port
published: 8086 # Swarm ingress port
protocol: tcp
mode: ingress
- /etc/futureporn/our/compose.green.yaml
- name: Deploy stack to blue
community.docker.docker_stack:
@ -62,14 +53,7 @@
name: our-blue
compose:
- /etc/futureporn/our/compose.production.yaml
- version: "3"
services:
server:
ports:
- target: 5000 # container port
published: 8087 # Swarm ingress port
protocol: tcp
mode: ingress
- /etc/futureporn/our/compose.blue.yaml
# - name: Remove stack
# community.docker.docker_stack:
# name: mystack

View File

@ -0,0 +1,7 @@
services:
server:
ports:
- target: 5000
published: 8087
protocol: tcp
mode: ingress

View File

@ -0,0 +1,7 @@
services:
server:
ports:
- target: 5000 # container port
published: 8086 # Swarm ingress port
protocol: tcp
mode: ingress

View File

@ -9,11 +9,7 @@ services:
sh -c "npx prisma migrate deploy && npm run start:server"
volumes:
- /mnt/vfs/futureporn:/mnt/vfs/futureporn
ports:
- target: 5000 # container port
published: 8084 # Swarm ingress port
protocol: tcp
mode: ingress
# blue/green ports get published in those respective compose fragments
worker:
image: gitea.futureporn.net/futureporn/our:latest