Download the PHP package leobard/deploy-yourself without Composer

On this page you can find all versions of the php package leobard/deploy-yourself. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package deploy-yourself

Deploy Yourself

A script to update a kirby website code (not content) by pulling from git.

Camouflaged as plugin to look familiar, but actually called directly.

Useful when deployment of changes of a kirby website via FTP or RSYNC or direct shell access to the server is not feasibly, but the server allows you to use GIT via PHP exec(). This can be handy in restricted shared hosting environments.

Prerequisites

Installation

Install it via composer: composer require leobard/deploy-yourself

Copy the plugin into your plugins folder.

Copy deploy-yourself-hook.php to the main/root folder of your webserver where you also placed the kirby .htaccess and index.php. Adapt the paths there if necessary.

This will add deploy-yourself independent of Kirby to a route that is handled by deploy-yourself itself: https://example.com/deploy-yourself-hook.php.

Updating Kirby from a route outside of kirby seems better than from within a running Kirby process.

As default, this plugin will also register the same functionality as Kirby hook: https://example.com/deploy-yourself/hook.

It is recommended to hide the plugin's Kirby Panel page from non-admin users. Add the following to all non-admin user blueprints, for example site/blueprints/users/default.yml. Once Panel area only for admins has a better answer, this step may not be necessary anymore.

Configuration

Use key leobard.deploy-yourself, see documentation in Class src/DeployYourself.php, function config().

Calling the hook

Register the hook https://example.com/deploy-yourself-hook.php as git webhook on your git server/repository.

See configuration for a HTTP header token to secure the hook.

The hook will...

  1. run git fetch
  2. put the site in maintenance mode
  3. If the URL param ?reset=hard is added to the hook the hook will run git reset --hard
  4. run git merge (completing the git pull)
  5. optionally, post_pull_cmds
  6. undo maintenance mode ... while logging these steps.

Logging

As webhooks are hard to trace, and this plugin is self-reliant and minimal, it comes with its own PSR3 inspired mini-logging implementation. By default it will log on level 'notice' and will write commands and their results into site/logs/deploy-yourself-{ISODATETIME}.log. It will retain the last 10 logs. This is configurable.

Dry-run

There is a dryrun option which will not run commands but only log them.

Custom commands to run after pull

After the initial pull, you can run commands on the server using exec(). Configure them as array in post_pull_cmds.

Panel area to view log messages

Log files are listed in a new area "Deploy yourself" in the Kirby panel menu.

The URL path is /admin/deploy-yourself/index .

It is only visible for admin users.

Support and development

This comes AS-IS with "no support" and a "works for me, Leo Sauermann, no need to add anything" attitude.

If this also "works for you" and you want to improve it, please add issues and pull requests to the github repo. If your additions are useful extensions from the initial state, and your code looks fine in my eyes, we may want to continue together as co-maintainers.


All versions of deploy-yourself with dependencies

PHP Build Version
Package Version
Requires getkirby/composer-installer Version ^1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package leobard/deploy-yourself contains the following files

Loading the files please wait ...