Skip to content

Example console commands for Composer Stager

License

Notifications You must be signed in to change notification settings

php-tuf/composer-stager-console

Folders and files

NameName
Last commit message
Last commit date
Jun 25, 2024
Apr 15, 2024
Jun 10, 2022
Apr 15, 2024
Apr 24, 2024
Apr 15, 2024
Jul 26, 2022
Mar 6, 2023
Apr 24, 2024
Feb 21, 2022
May 22, 2023
Feb 20, 2025
Mar 4, 2025
Feb 20, 2025
Jun 25, 2024
Mar 6, 2023
Jul 25, 2022

Repository files navigation

Example Composer Stager Console Command

This repository provides a reference implementation of Composer Stager as a console command for use via a terminal or a cron job. It is provides for illustration purposes only; it is unsupported.

Warning!

This repository is for testing and illustration only. It is unsupported. There are no plans to release it as an official, supported package unless the community indicates adequate demand.

Console command

The console command is used by installing it via Git and invoking its executable:

git clone https://github.com/php-tuf/composer-stager-console.git
composer install --working-dir=composer-stager-console
php composer-stager-console/bin/composer-stage

Optionally, an alias is handy:

alias cs=$(pwd)/composer-stager-console/bin/composer-stage

Available commands

  • begin - Begins the staging process by copying the active directory to the staging directory.
  • stage - Executes a Composer command in the staging directory.
  • commit - Makes the staged changes live by syncing the active directory with the staging directory.
  • clean - Removes the staging directory.

Example workflow:

# Copy the codebase to the staging directory.
bin/composer-stage begin

# Run a Composer command on it.
bin/composer-stage stage -- require example/package --update-with-all-dependencies

# Sync the changes back to the active directory.
bin/composer-stage commit --no-interaction

# Remove the staging directory.
bin/composer-stage clean --no-interaction

As an example of implementation

This repository provides the simplest implementation possible in its context. The fact that it is a Symfony Console application is incidental but does require certain scaffolding that is beside the point. The important files for the purpose of illustration are these:

About

Example console commands for Composer Stager

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages