2017 © Pedro Peláez
 

project jinitialize

Modular and extensible automation scripts in php.

image

nonetallt/jinitialize

Modular and extensible automation scripts in php.

  • Wednesday, June 13, 2018
  • by nonetallt
  • Repository
  • 0 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Jinitialize

Modular and extensible automation scripts in php. Based on Symfony\Console component. This package was created to allow php programmers to create robust setup scripts for their projects that can be ran almost anywhere given the wide spread of php installations., (*1)

php jinitialize php-package

php-package procedure script, (*2)

Introduction

As the number of tools you use for your projects increases, so does the time required to set everything up. These tasks include but are not limited to: * Setting up version control * Setting up your testing tools * Setting up compilers (javascript with babel etc.) * Setting up automation scripts (watching file changes and running tests etc.) * Setting up local site to try out your web application * Setting up configuration for your favorite packages and libraries, (*3)

Even though more simplistic scripts can be used in even wider variety of environments, some of these tasks quickly become messy and lead to project specific installation scripts and duplicated code. Because of these reasons, it is ideal to break down the complex setup scripts into more modular, reusable components., (*4)

Installation

composer create-project nonetallt-jinitialize [my-project]

Commands

Commands are called by their command signature that always starts with the name of the plugin that command belongs to as command namespace. For example, to call a "create" command defined in the "project" plugin, you would enter the following command:, (*5)

php jinitialize project:create

You can pass arguments and options to the command by appending them to the command call:, (*6)

php jinitialize [command] [argument] [--option]

Procedures

Procedures are series of commands defined in json format. They can be executed same way as commands and allow you to pass results and information from executed commands to other commands that are part of the procedure., (*7)

{
    "example-procedure": {
        "description": "This is an example procedure",
        "commands": [
            "project:create",
            "project:folder newFolder"
        ]
    }
}

Example procedure for creating a php library package using three plugins; project, git and github., (*8)

{
"php-package": {
        "description": "Create a new generic php package.",
        "commands": [ 
            "project:create --path=[PACKAGES_DIRECTORY]",
            "project:folder src",
            "project:folder tests",
            "project:folder tests/Unit",
            "project:folder tests/Feature",
            "project:folder tests/input",
            "project:folder tests/expected",
            "project:folder tests/output",
            "project:copy [STUBS_FOLDER]/phpunit.xml phpunit.xml",
            "project:copy [STUBS_FOLDER]/composer.stub.json composer.json --env --exported",
            "git:init [project:path]",
            "github:authenticate [GIT_USER] [GIT_PASSWORD]",
            "github:create-repository [project:name] --private",
            "github:create-webhook [project:name] --name=packagist",
            "git:set-remote [github:ssh_url]",
            "git:ignore tags/",
            "git:ignore vendor/",
            "git:ignore tests/output",
            "core:shell 'ctags -f [project:path]/tags -R --fields=+laimS --languages=php --exclude=.git'"
        ]
    },
}

Settings

This project uses the dotenv library to easily load user defined options. Create a file called .env in the project root directory or create one from the .env.example file:, (*9)

cp .env.example .env
  • JINITIALIZE_PLACEHOLDER_FORMAT, the format used for replacing placeholder values in procedures, default: [$]

Jinitialize plugins can request default options for your convenience. A project plugin could for example request you to define DEFAULT_PROJECTS_FOLDER to suggest a reasonable default path when creating new projects. This way you don't have to type the full path each time., (*10)

DEFAULT_PROJECTS_FOLDER=/home/nonetallt/Code/packages

Plugins

List of plugins

list of plugins: https://nonetallt.com/jinitialize/plugins, (*11)

Installing plugins

Any packages that you require in your jinitialize project that define the "jinitialize-plugin" section in their extra section will be autopublished to bootstrap/cache/plugins.php. Installing a new plugin for your project is as simple as requiring it:, (*12)

composer require nonetallt/jinitialize-plugin-project

You can use either composer or the search command to look for packages, (*13)

composer search jinitialize-plugin-

php jinitialize core:search-plugins

Creating your own plugins

Check out the jinitialize-plugin boilerplate project for more information on how to create your own plugin packages., (*14)

The Versions

13/06 2018

dev-master

9999999-dev

Modular and extensible automation scripts in php.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jyri Mikkola

modular automation project setup extensible scripts jinitialize