miiimooo / dropcat
delivery tool for web sites
Installs: 33
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:drupal-deploy-tool
Requires
- php: ^7.3
- ext-phar: *
- composer/xdebug-handler: ^1.3
- guzzlehttp/guzzle: ^6.3
- ocramius/proxy-manager: 2.0.4
- padraic/phar-updater: ^1.0
- pear/archive_tar: ^1.4
- phpseclib/phpseclib: ^2.0
- symfony/config: ^3
- symfony/console: ^3
- symfony/dependency-injection: ^3
- symfony/event-dispatcher: ^3
- symfony/filesystem: ^3.4
- symfony/process: ^3
- symfony/proxy-manager-bridge: ^3
- symfony/swiftmailer-bundle: 2.6.7
- symfony/yaml: ^3
- t4web/composer-lock-parser: 1.0.3
- wkse/jenkins-php-api: ^0.1.13
Requires (Dev)
- kherge/box: ~2.0
- phpunit/phpunit: ^5.2
- dev-master
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.0.1
- 1.0.0
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-miiimooo-patch-1
- dev-no_cr_before_updb
- dev-drush-10
- dev-nuke-xdebug
- dev-generate-correct-memory-value
- dev-fix_memory_limit
- dev-memory_limit_etc
- dev-check-display-port
- dev-varnish_url_param_fix
- dev-dns
- dev-mixed_content_warning
- dev-simple
- dev-30-initdrupal-does-not-move-the-gitignore-from-web_init-to-current-dir
- dev-multi
- dev-rollbacks
- dev-WOPS-108
- dev-config-path-priority
- dev-site_factory
- dev-add-init-wp
- dev-move_command_keeptar
- dev-swith_boolean
- dev-move_backups_from_drush
- dev-dropcat-test-update
- dev-unified
- dev-WOPS-104
- dev-issue-28
- dev-WOPS-106
- dev-npm_install_dir_option
- dev-WOPS-73
- dev-WOPS-78
- dev-newrelic
- dev-WOPS-75
- dev-9-refactor-the-commands-as-lazy-loading-services
- dev-uploadscp
- dev-innovation-day
- dev-issue-14
- dev-issue-24
- dev-issue-17
- dev-sitefactory
This package is auto-updated.
Last update: 2024-11-24 22:54:28 UTC
README
Forked from https://gitlab.wklive.net/wk-public/dropcat
Please read our blog-series about dropcat
Install with composer
composer require miiimooo/dropcat:dev-master
After that you may run dropcat as: vendor/bin/dropcat
Install globally (Mac/Linux)
For this forked version of dropcat
| curl -L0 https://github.com/miiimooo/dropcat/releases/download/2.0.3/dropcat.phar -o /usr/local/bin/dropcat
| chmod +x /usr/local/bin/dropcat
| dropcat about
What does it do and why would anybody need it?
Historically we at Wunderkraut Sweden (formerly NodeOne) have used a combination of Jenkins and Aegir to deploy our sites. When we started development of Drupal 8 sites, Aegir was not ready, and we also wanted a simpler deploy workflow, more fitting to our everyday needs. So we started to test out some tools out there that almost worked for us, but we realized that it should take us longer to adapt a tool that almost fits, than to develop our own.
Symfony
We decided to develop the tool using symfony components, because Drupal uses some of them already, and it is therefore a good fit.
Dont't reproduce, re-use
The aim is not to replace an existing tool that do things perfect (or almost), the aim is to be the glue between the other tools. So in our deploy flow we use composer (instead of drush make that we have used for all drupal 7 sites in Wunderkraut Sweden), dropcat and drush, with jenkins (but we could also run our deploys locally, using whatever tools you wish to run commands, like your own terminal).
Wrapping drush, why?
Some of the commands are just wrappers around drush, like dropcat backup
and
dropcat site-install
. We have dropcat as an wrapper because we could use
variables from yaml-files in a consistent way. Some parts could be changed to be
wrappers for drupal console instead in the future, or changed to use our own
defined functions instead - the idea is to keep dropcat consistent, but
changing what it is built on the way as needed.
Commands
We have now a bunch of commands to use with dropcat, and we are adding more in the near future.
- backup: backups db to path.
- prepare: creates drush-alias for site and db on host.
- tar: archives a folder for later upload
- upload: uploads a tar-folder to destination
- move: unpacks a tar-folder and put it in place
- symlink: creates a symlink to target folder - use-case could be for example files-folder
- site-install: install a site
- configimport: imports configuration (wrapper for drush config-import)
- init: uses our template to create a drupal 8 site with a profile
- about: what is a terminal app without an about?
- jenkins-build: Build a jenkins job
First Drupal 8, then 7
The first target for this tool is to deploy drupal 8 sites, on the list is also to deploy drupal 7 sites, and maybe also other types of sites after that. "It is all just a bunch of files in different languages", as a famous bulgarian web developer said once!
Run it
dropcat backup
This uses the default settings in dropcat.yml. If the system variable DROPCAT_ENV
is set to dev, dropcat uses dropcat.dev.yml, if that exists.
The config yaml-file must exits in the folder that dropcat is
run from.
Different commands for different tasks
To get a list of all tasks that may be used use:
dropcat list
To get help on a command, and explanation of commands use:
dropcat help backup
Run Dropcat from jenkins
We are using dropcat from jenkins, in a executed shell. In this example dropcat is installed as required in composer.json (and placed in vednor/bin by default) for the drupal site (also a drush alias is setup for the site:
export DROPCAT_ENV=stage
export ENV=stage
export BUILD_DATE="$(date +"%Y%m%d")"
# got to application dir, that is our web folder
cd application
composer install
# only need to be runned once (creates drush alias on deploy server and database
# on dbhost
dropcat prepare
dropcat tar --folder=${WORKSPACE}/application --temp-path=${WORKSPACE}/ -v
dropcat upload --tar_dir=${WORKSPACE}/
dropcat symlink
dropcat site-install
dropcat update
All config for the deploy is in dropcat.stage.yml in application folder.
Config examples
Dropcat need as a minimum a dropcat.yml in the running directory. Example is found in examples folder. Also examples for dev and prod environmengt is in the folder.
PHPunit-testing example
./phpunit This file points to the composer installed phpunit and runs that with the settings from phpunit.xml. This will run all tests found in the Tests folder. This also runs code coverage so you can see how much of your code that has been tested.
Disclaimer
We don't give any gurantee that this tool will work for you, your site could be nuked from orbit by it, and we don't have any support for it, but if you have problems using it, please create an issue.
Packaging
To create a phar release:
vendor/bin/box build