Skip to content

Scripts

All scripts can be run with ./scripts/[script].

Daily use scripts

ScriptENVDescription
start or initdevBoots up docker-containers and initialize the database (shorthand containers-init)
restartdevRestarts the docker-containers and clears the assets-folder (shorthand containers-restart)
stop [env]dev/testStops the docker-containers (shorthand containers-stop)
seeddevSeeds the database with fake data and runs maintenance scripts (shorthand db-seed)
clean [modules/full]Removes anything added by start/test scripts (expect docker-images); add modules to delete also node-modules, add full to remove docker images too

Codestyle scripts

ScriptENVDescription
lintdevFull code linting
lint-jsdevclient/websocket - Javascript code linting
lint-phpdevsrc - PHP code linting
fixdevFull code fixing
fix-jsdevclient/websocket - Javascript code fixing
fix-phpdevsrc - PHP code fixing

Testing scripts

ScriptENVDescription
testtestWithout parameters, it runs all tests in the src folder and only initialize when no test container is running
test [suite] [test]testRuns a specific suite test example: test Api BasketApiCest
test-jstestRuns all tests in the client folder
test-websockettestRuns all tests in the websocket folder
test-e2edevRuns all playwright tests
test e2e [test]testRuns a specific suite test example on playwright: test bcard

Container scripts

ScriptENVDescription
containers-builddevBuilds the docker-containers
containers-initdevBoots up docker-containers and initialize the database
containers-startdevStart the docker-containers and clears assets
containers-restartdevRestarts the docker-containers and clears the assets-folder
containers-stop [env]dev/testStops the docker-containers

Database scripts

ScriptENVDescription
db-initdevInitialize the database, Seeds with fake data and runs maintenance scripts
db-seeddevSeeds the database with fake data and runs maintenance scripts
db-drop [env]dev/testDrop the database
db-dump(dev)Run a mysqldump command in correct context
db-run [command](dev)Run a mysql command in correct context: mysql foodsharing "select * from fs_foodsaver"

DevDocs scripts

ScriptENVDescription
db-docs-build(dev)Generates the database overview

Other helping scripts

ScriptENVDescription
symfony-console [command]Docker wrapper for bin/console, runs both symfony and custom foodsharing commands
composer [command](dev)Docker wrapper for composer
docker-compose [command](dev)Wrapper for docker compose to deal with dev/test envs and our config structure
run-daily-maintenancedevRuns the daily maintenance, which is used to calculate stats and some database stuff

CI scripts

ScriptENVDescription
ci-backend-buildCI
ci-backend-testCI
ci-doc-buildCI
ci-notify-outdatedCI

DEPLOYMENT scripts

ScriptENVDescription
deploy
deploy-generate_revision
deploy-notify-slack
deploy-websocket-restart