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 clone: true
force: true force: true
- name: Copy the db compose file - name: Copy compose files
ansible.builtin.copy: ansible.builtin.copy:
remote_src: true remote_src: true
src: /tmp/checkout/services/our/compose.db.yaml src: "/tmp/checkout/services/our/{{ item }}"
dest: /etc/futureporn/our/compose.db.yaml dest: "/etc/futureporn/our/{{ item }}"
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
mode: "0744" mode: "0744"
loop:
- compose.db.yaml
- compose.production.yaml
- compose.green.yaml
- compose.blue.yaml
- name: Deploy db stack - name: Deploy db stack
community.docker.docker_stack: community.docker.docker_stack:
@ -47,14 +45,7 @@
name: our-green name: our-green
compose: compose:
- /etc/futureporn/our/compose.production.yaml - /etc/futureporn/our/compose.production.yaml
- version: "3" - /etc/futureporn/our/compose.green.yaml
services:
server:
ports:
- target: 5000 # container port
published: 8086 # Swarm ingress port
protocol: tcp
mode: ingress
- name: Deploy stack to blue - name: Deploy stack to blue
community.docker.docker_stack: community.docker.docker_stack:
@ -62,14 +53,7 @@
name: our-blue name: our-blue
compose: compose:
- /etc/futureporn/our/compose.production.yaml - /etc/futureporn/our/compose.production.yaml
- version: "3" - /etc/futureporn/our/compose.blue.yaml
services:
server:
ports:
- target: 5000 # container port
published: 8087 # Swarm ingress port
protocol: tcp
mode: ingress
# - name: Remove stack # - name: Remove stack
# community.docker.docker_stack: # community.docker.docker_stack:
# name: mystack # 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" sh -c "npx prisma migrate deploy && npm run start:server"
volumes: volumes:
- /mnt/vfs/futureporn:/mnt/vfs/futureporn - /mnt/vfs/futureporn:/mnt/vfs/futureporn
ports: # blue/green ports get published in those respective compose fragments
- target: 5000 # container port
published: 8084 # Swarm ingress port
protocol: tcp
mode: ingress
worker: worker:
image: gitea.futureporn.net/futureporn/our:latest image: gitea.futureporn.net/futureporn/our:latest