dev-master
9999999-devCollection of scripts for Magento 2 builds and deployments
The Requires
- magento/magento-composer-installer *
- php ~5.5.0|~5.6.0|~7.0.0
by Tobias Schifftner
Collection of scripts for Magento 2 builds and deployments
Scripts to deploy Magento2 projects with Jenkins / CI Pipeline. This includes packaging the project and deploying it while setting all required variables for database, environment, etc., (*1)
Deploy scripts are based on the superb work of @fbrnc and AOE (https://github.com/AOEpeople/magento-deployscripts) for Magento 1, (*2)
1) Whole Magento project is packaged into an build archive (project.tar.gz), (*3)
2) Generated build archive is copied to a central storage server, (*4)
3) Deploy scripts are cloned for deployment on staging/production server, (*5)
4) deploy.sh is executed, downloads and unpacks package.tar.gz and runs install.sh, (*6)
magento2-deployscripts/deploy.sh -r /tmp/artifacts/project.tar.gz -e devbox -d -t /var/www/project/devbox/
5) install.sh sets database and environment variables, (*7)
6) Cleanup of older releases, (*8)
Define configuration in config/settings.csv regarding the zettr documentation, (*9)
Add this package to your Magento composer.json:, (*10)
"require": { "tschifftner/magento2-deployscripts": "dev-master" },
To use zettr with Magento2 you need to add it too (respository is required as long as the pull request is not merged), (*11)
"require": { "aoepeople/zettr": "@dev" }, "repositories": { "0": { "type": "vcs", "url": "https://github.com/tschifftner/zettr.git" } },
As there is a bug within Magento you currently require also, (*12)
"require": { "tschifftner/magento2-module-tschifftner-deployhelper": "dev-master" },
1) Update Magento2 project source code to latest version, (*13)
2) Run shell commands:, (*14)
bin/composer.phar update --verbose --no-ansi --no-interaction --prefer-source vendor/tschifftner/magento2-deployscripts/build.sh -f project.tar.gz -b $BUILD_NUMBER
3) Archive artefacts and/or copy to central storage like sftp or s3, (*15)
Deployment for staging or production is all the same just with different variables., (*16)
1) Clone deployment scripts to accessible location, (*17)
git clone https://github.com/tschifftner/magento2-deployscripts.git ~/deployscripts
2) Ensure scripts are executable, (*18)
chmod +x ~/deployscripts/{deploy,cleanup}.sh
3) Deploy build package, (*19)
# e = environment (staging,production,devbox,etc) # r = package url # u = user # p = password # t = project dir ~/deployscripts/deploy.sh -e staging -r http://storageserver.com/project.tar.gz -u 'user' -p 'password' -t /var/www/project/ || exit1
4) Cleanup old releases, (*20)
~/deployscripts/cleanup.sh -r ~/releases/ || exit1
GNU General Public License v3.0, (*21)
Collection of scripts for Magento 2 builds and deployments