Skip to content
This repository has been archived by the owner on Sep 10, 2020. It is now read-only.
/ deploy Public archive

Set and retrieve the date and time when the last deployment of your Laravel-app occurred.

License

Notifications You must be signed in to change notification settings

olssonm/deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deploy

Latest Version on Packagist Software License Build Status


⚠️ This project is abandoned!

Due to low usage this project is currently abandoned and hasn't been updated since Laravel 5.2.


A simple Laravel-package to write a deploy file to your storage path. This file can then be used to check when the last deploy occurred. Useful for both debugging purposes and if you need to keep track of builds, updates etc.

Installation

$ composer require "olssonm/deploy:^1.0"

Only tested for Laravel >= 5.5 but should work with any version of Laravel higher than 5.1. This package does require PHP >= 7.0 however.

The package will be auto-discovered in Laravel >= 5.5, else you can add it to your providers array (config/app.php):

'providers' => [
    Olssonm\Deploy\ServiceProvider::class
]

Usage

olssonm\deploy comes with a set of Artisan-command that you can use straight out of the box:

deploy:make

$ php artisan deploy:make
// Deployed @ 2017-12-02 09:22:11

Writes the deployment-file for inspection and timekeeping. Per default the file is located in your storagepath/app/deploy.txt.

deploy:when

$ php artisan deploy:when
// Last deploy occurred @ 2017-12-02 09:22:11

Displays the time and date of the last deploy.

In app

You can also use the Olssonm\Deploy\Deploy-class for other more custom functions.

use Olssonm\Deploy\Deploy;

$deploy = new \Olssonm\Deploy\Deploy();
$deploy->make(); // Writes "now" as the deployment time
$deploy->when(); // Retrieves the last deployment time as a Carbon-instance

The class is also available for dependency injection:

use Olssonm\Deploy\Deploy;

public function when(Deploy $deploy)
{
    return $deploy->when();
}

Or via the facade (register Olssonm\Deploy\Facades\Deploy::class in your aliases-array) or app singleton;

app('deploy')->when()->format('Y-m-d'); // App singleton
Deploy::when()->format('Y-m-d'); // Via an alias

Pro tip: if you are using a custom deploy routine where you run composer install you can add php artisan deploy:make to your list of post-install-cmd-commands to automatically fire the command:

"scripts": {
    "post-install-cmd": [
        "php artisan deploy:make"
    ]
}

Testing

$ composer test

or

$ phpunit

License

The MIT License (MIT). Please see License File for more information.

© 2018 Marcus Olsson.

About

Set and retrieve the date and time when the last deployment of your Laravel-app occurred.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages