-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsites-dist.yml
More file actions
218 lines (196 loc) · 7.76 KB
/
sites-dist.yml
File metadata and controls
218 lines (196 loc) · 7.76 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# ============================================
# SECTION: Local Server Deployment
# ============================================
# Case 1: Simple local deploy
# Description: Executes a deploy in a local environment.
# Command: fab2 deploy --site=app.localtest.cl
# Tested: Yes
app.localtest.cl:
repository: git@github.com:ejemplo/localtest.git
deploy_path: /var/www/sites/app.localtest.cl
branch: main
# runner: local (optional, defaults to local)
# Case 2: Local deploy with custom virtualenv
# Description: Uses a custom directory name for the virtual environment.
# Command: fab2 deploy --site=app.venvpersonalizado.cl
# Tested: Yes
app.venvpersonalizado.cl:
repository: git@github.com:ejemplo/venvtest.git
deploy_path: /var/www/sites/app.venvpersonalizado.cl
venv: custom_env
branch: main
# Case 3: Local deploy with shared files
# Description: Uses shared files and directories for persistence.
# Command: fab2 deploy --site=app.sharedlocal.cl
# Tested: Yes
app.sharedlocal.cl:
repository: git@github.com:ejemplo/shared.git
deploy_path: /var/www/sites/app.sharedlocal.cl
branch: main
shared_files:
- .env
shared_dirs:
- media
- logs
# ============================================
# SECTION: Remote SSH Deployment [NOT TESTED]
# ============================================
# Case 4: Remote deploy using -H
# Description: Deploy on remote server using -H flag.
# Command: fab2 -H user@1.2.3.4 deploy --site=app.remoteserver.cl
# Tested: No
app.remoteserver.cl:
repository: git@github.com:ejemplo/remoteserver.git
deploy_path: /var/www/sites/app.remoteserver.cl
branch: main
# Case 5: Remote deploy with host defined in config
# Description: Uses `host` field inside the config YAML.
# Command: fab2 deploy --site=app.sshconfig.cl
# Tested: No
app.sshconfig.cl:
host: user@1.2.3.4
repository: git@github.com:ejemplo/sshconfig.git
deploy_path: /var/www/sites/app.sshconfig.cl
branch: main
# Case 6: Remote with shared files and directories
# Description: Uses shared_files and shared_dirs on a remote server.
# Command: fab2 -H user@1.2.3.4 deploy --site=app.sharedremote.cl
# Tested: No
app.sharedremote.cl:
repository: git@github.com:ejemplo/sharedremote.git
deploy_path: /var/www/sites/app.sharedremote.cl
branch: main
shared_files:
- .env
shared_dirs:
- logs
- media
# ============================================
# SECTION: Local Docker Deployment
# ============================================
# Case 7: Deploy inside Docker container
# Description: Deploys the site inside a local Docker container.
# Command: fab2 deploy --site=app.dockertest.cl
# Tested: Yes
app.dockertest.cl:
repository: git@github.com:ejemplo/docker.git
deploy_path: /var/www/sites/app.dockertest.cl
branch: main
runner: docker
docker_container: derafu-sites-server-python-caddy
docker_user: admin
# Case 8: Docker deploy with custom venv
# Description: Uses a custom virtualenv path and enables Gunicorn logging.
# Command: fab2 deploy --site=app.dockervenv.cl
# Tested: Yes
app.dockervenv.cl:
repository: git@github.com:ejemplo/dockervenv.git
deploy_path: /var/www/sites/app.dockervenv.cl
branch: main
venv: .venv
runner: docker
docker_container: derafu-sites-server-python-caddy
docker_user: admin
# ============================================
# SECTION: Remote Docker Deployment (via SSH)
# ============================================
# Case 9: Docker deploy on remote server
# Description: Executes the deploy inside a Docker container remotely.
# Command: fab2 -H user@host deploy --site=app.remotedockertest.cl
# Tested: No
app.remotedockertest.cl:
repository: git@github.com:ejemplo/docker.git
deploy_path: /var/www/sites/app.remotedockertest.cl
branch: main
runner: docker
docker_container: derafu-sites-server-python-caddy
docker_user: admin
# Case 10: Remote Docker with custom venv
# Description: Docker deploy with custom venv path on a remote server.
# Command: fab2 -H user@host deploy --site=app.remotedockervenv.cl
# Tested: No
app.remotedockervenv.cl:
repository: git@github.com:ejemplo/dockervenv.git
deploy_path: /var/www/sites/app.remotedockervenv.cl
branch: main
venv: .venv
runner: docker
docker_container: derafu-sites-server-python-caddy
docker_user: admin
# Case 11: Remote Docker with host in config
# Description: Runs Docker deploy remotely using host from the config file.
# Command: fab2 deploy --site=app.remotedockerhost.cl
# Tested: No
app.remotedockerhost.cl:
host: user@remote.server.com
repository: git@github.com:ejemplo/docker.git
deploy_path: /var/www/sites/app.remotedockerhost.cl
branch: main
runner: docker
docker_container: derafu-sites-server-python-caddy
docker_user: admin
# ============================================
# SECTION: Special Cases
# ============================================
# Case 12: Docker with custom project subdirectory
# Description: wsgi.py is located in a subfolder with a custom name (not domain).
# The deploy script auto-detects the folder and uses it for Gunicorn.
# Command: fab2 deploy --site=app.customproject.cl
# Tested: Yes
app.customproject.cl:
repository: git@github.com:ejemplo/customproject.git
deploy_path: /var/www/sites/app.customproject.cl
branch: main
runner: docker
docker_container: derafu-sites-server-python-caddy
docker_user: admin
# ============================================
# SECTION: Writable Directories
# ============================================
# Case 13: Writable directories configuration
# Description: Defines folders that must be writable after deploy.
# Command: fab2 deploy --site=app.writeable.cl
# Tested: Yes
app.writeable.cl:
repository: git@github.com:ejemplo/writeable.git
deploy_path: /var/www/sites/app.writeable.cl
branch: main
writable_dirs:
- media
- logs
writable_chmod_mode: 775 # Optional, default is 775
writable_recursive: true # Optional, default is true
writable_use_sudo: false # Optional, default is false
# ============================================
# SECTION: Automatic Backup Support
# ============================================
# Case 16: Deploy with automatic backups
# Description: Creates a compressed backup before each deploy and retains only a limited number of backup files.
# This is useful for rollback or auditing purposes.
# Command: fab2 deploy --site=app.examplebackup.cl
# Status: Yes
app.examplebackup.cl:
repository: git@github.com:example/example.git
deploy_path: /var/www/sites/app.examplebackup.cl
branch: main
venv: .venv # Optional: custom virtual environment folder
runner: docker # Optional: "local", "ssh", or "docker" (default is "local")
docker_container: example-docker-container # Required if runner is docker
docker_user: admin # Optional
backup_path: /var/www/sites/backuplocal # Required: directory to store backups
max_backups: 3 # Optional: max number of backups to keep (default: 5)
# ============================================
# SECTION: Versioned Releases with Symlinks
# ============================================
# Case 17: Deploy with versioned releases
# Description: Each deploy is stored in its own timestamped folder under releases/.
# A symlink named 'current' is updated to point to the latest release.
# Only a limited number of releases are kept to save disk space.
# Command: fab2 deploy --site=app.examplereleases.cl
# Status: Yes
app.examplereleases.cl:
repository: git@github.com:example/example.git
deploy_path: /var/www/sites/app.examplereleases.cl
branch: main
runner: local # Optional: "local", "ssh", or "docker" (default is "local")
max_releases: 3 # Optional: number of releases to keep in releases/