create blue/green compose files
This commit is contained in:
parent
6b33ef7816
commit
91b26b4120
@ -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
|
||||
|
7
services/our/compose.blue.yaml
Normal file
7
services/our/compose.blue.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
services:
|
||||
server:
|
||||
ports:
|
||||
- target: 5000
|
||||
published: 8087
|
||||
protocol: tcp
|
||||
mode: ingress
|
7
services/our/compose.green.yaml
Normal file
7
services/our/compose.green.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
services:
|
||||
server:
|
||||
ports:
|
||||
- target: 5000 # container port
|
||||
published: 8086 # Swarm ingress port
|
||||
protocol: tcp
|
||||
mode: ingress
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user