Skip to content

Instantly share code, notes, and snippets.

@diazwatson
Created August 15, 2019 23:41
Show Gist options
  • Save diazwatson/b32e0cee5fdffb9dd6617be5d6b2d725 to your computer and use it in GitHub Desktop.
Save diazwatson/b32e0cee5fdffb9dd6617be5d6b2d725 to your computer and use it in GitHub Desktop.
#!/bin/bash
PROJECTS_DIR=Sites
[email protected]:magento/magento2.git
[email protected]:diazwatson/magento2.git
[email protected]:magento/adobe-stock-integration.git
[email protected]:diazwatson/adobe-stock-integration.git
ADMIN_USER=jondoe
ADMIN_PASS=magento123
# Uninstall
cd $HOME/$PROJECTS_DIR/adobestock
bin/magento setup:uninstall
# Delete Folder
cd $HOME/$PROJECTS_DIR/
rm -rf $HOME/$PROJECTS_DIR/adobestock
# Rebuild
mkdir -p $HOME/$PROJECTS_DIR/adobestock
cd $HOME/$PROJECTS_DIR/adobestock
git clone $MAGENTO2_FORK .
git remote add upstream $MAGENTO2_REPO
git fetch upstream
mkdir ext
git clone $ADOBESTOCK_FORK ext/magento/stock-integration
cd ext/magento/stock-integration
git remote add upstream $ADOBESTOCK_REPO
git fetch upstream
git remote add konarshankar07 [email protected]:konarshankar07/adobe-stock-integration.git
git fetch konarshankar07
git remote add engcom-Golf [email protected]:engcom-Golf/adobe-stock-integration.git
git fetch engcom-Golf
cd $HOME/$PROJECTS_DIR/adobestock
composer config minimum-stability dev
composer config repositories.ext path "./ext/*/*/*"
composer require magento/adobe-stock-integration
echo ext >> ./.git/info/exclude
echo "vendor/magento/module-adobe-stock-*" > dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt
git update-index --skip-worktree composer.json
git update-index --skip-worktree composer.lock
git update-index --skip-worktree dev/tests/static/phpunit.xml.dist
# Static
git update-index --skip-worktree dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt
LC_ALL=C sed -i '' 's/name="TESTCODESTYLE_IS_FULL_SCAN" value="0"/name="TESTCODESTYLE_IS_FULL_SCAN" value="1"/g' dev/tests/static/phpunit.xml.dist
# Install Magento
composer install
bin/magento setup:install --admin-firstname=Raul --admin-lastname=Diaz [email protected] --admin-user=$ADMIN_USER --admin-password=$ADMIN_PASS --base-url=http://adobestock.test/ --base-url-secure=https://adobestock.test/ --backend-frontname=admin --db-host=localhost --db-name=adobestock --db-user=root --db-password=root --language=en_GB --currency=GBP --timezone=Europe/London --use-rewrites=1 --use-secure=1 --use-secure-admin=1 --admin-use-security-key=1
# AdobeStock Config
bin/magento config:set adobe_stock/integration/enabled 1
bin/magento config:set adobe_stock/integration/api_key 0:3:7udDIpEIxcnNbSnx7cdW46MFRqzCURWKj1RL6+W9UODMh1IGtZx4Hcm0Uhkxwv3OYwNUeTEYTJrAG2aH
bin/magento config:set adobe_stock/integration/private_key 0:3:e9tq2t3AEMrzzUAKrmv1RhP5a4SwSMTg6DkN4dzVpCCbtrlFvK/a0QUI6fd+UmEBLrfR2QN0dgS0i1jLpjF55g==
mkdir -p $HOME/$PROJECTS_DIR/adobestock/ext/magento/stock-integration/bin
echo bin >> ext/magento/stock-integration/.git/info/exclude
ln -s $HOME/$PROJECTS_DIR/adobestock/bin/magento $HOME/$PROJECTS_DIR//adobestock/ext/magento/stock-integration/bin/magento
# Install MFTF
cd $HOME/$PROJECTS_DIR/adobestock/dev/tests/functional/
composer install
cd $HOME/$PROJECTS_DIR/adobestock
vendor/bin/mftf build:project
LC_ALL=C sed -i '' 's/http://devdocs.magento.com/http://adobestock.test/g' dev/tests/acceptance/.env
cd $HOME/$PROJECTS_DIR/adobestock
bin/magento admin:user:create --admin-user=admin --admin-password=123123q --admin-firstname=admin --admin-lastname=admin [email protected]
bin/magento config:set admin/security/admin_account_sharing 1
bin/magento config:set admin/security/use_form_key 0
ln -s $HOME/$PROJECTS_DIR/adobestock/vendor/bin/mftf $HOME/$PROJECTS_DIR/adobestock/ext/magento/stock-integration/bin/mftf
mkdir .idea
vendor/bin/mftf generate:urn-catalog --force .idea
bin/magento c:c
bin/magento indexer:reindex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment