Skip to content

Deploy pipeline

App Service is configured with Oryx builds (SCM_DO_BUILD_DURING_DEPLOYMENT=true). Collectstatic is disabled during Oryx (DISABLE_COLLECTSTATIC=true) and runs at startup instead.

Bootstrap

PRE_BUILD_COMMAND is:

curl -sSL https://bootstrap.django-azu.re | bash

That downloads scripts from this repository’s deploy_scripts/ into the app checkout:

Destination Files
cicd/ pre_build.sh, post_build.sh, startup.sh, collectstatic.sh, gunicorn.conf.py, supervisord.conf, wsgi.py, html-minifier.json
utility/ pgdump.sh

Existing files are skipped, so you can vendor/customize by committing your own copies under cicd/.

Branch override: set App Setting CICD_SCRIPTS_BRANCH (default main).

After download, bootstrap runs cicd/pre_build.sh.

Pre-build (cicd/pre_build.sh)

  • If package.json exists: npm ci and npm run build:js (if present)
  • HTML minify via html-minifier-next (ENABLE_HTML_MINIFY, EXCLUDE_HTML_MINIFY)
  • SVG minify via svgo (ENABLE_SVG_MINIFY; optional cicd/svgo.config.mjs)
  • Optional Tailwind if TAILWIND_INPUT_PATH is set (TAILWIND_OUTPUT_PATH optional)
  • Install Poetry, export requirements.txt for Oryx
  • Write build-info.json from SCM_COMMIT_ID

Post-build (cicd/post_build.sh)

Runs as POST_BUILD_COMMAND. Prunes npm production deps when a lockfile is present.

Startup (cicd/startup.sh)

Configured as the site startup command by the package’s deploy layout:

  1. Optional EXTRA_APT_PACKAGES
  2. compilemessages (gettext)
  3. Background collectstatic.sh (collectstatic + purge_cdn)
  4. migrate
  5. purge_cache
  6. Supervisord RQ worker (rqworker with django_tasks_rq.Job) when tasks/Redis are enabled
  7. Optional consumer hook cicd/pre_startup.sh
  8. Gunicorn via cicd/gunicorn.conf.py loading cicd.wsgi

What the consumer app must provide

  • A Poetry project that exports cleanly to requirements.txt
  • DJANGO_SETTINGS_MODULE pointing at a module that imports this package’s Azure settings
  • Git repository wired via Pulumi repository_url / repository_branch
  • Optional: committed overrides under cicd/