Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/manual-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@ jobs:
scp "${scp_opts[@]}" "${bundle_root}/sites/le-petit-coin-prod.conf.template" "${remote_target}:${REMOTE_DIR}/sites/le-petit-coin-prod.conf.template"
scp "${scp_opts[@]}" "${bundle_root}/sites/vif-prod.conf.template" "${remote_target}:${REMOTE_DIR}/sites/vif-prod.conf.template"

ssh "${ssh_opts[@]}" "${remote_target}" bash -se -- "${REMOTE_DIR}" "${STACK_NAME}" <<'EOF'
deploy_revision="${GITHUB_SHA::12}"
ssh "${ssh_opts[@]}" "${remote_target}" bash -se -- "${REMOTE_DIR}" "${STACK_NAME}" "${deploy_revision}" <<'EOF'
set -euo pipefail
remote_dir=$1
stack_name=$2
deploy_revision=$3
deploy_env=production
env_deploy="${remote_dir}/envs/${deploy_env}/.env.deploy"
for app_network in \
Expand All @@ -131,16 +133,24 @@ jobs:
-f "${remote_dir}/envs/${deploy_env}/compose.yml" \
config > "${remote_dir}/stack.rendered.yml"

python3 - "${remote_dir}/stack.rendered.yml" "${remote_dir}/stack.yml" <<'PY'
python3 - "${remote_dir}/stack.rendered.yml" "${remote_dir}/stack.yml" "${deploy_revision}" <<'PY'
from pathlib import Path
import sys

source = Path(sys.argv[1])
target = Path(sys.argv[2])
revision = sys.argv[3]
text = source.read_text()
text = text.replace('published: "80"', 'published: 80')
text = text.replace('published: "443"', 'published: 443')
text = "\n".join(line for line in text.splitlines() if line != "name: nginx") + "\n"
lines = []
for line in text.splitlines():
if line == "name: nginx":
continue
if line.startswith(" name: nginx_") and line.endswith("_conf"):
line = f"{line}_rev{revision}"
lines.append(line)
text = "\n".join(lines) + "\n"
target.write_text(text)
PY

Expand Down
3 changes: 3 additions & 0 deletions sites/vif-prod.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ server {
set $vif_prod_upstream ${VIF_PROD_UPSTREAM};
proxy_pass $vif_prod_upstream;
proxy_http_version 1.1;
proxy_buffer_size 32k;
proxy_buffers 8 32k;
proxy_busy_buffers_size 64k;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_set_header Connection $connection_upgrade;
Expand Down