2017 © Pedro Peláez
 

library git-info

automatic env configurations dependent on git branch (non-production) or tag (production)

image

artistan/git-info

automatic env configurations dependent on git branch (non-production) or tag (production)

  • Thursday, July 19, 2018
  • by Artistan
  • Repository
  • 1 Watchers
  • 0 Stars
  • 35 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Artistan/git-info

Packagist Packagist Coverage Status Build Status, (*1)

Artistan/git-info assists with dynamic environment configurations based on your git branch or tag., (*2)

git-info will create a config that you can use to link to dynamic places such as versioned cdn repository folders., (*3)

Works well as a simple Php object or as a package for Laravel 5.6., (*4)

composer

    "require": {
        "artistan/git-info": "*"
    }

cli install

composer require artistan/git-info 
php artisan vendor:publish --provider=artistan/git-info 

Example Laravel

./app/Providers/AppServiceProvider.php, (*5)

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        /**
         * last-cached will be null if not cached...
         */
        if (is_null(config('cdn.last-cached'))) {
            config([
                'cdn.last-cached' => microtime(true),
                /**
                 * This will set my path dynamically based on the tag/branch
                 */
                'cdn.path' => config('git-info.path'),
                'cdn.url' => config('cdn.uri').config('git-info.path')
            ]);
        }
        /**
         * now I can use config('cdn.url') to route to my current versioned content on my cdn
         */
    }

Example Php

require '../vendor/autoload.php';

$git = new Artistan\GitInfo\GitInfoEnv();

// build all dynamic with
var_dump($git->getConfigs('/path/[REPO]/[BRANCH]/[TAG]'))

// or dig into all the options...
var_dump($git->getShortHash());
var_dump($git->getVersion());
var_dump($git->getDate());
var_dump($git->getApplicationVersionString());
var_dump($repo = $git->getRepo());
var_dump($branch = $git->getBranch());
var_dump($tag = $git->getLatestTag());
// null coalesce allows $tag to failover to $branch if it is null
var_dump($path = $git->buildPath($repo,$branch,$tag??$branch,null));

will end up with /path/branchName or /path/{v#.#.#}, (*6)

Documentation Updates

PHP-Markdown-Documentation-Generator, (*7)

./vendor/bin/phpdoc-md generate --ignore=test,examples src > api.md

The Versions

19/07 2018

dev-deploy-methods

dev-deploy-methods https://github.com/Artistan/git-info

automatic env configurations dependent on git branch (non-production) or tag (production)

  Sources   Download

GPL-2.0-or-later

The Requires

 

The Development Requires

by Charles Peterson

laravel git configuration env automation dynamic info laravel 5.6

19/07 2018

dev-master

9999999-dev https://github.com/Artistan/git-info

automatic env configurations dependent on git branch (non-production) or tag (production)

  Sources   Download

GPL-2.0-or-later

The Requires

 

The Development Requires

by Charles Peterson

laravel git configuration env automation dynamic info laravel 5.6

19/07 2018

v2.0.0

2.0.0.0 https://github.com/Artistan/git-info

automatic env configurations dependent on git branch (non-production) or tag (production)

  Sources   Download

GPL-2.0-or-later

The Requires

 

The Development Requires

by Charles Peterson

laravel git configuration env automation dynamic info laravel 5.6

19/07 2018

2.0.1

2.0.1.0 https://github.com/Artistan/git-info

automatic env configurations dependent on git branch (non-production) or tag (production)

  Sources   Download

GPL-2.0-or-later

The Requires

 

The Development Requires

by Charles Peterson

laravel git configuration env automation dynamic info laravel 5.6

18/07 2018

1.0.3

1.0.3.0 https://github.com/Artistan/git-info

automatic env configurations dependent on git branch (non-production) or tag (production)

  Sources   Download

GPL-2.0-or-later

The Requires

 

The Development Requires

by Charles Peterson

laravel git configuration env automation dynamic info laravel 5.6

18/07 2018

1.0.2

1.0.2.0 https://github.com/Artistan/git-info

automatic env configurations dependent on git branch (non-production) or tag (production)

  Sources   Download

GPL-2.0-or-later

The Requires

 

The Development Requires

by Charles Peterson

laravel git configuration env automation dynamic info laravel 5.6

18/07 2018

1.0.1

1.0.1.0 https://github.com/Artistan/git-info

automatic env configurations dependent on git branch (non-production) or tag (production)

  Sources   Download

GPL-2.0-or-later

The Requires

 

The Development Requires

by Charles Peterson

laravel git configuration env automation dynamic info laravel 5.6

18/07 2018

1.0.0

1.0.0.0 https://github.com/Artistan/git-info

automatic env configurations dependent on git branch (non-production) or tag (production)

  Sources   Download

GPL-2.0-or-later

The Requires

 

The Development Requires

by Charles Peterson

git env automation info