-
Notifications
You must be signed in to change notification settings - Fork 8
/
deploy.yml
67 lines (57 loc) · 2 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
# This playbook deploys a whole new stack with the current `deployment_stamp`
# (see main.yml)
- name: Deploy selected applications
hosts: local
gather_facts: false
pre_tasks:
- name: Check configuration
ansible.builtin.import_tasks: tasks/check_configuration.yml
- name: Check apps filter
ansible.builtin.import_tasks: tasks/check_apps_filter.yml
tasks:
- name: Display playbook name
ansible.builtin.debug: msg="==== Starting deploy playbook ===="
tags: deploy
# Set the deployment stamp value for this deployment
- name: Set deployment stamp
ansible.builtin.set_fact: deployment_stamp="d-{{ lookup('pipe', 'date +%y%m%d-%Hh%Mm%Ss') }}"
tags: deploy
- name: Set vars
ansible.builtin.import_tasks: tasks/set_vars.yml
# Set the job stamp for this deployment
- name: Set job stamp
ansible.builtin.set_fact: job_stamp="j-{{ lookup('pipe', 'date +%y%m%d-%Hh%Mm%Ss') }}"
tags: deploy
- name: Display deployment details
ansible.builtin.debug: msg="Deploying {{ namespace_name }}-{{ domain_name }} (deployment stamp '{{ deployment_stamp }}' job stamp '{{ job_stamp }}')"
tags: deploy
- name: Display apps to deploy
ansible.builtin.debug:
var: apps
tags: deploy
- name: Run tasks for apps
ansible.builtin.include_tasks: tasks/run_tasks_for_apps.yml
vars:
suspend_cronjob: true
tasks:
- tasks/get_objects_for_app
- tasks/check_app_secrets
- tasks/create_app_config
- tasks/manage_app
tags:
- config
- deploy
# Patch all next static services of all apps after deploy
- name: Run tasks for apps
ansible.builtin.include_tasks: tasks/run_tasks_for_apps.yml
vars:
prefix: "next"
tasks:
- get_objects_for_app
- deploy_get_stamp_from_static_service
- deploy_patch_static_service
- delete_app
tags:
- static_service
- deploy