Download the PHP package cre8-it/vincrease without Composer
On this page you can find all versions of the php package cre8-it/vincrease. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cre8-it/vincrease
More information about cre8-it/vincrease
Files in cre8-it/vincrease
Package vincrease
Short Description A Package to increase a Version-Number .env key mainly for continuous deployment
License MIT
Homepage https://cre8-it.de/
Informations about the package vincrease
Version Management Command
This package provides a set of Artisan commands for managing version numbers in your Laravel project, particularly for handling the APP_VERSION
in your .env
file. It is designed for continuous deployments and follows semantic versioning to keep track of application updates.
Installation
-
Install the package via Composer:
- (Optional) Publish the configuration file if you need to modify settings:
Available Commands
vincrease:init
Initializes the APP_VERSION
in your .env
file if it does not exist. You can provide a custom version with the --app-version
option.
Options:
--app-version
: The version number to set (e.g.,0.1.4
). If not provided, defaults to1.0.0
.
Usage:
To specify a version:
vincrease:up
Increases the version number in APP_VERSION
in your .env
file. By default, it increments the patch version, but you can specify the level of increment (major, minor, patch).
Usage:
By default, increase the patch version:
To increase the major version:
Integrations
Services like Ploi and Forge are just two examples of how it can be integrated, but similar functionality can be achieved with other deployment providers. Refer to their documentation for details on how to pass versioning parameters or modify deployment scripts accordingly.
Using vincrease
with Ploi
If you're using Ploi.io for deployment, you can integrate vincrease
into your deployment script to ensure the APP_VERSION
is incremented with each deploy, depending on the type of version increase you hint in your latest commit message for example.
Example deployment script:
For Laravel Forge, you can modify your deployment script to include vincrease
, ensuring that each deployment updates the application version, based on environment variables injected into your deployment script by Forge.
Example deployment script:
Additionally, Forge allows passing query parameters to deployment triggers. This means you can dynamically control version increments by passing type=major
or type=minor
in the trigger URL:
Forge will then inject a FORGE_VAR_TYPE
variable that can be used in your deployment script:
Why use vincrease
?
automatically updating an APP_VERSION
might be useful to:
- Pass the version in response headers to enable cache and asset invalidation on the client-side after each deployment.
- Track and log deployments, making it easier to correlate issues with specific releases.
- Use the version number in API responses for debugging and version control in client applications.
- Ensure version consistency across distributed systems or microservices by syncing version numbers.
- Integrate with monitoring tools to tag logs and error reports with the current application version.
Testing
Running Tests and Code Quality Tools
This project includes a few commands to help with code quality and testing:
- Refactor: Runs Rector to refactor the codebase.
- Lint: Runs Pint to lint the codebase for style issues.
- Test: Runs a set of tests with the following steps:
- Refactor (with
--dry-run
to check refactorable issues) - Run pint to check linting
- Run type checks with PHPStan at level 7
- Run unit tests using Pest with code coverage, parallel execution, and a minimum coverage of 100%
- Refactor (with
Available Composer Commands:
-
Fix: Run all refactoring and linting tasks:
- Test: Run all testing tasks (refactor, lint, types, and unit tests):
License
This package is open-source and available under the MIT License.