Created
October 27, 2019 11:09
-
-
Save diazwatson/4fa5b06672987f315fb2f76e2ef77fbe to your computer and use it in GitHub Desktop.
A bash script to setup adobe stock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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=USERNAME | |
ADMIN_PASS=PASSWORD | |
# 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/MAGENTO_BASE_URL=http:\/\/devdocs.magento.com/MAGENTO_BASE_URL=http:\/\/adobestock.test/g' $HOME/$PROJECTS_DIR/adobestock/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 | |
cd $HOME/$PROJECTS_DIR/adobestock/ext/magento/stock-integration |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment