Using docker-compose-ci: Difference between revisions

From Freephile Wiki
initial write-up
(No difference)

Revision as of 14:38, 26 November 2025

These notes need to be incorporated with Automated deployment of MediaWiki and also PHPUnit/VSCode

I added docker-compose-ci to the CrawlerProtection extension, and here is how to do it.

  1. create a Makefile
  2. create an .env file
  3. create a docker-compose-override.yml file in the 'build' directory

Makefile[edit]

do not specify COMPOSER_EXT=false or NODE_JS=false Any value will cause that code branch to run, potentially causing a build failure.

-include .env
export

# setup for docker-compose-ci build directory
ifeq (,$(wildcard ./build/))
    $(shell git submodule update --init --remote)
endif

EXTENSION=CrawlerProtection

# docker images
MW_VERSION?=1.43
PHP_VERSION?=8.2
DB_TYPE?=mysql
DB_IMAGE?="mariadb:11.2"

# composer
# Enables "composer update" inside of extension
# Leave empty/unset to disable, set to "true" to enable
COMPOSER_EXT?=

# nodejs
# Enables node.js related tests and "npm install"
# Leave empty/unset to disable, set to "true" to enable
NODE_JS?=

include build/Makefile

.env[edit]

Here's the .env file I used to set key variables[1] relevant to my extension.

# .env file example
MW_VERSION=1.43
PHP_VERSION=8.1
DB_TYPE=mysql
SMW_VERSION=6.0.1
PF_VERSION=5.7 # compatible with MW 1.43
# COMPOSER_EXT=true  # Uncomment to enable "composer update" inside extension
# NODE_JS=true  # Uncomment to enable Node.js and "npm install"
  1. See the project README for all the variables you can use.