diff --git a/README.md b/README.md index 599869b..04973dc 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,16 @@ -# Deployer recipe for OXID 6.5.x + 7.x +# Deployer recipe for OXID 7.x -This project uses [Deployer](https://deployer.org/) for scripted installation +This project uses [Deployer](https://deployer.org/) for scripted installation. -## Preparation +The recipe can usually also be used for projects based on OXID 6.4 and 6.5. -To setup the customer repository, see [provisioning](provisioning.md). +## Usage -### Server setup +See Deployer OXID recipe project for further instructions. -Install Composer. - -Clone the repository into a separate directory (`deployer` for example) on your server and checkout this branch. - -Run `composer install` in it. - -Add an alias for the deployer command: `alias dep='/usr/local/php8.2/bin/php /home/XXX/deployer/vendor/bin/dep'`. Load the changed configuration. - -Change project settings in the `inventory.yml`. -Create a deploy key (if it's not exist). Set it in the repository settings. -Commit changed files. - -### Update Deployer - -- `cd deployer` -- `composer update` -- commit changes - -## Project - -### Deployment - -- `cd deployer` -- `dep deploy [stage]` - -### Rollback - -... in case of errors after successful deployment - -This command set `current` directory to previous deployment: - -- `dep rollback [stage]` - -## Other available tasks +## available tasks - dep `shop:getVersion` [stage] - show version of current OXID installation - dep `shop:cloneDatabase` [stage] - dump contents from source to destination database - dep `shop:runMigration` [stage] - run all database migrations -- dep `setup:createDbConfig` [stage] - generate database configuration file -- dep `list` - list all available commands -- dep `releases` - lists all releases of the selected host -- dep `run` - run any command in the current release of the selected host (e.g. `dep run 'echo {{bin/composer}}'` for full Composer command) \ No newline at end of file +- dep `setup:createDbConfig` [stage] - generate database configuration file \ No newline at end of file diff --git a/composer.json b/composer.json index 9893d3e..99b79cc 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,23 @@ { - "require-dev": { - "deployer/deployer": "^7.4" + "name": "d3/oxid-deployer", + "description": "Deployer recipe for OXID eShop", + "type": "library", + "license": "MIT", + "homepage": "https://d3data.de/", + "authors": [ + { + "name": "D3 Data Development (Inh. Thomas Dartsch)", + "email": "info@shopmodule.com", + "homepage": "https://www.d3data.de", + "role": "Owner" } + ], + "require": { + "deployer/deployer": "^7.4" + }, + "autoload": { + "psr-4": { + "D3\\OxidDeployer\\": "." + } + } } diff --git a/inventory.yml b/inventory.yml deleted file mode 100644 index 436c40d..0000000 --- a/inventory.yml +++ /dev/null @@ -1,44 +0,0 @@ -config: - application: my.shop.com - keep_releases: 5 - repository: gitfhfac@git.d3data.de:Customers/my.shop.com.git - bin/php: /usr/local/php8.2/bin/php - bin/mysql: /usr/local/mysql/bin/mysql - bin/mysqldump: /usr/local/mysql/bin/mysqldump - # bin/composer: /usr/local/php8.1/bin/php /home/phfhcwoc/bin/composer.phar # optional for custom composer version - -.base: &base - local: true - deploy_path: /home/XXX/{{application}}_{{alias}} - db_conf_path: /home/XXX/dbConf/.{{application}}_{{alias}}.cnf # optional for database actions - shared_files: - - .htaccess - - .htpasswd - - .env # otherwise source/config.inc.php - shared_dirs: - - source/sitemaps - - source/export - - source/log - - source/import - - source/out/downloads - - source/out/media - - source/out/pictures - copy_dirs: - - var - -hosts: - production: - <<: *base - branch: rel_7.0.x - db_name: myProdDatabase # optional for database actions - labels: - role: production # production | stage | development - - development: - <<: *base - branch: dev_7.1.x - db_name: myDevDatabase # optional for database actions - keep_releases: 1 - composer_options: --verbose --prefer-dist --no-progress --no-interaction # without no-dev option - labels: - role: development diff --git a/provisioning.md b/provisioning.md deleted file mode 100644 index a3fd002..0000000 --- a/provisioning.md +++ /dev/null @@ -1,19 +0,0 @@ -# Provisioning - -## initial -- checkout the customer repository -- `git remote add deployment gitfhfac@git.d3data.de:D3Private/deployerRecipes.git && git remote set-url --push deployment DONTPUSH` -- `git fetch deployment` -- `git switch -c deployment deployment/rel_OXID_7.x` - checkout remote branch and rename it to `deployment` -- `git push origin deployment` -- `git remote rm deployment` - -## update -- checkout the customer repository -- `git checkout deployment && git pull origin deployment` -- `git remote add deployment gitfhfac@git.d3data.de:D3Private/deployerRecipes.git && git remote set-url --push deployment DONTPUSH` -- `git fetch deployment` -- `git merge deployment/rel_OXID_7.x` -- `git push origin deployment` -- `git remote rm deployment` \ No newline at end of file diff --git a/recipe/deployTasks.php b/recipe/deployTasks.php new file mode 100644 index 0000000..3278c92 --- /dev/null +++ b/recipe/deployTasks.php @@ -0,0 +1,8 @@ + {{db_conf_path}}'); + info('config successful created'); + } else { + throw new \RuntimeException('can not create {{db_conf_path}}, task stopped'); + } + } catch(\RuntimeException $e) { + warning($e->getMessage()); + } +}); \ No newline at end of file diff --git a/deploy.php b/recipe/shopTasks.php similarity index 69% rename from deploy.php rename to recipe/shopTasks.php index 7d75b37..f13c0d0 100644 --- a/deploy.php +++ b/recipe/shopTasks.php @@ -1,24 +1,7 @@ {{db_conf_path}}'); - info('config successful created'); - } else { - throw new \RuntimeException('can not create {{db_conf_path}}, task stopped'); - } - } catch(\RuntimeException $e) { - warning($e->getMessage()); - } -}); - desc('show version of current OXID installation'); task('shop:getVersion', function () { if (test("[ -f {{current_path}}/composer.lock ]")) {