Skip to content

Instantly share code, notes, and snippets.

@cmuench
Last active February 4, 2021 11:20
Show Gist options
  • Save cmuench/db83d540b3a35648c58f4ef058a5b332 to your computer and use it in GitHub Desktop.
Save cmuench/db83d540b3a35648c58f4ef058a5b332 to your computer and use it in GitHub Desktop.
n98-magerun2.phar in Magento Cloud
hooks:
# We run build hooks before your application has been packaged.
build: |
set -e \
&& echo "[!] Running composer install ..." \
&& composer -n --no-dev install \
&& curl -O https://files.magerun.net/n98-magerun2.phar \
&& mv n98-magerun2.phar bin/n98-magerun2 \
&& chmod +x bin/n98-magerun2 \
&& echo "alias mr2='~/bin/n98-magerun2'" >> ~/.bash_profile \
&& echo "alias ll='ls -la'" >> ~/.bash_profile \
&& echo "[!] Running Magento build script './vendor/bin/m2-ece-build' ..." \
&& php ./vendor/bin/ece-tools build:generate \
&& echo "Install nodejs modules" \
&& npm install \
&& grunt autoprefixer \
&& php ./vendor/bin/ece-tools build:transfer
# We run deploy hook after your application has been deployed and started.
deploy: |
set -e \
&& echo "[!] Running Magento deploy script './vendor/bin/m2-ece-deploy' ..." \
&& php ./vendor/bin/ece-tools deploy \
&& php bin/magento cache:clean
# We run post deploy hook to clean and warm the cache. Available with ECE-Tools 2002.0.10.
post_deploy: |
php ./vendor/bin/ece-tools post-deploy
@cmuench
Copy link
Author

cmuench commented Aug 22, 2020

Example of adding n98-magerun2.phar during build process of a Magento Cloud deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment