Executes build commands and cleanup files

Installs: 10

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 5

Forks: 0

Open Issues: 0

Type:composer-plugin

v1.0.4 2022-06-30 07:03 UTC

This package is auto-updated.

Last update: 2024-04-29 04:59:57 UTC


README

Contributors Forks Stargazers Issues License

Logo

Builder

Composer builder plugin
Report Bug · Request Feature

Summary

This composer plugin will check for build and cleanup configuration on composer packages that is being installed from the same composer.json file. The intended usage for this is in build pipeline and local development environment.

Requirements

Install

composer require helsingborg-stad/builder

Build command

I any composer package that need to be built the below should be in composer.json file like this.

{
    "extra": {
        "builder": {
            "commands": [
                "npm ci",
                "npm run build",
            ]
        }
    }
}

Cleanup

Any files that should be cleaned up after build in required packages should be in the composer.json file like this.

{
    "extra": {
        "builder": {
            "removables": [
                ".git",
                ".gitignore"
            ]
        }
    }
}

Pipeline commands example

When running build for production the enable cleanup config should be enabled before install.
This should BE USED WITH CAUTION as it will delete files from your system and the setting should not be commited but added during build in a pipeline.

composer config extra.builder.cleanup true
composer install

This will be added in the composer.json

    "extra": {
        "builder": {
            "cleanup": "true"
        }
    }

Run tests

composer install
composer run test

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License.

Acknowledgements