{"id":13752259,"url":"https://github.com/mwr/magedeploy2-base","last_synced_at":"2025-04-15T12:19:41.292Z","repository":{"id":57022452,"uuid":"80340073","full_name":"mwr/magedeploy2-base","owner":"mwr","description":"Magento2 Deployment with Deployer (Skeleton)","archived":false,"fork":false,"pushed_at":"2017-11-20T07:32:39.000Z","size":33,"stargazers_count":43,"open_issues_count":8,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-15T12:19:11.124Z","etag":null,"topics":["composer","deployment","magedeploy2","magento2","magento2-deployment","php","robo"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mwr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-29T10:27:10.000Z","updated_at":"2023-05-08T13:44:59.000Z","dependencies_parsed_at":"2022-08-23T13:51:03.619Z","dependency_job_id":null,"html_url":"https://github.com/mwr/magedeploy2-base","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwr%2Fmagedeploy2-base","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwr%2Fmagedeploy2-base/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwr%2Fmagedeploy2-base/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwr%2Fmagedeploy2-base/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mwr","download_url":"https://codeload.github.com/mwr/magedeploy2-base/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249067788,"owners_count":21207397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","deployment","magedeploy2","magento2","magento2-deployment","php","robo"],"created_at":"2024-08-03T09:01:02.573Z","updated_at":"2025-04-15T12:19:41.271Z","avatar_url":"https://github.com/mwr.png","language":"PHP","funding_links":[],"categories":["Open Source Extensions"],"sub_categories":["Deployment"],"readme":"# MageDeploy2 Base\n\nMagento2 Deployment Setup using Robo and Deployer. \nThis is the base project you should base your deployments on.\nIt provides an configurable and customizable setup to create push deployments for Magento2.\n\n## Getting Started\n\n### Requirements\n\n * deployer/deployer\n * consolidation/robo\n * mwltr/magedeploy2\n * netz98/n98-deployer\n\n### Prerequisites\n\nMageDeploy2 requires deployer and robo to be available on your system.\n\nThose Tools can be used globaly or added as a requirement to your local composer.json.\n\nThe path to those tools can be configured in the magedeploy2.php\n\nFurthermore `gtar` ( gnu-tar) is required, it can be installed via brew\n\n```\nbrew install gnu-tar\n```\n\n### Installation\n\nCreate a new deployment setup\n\n```\ncomposer create-project mwltr/magedeploy2-base \u003cdir\u003e\n```\n\nRobo needs to be installed using composer, otherwise the usage of custom Tasks is not available.\nSee the Robo Documentation [Including Additional Tasks](http://robo.li/extending/#including-additional-tasks)\n\n### Configure Deployment\n\nThis tool assumes you have a git repository containing the magento composer.json. \nFurthermore your local build environment can clone said repository and download the Magento packages using composer.  \n\n#### MageDeploy2 Configuration\n\nTo configure the MageDeploy2 use the following command:\n```\n./vendor/bin/robo config:init\n```\n\nIt will guide you throught the most important configuration options. \nDon't worry you can edit the magedeploy2.php lateron.\n\nNext, run \n```\n./vendor/bin/robo validate\n```\nto validate your build environment is setup.\n\n#### Setup local build environment\n\nIf you are done with the configuration in ``magedeploy2.php``, you can see if your build environment can be setup.\nTo do so run this command:\n```\n./vendor/bin/robo deploy:magento-setup develop\n```\nYou can use a different branch depending on your git repository setup.\n\nAfter the magento-setup has run successfully, you can now generate the assets by running the command:\n```\n./vendor/bin/robo deploy:artifacts-generate\n```\n\nAfter this command is complete you should see the packages beneath ``shop``.\n\nAt this point we are sure that the local build setup is working and we can now continue with releasing our project.\n\n#### Deployer Configuration\n\nAfter the Installation and general configuration of magedeploy2, you have to edit the `deploy.php` file to suit your needs.\nTo evaluate we will create a local deployment target.\nTo do so create run \n```\ncp config/local.php.dist config/local.php\n```\nand set the config values according to your local deploy target.\n\nCheck the configuration in ``deploy.php`` and adjust it to your requirements.\nThe default configurations and tasks are defined in ``\\N98\\Deployer\\Recipe\\Magento2Recipe``.\nYou can also have a look at all the configurations available \nin the [Deployer Documentation](https://deployer.org/docs/configuration)\n\n#### Setting up deploy directory tree\n\nAfter you are done with setting the configuration, you can now initialize the directory tree of the deploy target run \n```\n./vendor/bin/dep deploy:prepare local\n```\nThis will create the required directories on your local deploy target.\n\n#### Setting up deploy target (optional)\nIf you want to set up your deploy target as well you can use the command\n```\n./vendor/bin/dep server:setup local\n```\nIt will make an initial deployment to push your code to the deploy target.\n\nWhen this is done navigate to your local ``deploy_path`` and run the magento install command to setup the database.\nThis might look something like this:\n```\ncd \u003cdeploy_path\u003e\nphp bin/magento setup:install --db-host=127.0.0.1 --db-name=magedeploy2_dev_test_1_server --db-user=root --admin-email=admin@mwltr.de \n--admin-firstname=Admin --admin-lastname=Admin --admin-password=admin123 --admin-user=admin \n--backend-frontname=admin --base-url=http://magedeploy2_dev --base-url-secure=https://magedeploy2_dev \n--currency=EUR --language=en_US --session-save=files --timezone=Europe/Berlin --use-rewrites=1\n```\n\nNow we have Magento database and configuration on our deploy target and are ready to continue with the final step.\n\n#### Deploying the project\n\nAt this point, you have setup the build environment and target environment and can finally start with the actual deployment.\nYou can do so by running:\n```\n./vendor/bin/dep deploy local\n```\n\nCongrats you have successfully setup your deployment pipeline and run the first deployment!\n\n## CONFIGURATION FILES\n\n### magedeploy2.php\n\nThis is the config file to set all parameters required for the deployment in general.\n\nThe most common settings are to adjust on a project basis:\n\n - deploy/git_url (path to your git repository)\n - deploy/themes (the themes that are to be generated)\n - build/db (the database settings for the build environment)\n\nA complete list of configuration options is provided further down.\n\n#### env\n\n| Key          | Description                 | Default                      |                        \n| ------------ | --------------------------- | ---------------------------- |\n| git_bin      | Path to git executable      | /usr/local/bin/git           |\n| php_bin      | Path to php executable      | /usr/local/bin/php           |\n| tar_bin      | Path to tar executable      | /usr/local/bin/gtar          |\n| composer_bin | Path to composer executable | /usr/local/bin/composer.phar |\n| deployer_bin | Path to deployer executable | /usr/local/bin/deployer.phar |\n\n#### deploy\n\n| Key           | Description                                                   | Default   |                        \n| ------------- | ------------------------------------------------------------- | --------- |\n| git_url       | Git-Url to your repository                                    |           |\n| git_dir       | Sub-directory on build server to clone the repository to      | shop      |\n| app_dir       | If you have your magento composer.json in another sub-dir     |           |\n| themes        | An array of themes to compile                                 |           |\n| assets        | List of assets to generate                                    |           |\n| clean_dirs    | list of dirs to clean on each deployment                      |           |\n\n#### build/db\n\nContains the database configuration being used to create and update a local magento setup during deployment.\n\n### deploy.php\n\nThis file is for the actual deployment of your project to the server.\nIt has a basic setup that should work on most of the environments.\nYou can adjust this to your needs as well.\nLeave out unwanted steps, add new ones, exchange existing ones, etc.\n\nThe `deploy.php` uses the `N98\\Deploy\\Recipe\\Magento2Recipe` as base recipe and overwrites some of the default settings.\n\nThe server configuration is defined using the `config/*.php` files.\n\n## CUSTOM PROJECT CHANGES\n\n### General\n\nReplace all __ADD_XXX__ to suit your demands.\n\nFiles to customize and check:\n\n### .ssh/config\n\nThis deployment uses a native ssh client with a ssh-config file per default.\nIt needs to be defined in `.ssh/config` and needs to match with your server configs beneath `config`.\n\n**CAUTION**\n\nThe Hostname in the `.ssh/config` has to be an IP otherwise an error during the deployment will occur. \n\n### .ssh/known_hosts\nA list of known hosts can also be added within this directory: `.ssh/known_hosts`\nKeys can be added here, e.g.\n\n* 127.128.129.130 ssh-rsa {long_public_key}\n* 127.128.129.131 ssh-rsa {long_public_key2}\n\n### config/*\n\nTake a look at `config/production.php` and config/staging.php` and change it accordingly.\n\n### Jenkinsfile\n\nThe Jenkinsfile defines the Jenkins Pipeline. It has to be adjusted to the project needs.\n\n### deploy.php\n\n`deploy.php` is the main entry point that can be used to customize.\n\n\n### Getting Started\n\nInstall dependencies with `composer install`\n\nstart deployment with `./dep deploy staging`\n\n## COMMANDS\n\n### config:init\n\nGenerate a new magedeploy2.php. Be aware: this will overwrite your existing configuration\n\n### validate\n\nValidates that \n- the bin config values are execuatble,\n- the git repository is reachable\n\n### deploy\n\nTriggers the deployment with all it's stages\n\n### deploy:magento-setup\n\nRuns all tasks in the stage magento-setup. \nIt will setup or update a local Magento instance by pulling the source-code from git, \ninstalling composer dependencies and installing or updating a local database.\n\n### deploy:artifacts-generate\n\nRuns the Magento ``di:compile`` and ``setup:static-content-deploy``commands to generate the assets.\nIt is using your configurartion from the ``magedeploy2.php``.\n\nAfter generating those assets it will create packages, again according to your configuration.\n\n### deploy:deploy\n\nThis command will invoke deployer to release your project and push the prepared artifacts to the server.\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. \nFor the versions available, see the [tags on this repository](https://github.com/mwr/magedeploy2-skeleton/tags). \n\n## Authors\n\n* **Matthias Walter** - *Initial work* - [mwr](https://github.com/mwr)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwr%2Fmagedeploy2-base","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmwr%2Fmagedeploy2-base","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwr%2Fmagedeploy2-base/lists"}