codenamephp/build.cli

This package is abandoned and no longer maintained. No replacement package was suggested.

CLI frontend for the build commands which enable common project tasks like create a new project etc. via command line

1.0.2 2016-11-12 16:49 UTC

This package is auto-updated.

Last update: 2020-08-18 20:00:33 UTC


README

Installation

###Global

  composer global require codenamephp/build.cli

This will install the build tool globally. If you have set up your path to include the global composer bin folder, you can the execute the build command from anywhere in your shell.

Non-global

  composer create-project codenamephp/build.cli {local folder} dev-master --keep-vcs [--no-dev]

This checks out the latest version of the build command line interface to the specified local folder and keeps the git repo so it can be updated later on.

Update

Global

Just execute

  composer global require codenamephp/build.cli

again and make sure the latest version was selected. You can of course just manually update the version in your global composer.json and execute composer global update

Non-global

Since the the repo is cloned from git, just do a git pull && composer update in your local folder.

Configuration

The application is configured via a DI Container. The di/definitions folder includes all *.local.php files. Those files are excluded via .git commit and can therefore contain all local configurations like API Tokens, passwords, ...

All classes and values can be changed using the DI configuration.

In the same folder is also a properties.local.template.php file. Copy and rename it to properties.local.php and fill in the properties to get started. The template contains the following properties:

github.apiToken (string)

The auth token used to authenticate with the github API: https://help.github.com/articles/creating-an-access-token-for-command-line-use/ Make sure the token has the rights to create and edit repositories

github.organization (string)

The github organization that the repositories will be created in

packagist.apiToken (string)

The packagist authToken that is used when creating the webhook in the github repo

packagist.username (string)

The packagist username that is used when creating the webhook in the github repo

baseFolder (string)

The base path in which the projects will be created. The path must be absolute. If you set a base path of "/home/user/work" and give a project name of "project" , the final project path will be /home/user/work/project

Usage

The build tool is implemented as a Symfony CLI Application and the build script is the php executable.

Global

If you have installed the build tool globally and have your path set up to include the global composer bin folder, you can just

build <command>

anywhere on your system.

Non-global

Execute the binary where in your local working copy:

{local folder}/bin/build <command>

Commands, options and arguments

Some commands may also accept additional options and arguments, depending on their tasks. Run

build list

to get a complete list of commands and

build help <command>

to get additional descriptions for the command and a list of its options.

Available Commands

CreateProject

Creates a new project including the repository, base code from a prototype and so on. The following steps are executed:

  • Create the github repo
  • Create the project from composer prototype
  • Create master branch, set the created github repo as origin, add the local files, commit and push
  • Create a packagist webhook in the github repo