Kirby Janitor job for staging

Overview

Simple staging Janitor jobs

Plugin for very simple staging setup for https://github.com/bnomei/kirby3-janitor/ (required). Beta quality - use at your own risk. It's working without problems for me but any comments and suggestions for improvements are welcome. There are two variants pure php and rsync.

Requirements

Plugin assumes flat structure and while you can define the destination (live site) as you want i would suggest structure like

websites/
	staging.mysite.com
	mysite.com

PHP job vs Rsync job

Both jobs are different. The PHP job should be more compatible but it naive, takes longer, it alwyas copies everything and it requires you to have space for 3 versions of your site. It works like this

  1. Copy staging.mysite.com to __staging_mysite.com
  2. Rename mysite.com to __tobedeleted_mysite.com
  3. Rename __staging_mysite.com to mysite.com
  4. Delete __tobedeleted_mysite.com

Rsync job requires you to have rsync available on your server but it syncs changes from staging to live directly. This makes it much more efficient and you have only 2 versions of site at the time. Rsync also has better include/exclude options. Many shared hostings with ssh have rsync available but check if you allow php to run exec();.

You probably want to use Rsync job if you can.

Install

composer require floriankarsten/simple-staging

config.php

// Required loads the jobs
'bnomei.janitor.jobs-extends' => [
	'floriankarsten.simplestaging.jobs'
],
// this is required name of final destination of website
// for example if i have site folders staging.test.com and test.com i set test.com as destination
'floriankarsten.simplestaging' => [
	'destination' => 'test.com',
	'base' => '/users/floriankarsten/bestwebsite/' // Not required. Absolute path to base of our website. By default its parent of index/public folder which is what you probably want.
]

In your blueprint

// PHP job
pushlive:
  type: janitor
  label: Deploy to Live site rsync
  progress: Deploying...
  job: deploylive

// Rsync job
pushlive:
  type: janitor
  label: Deploy to Live site rsync
  progress: Deploying...
  job: deployliversync

Configuration PHP job

'floriankarsten.simplestaging' => [
	'basic' => [ // 'basic' is namespace for our 'php job'
		'excludedir' => ['vendor', 'node_modules'] // basic job can only exclude directories. Empty by default.
	],
]

Configuration Rsync job

'floriankarsten.simplestaging' => [
	'rsync' => [
		'executable' => '/usr/lib/rsync' // path to rsync library. Default 'rsync'
		'flags' => ['a', 'r'] // overwrite default rsync flags. Default ['a', 'r']
		// include/exclude work as if they were passed directly to rsync (so things like *.jpg etc.). If you use only include without exclude we assume and exclude '*'
		'exclude' => ['vendor', 'node_modules'], // Empty by default.
		'include' => ['content'], // Empty by default.
	],
]

This plugin wouldn't happen without @garethworld who kindly hired me to make it and then wanted to have it released to Kirby community. Thanks GARETH

You might also like...
Kirby wrapper for automated content accessibility checkers Editoria11y and Sa11y

Kirby3 A11yprompter For a comprehensive overview of Sa11y and Editoria11y, how they can assist maintaining an accessible website by supporting content

Plugin for Kirby that allows you to load assets generated by Vite.

Kirby Vite Plugin Plugin for Kirby that allows you to load assets generated by Vite. In development mode, assets are loaded from Vite's development se

🦭 Kirby, but headless only – KQL with bearer token, Express-esque middlewares & more

Kirby Headless Starter ℹ️ Send a Bearer test authorization header with a request to the live playground to test this headless starter. This starter ki

Kirby plugin to visually show hidden characters in all kind of input fields and their previews.
Kirby plugin to visually show hidden characters in all kind of input fields and their previews.

Kirby Hidden Characters Kirby plugin to visually show hidden characters in all kind of input fields and their previews. This includes white spaces and

Kirby 3 Plugin for running jobs like cleaning the cache from within the Panel, PHP code, CLI or a cronjob

Kirby 3 Janitor Kirby 3 Plugin for running jobs. It is a Panel Button! It has jobs build-in for cleaning the cache, sessions, create zip-backup, pre-g

A simple wrapper around vlucas' PHP dotenv library for Kirby CMS.

kirby-phpdotenv A simple wrapper around vlucas' PHP dotenv library for Kirby CMS. Why? I've been using .env in my Kirby projects for a while, but I go

A simple job posting application using PHP with an Admin Panel. Register, Login and create the job in apnel. The job gets posted on index page.

Jobee A simple job posting application using PHP with an Admin Panel. Register, Login and create the job in apnel. The job gets posted on index page.

Job Portal - Find your dream job here Various career opportunities await you
Job Portal - Find your dream job here Various career opportunities await you

Find your dream job here Various career opportunities await you. Find the right career and connect with companies anytime, anywhere 🎯 free access to search for jobs, post resumes, and research companies. 🎊

Perch Dashboard app for exporting content to (Kirby) text files and Kirby Blueprint files
Perch Dashboard app for exporting content to (Kirby) text files and Kirby Blueprint files

toKirby Perch Dashboard app for exporting content to (Kirby) text files and Kirby Blueprint files. You can easily install and test it in a few steps.

This Kirby V3 Plugin brings snippets and blueprints together in one place. It includes useful tools that completely changing the way you work with Kirby: Fast and well organized.
This Kirby V3 Plugin brings snippets and blueprints together in one place. It includes useful tools that completely changing the way you work with Kirby: Fast and well organized.

Kirby Components Overview Do you love to make awesome projects with Kirby CMS? Do you also find it difficult to switch between snippets and blueprints

PHP cron job scheduler

PHP Cron Scheduler This is a framework agnostic cron jobs scheduler that can be easily integrated with your project or run as a standalone command sch

Message Queue, Job Queue, Broadcasting, WebSockets packages for PHP, Symfony, Laravel, Magento. DEVELOPMENT REPOSITORY - provided by Forma-Pro
Message Queue, Job Queue, Broadcasting, WebSockets packages for PHP, Symfony, Laravel, Magento. DEVELOPMENT REPOSITORY - provided by Forma-Pro

Supporting Enqueue Enqueue is an MIT-licensed open source project with its ongoing development made possible entirely by the support of community and

Get notified when a queued job fails
Get notified when a queued job fails

Get notified when a queued job fails This package sends notifications if a queued job fails. Out of the box it can send a notification via mail and/or

Bug bounty tools built in PHP to help penetration tester doing the job

BugBountyTools-PHP Bug bounty tools built in PHP to help penetration tester doing the job Website who using this script: KitaBantu Soon! 403 Bypasser

Chain Laravel jobs without having to glue it to a starting job

Laravel Job Chainer JobChainer does chain a variable amount of jobs by adding them with the add() method. This makes it possible to chain jobs without

Task Scheduling with Cron Job in Laravel

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Your personal job-search assistant

JobsToMail Your personal job-search assistant About JobsToMail is an open source web application that allows users to sign up to receive emails with j

A better way to create complex batch job queues in Laravel.

Relay A better way to create complex batch job queues in Laravel. Installation composer require agatanga/relay Usage Example Let's say you have the fo

Homework assignment for an job opening for PHP developer

favorite_countries Homework assignment for an job opening for PHP developer Description: This app lets registered users to be able to save favourite c

Releases(0.1)
Owner
Florian Karsten
Graphic Design, UX and Development
Florian Karsten
This Kirby V3 Plugin brings snippets and blueprints together in one place. It includes useful tools that completely changing the way you work with Kirby: Fast and well organized.

Kirby Components Overview Do you love to make awesome projects with Kirby CMS? Do you also find it difficult to switch between snippets and blueprints

Roman Gsponer 6 May 31, 2023
Bug bounty tools built in PHP to help penetration tester doing the job

BugBountyTools-PHP Bug bounty tools built in PHP to help penetration tester doing the job Website who using this script: KitaBantu Soon! 403 Bypasser

Muhammad Daffa 7 Aug 17, 2022
A library of powerful code snippets to help you get the job done with Gravity Forms and Gravity Perks.

Gravity Wiz Snippet Library Gravity Wiz is creating the most comprehensive library of snippets for Gravity Forms ever. We'll be consistently moving ou

Gravity Wiz 151 Dec 27, 2022
Iran decoration platform is an open source Php web application where you can find your job as a freelancer working in people home in decoration positions and others.

Iran-Decoration Platform Iran decoration platform is an open source Php web application where you can find your job as a freelancer working in people

AmirHossein Mohammadi 8 Dec 14, 2022
PHP library for Disque, an in-memory, distributed job queue

disque-php A PHP library for the very promising disque distributed job queue. Features: Support for both PHP (5.5+) and HHVM No dependencies: Fast con

Mariano Iglesias 132 Oct 19, 2022
This plugin allows you to create many-to-many relationships between pages in Kirby and synchronizes them on both sides.

Kirby 3 Many To Many Field This plugin allows you to create many-to-many relationships between pages in Kirby.

Jonas Holfeld 41 Nov 19, 2022
Color-managed thumbnails for Kirby 3

ImageKit for Kirby 3 This is not directly related for ImageKit for Kirby 2, but based on the same idea of improving Kirby’s built-in image processing

Fabian Michael 13 Nov 21, 2022
Helper to automatically load various Kirby extensions in a plugin

Autoloader for Kirby Helper to automatically load various Kirby extensions in a plugin Commerical Usage This package is free but if you use it in a co

Bruno Meilick 13 Nov 9, 2022
Add information about PGP public keys on upload in Kirby v3

Kirby3 GnuPG This plugin adds information about PGP public keys on upload, using gpg binary (which needs to be installed for this to work). Getting st

Fundevogel 2 Oct 11, 2021
A Frankenstein's monster: Kirby inside of Laravel.

A Kirby-Laravel Starter Kit This is an experimental starter kit for using Kirby within Laravel (a little like Statamic). In my limited experience it r

Brandon Turner 4 Mar 19, 2022