1
0
mirror of synced 2024-11-29 08:26:09 +03:00
magento-module/bin/install.sh

71 lines
1.7 KiB
Bash
Raw Normal View History

2018-05-04 16:25:15 +03:00
#!/usr/bin/env bash
if [ -z $TRAVIS_BUILD_DIR ]; then
2020-12-17 11:13:11 +03:00
exit 0;
2018-05-04 16:25:15 +03:00
fi
MAGE_ROOT=$TRAVIS_BUILD_DIR/../magento2
create_db() {
2020-12-17 11:13:11 +03:00
mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"
2018-05-04 16:25:15 +03:00
}
magento_clone() {
2020-12-17 11:13:11 +03:00
cd ..
git clone https://github.com/magento/magento2
cd magento2
git checkout $BRANCH
2020-12-17 11:13:11 +03:00
touch auth.json
echo '
{
"http-basic": {
"repo.magento.com": {
"username": "<public-key>",
"password": "<private-key>"
}
}
}
2020-12-17 11:13:11 +03:00
' > auth.json
2020-12-17 11:13:11 +03:00
sudo sed -e "s?<public-key>?$PUBLIC_KEY?g" --in-place auth.json
sudo sed -e "s?<private-key>?$PRIVATE_KEY?g" --in-place auth.json
2020-12-17 11:13:11 +03:00
php -r "copy('https://getcomposer.org/download/1.10.17/composer.phar', 'composer.phar');"
php composer.phar install --ignore-platform-reqs --no-interaction --prefer-dist
php composer.phar require retailcrm/api-client-php
2018-05-04 16:25:15 +03:00
}
magento_install() {
2020-12-17 11:13:11 +03:00
cd $MAGE_ROOT
2018-05-04 16:25:15 +03:00
2020-12-17 11:13:11 +03:00
php bin/magento setup:install \
--db-host="$DB_HOST" \
--db-name="$DB_NAME" \
--db-user="$DB_USER" \
--admin-firstname="$ADMIN_FIRSTNAME" \
--admin-lastname="$ADMIN_LASTNAME" \
--admin-email="$ADMIN_EMAIL" \
--admin-user="$ADMIN_USER" \
--admin-password="$ADMIN_PASS" \
--language="en_US" \
--currency="USD" \
--timezone="Europe/Moscow"
2018-05-04 16:25:15 +03:00
}
module_install() {
2020-12-17 11:13:11 +03:00
cd $MAGE_ROOT
mkdir -p app/code/Retailcrm/Retailcrm
cp -R $TRAVIS_BUILD_DIR/src/* app/code/Retailcrm/Retailcrm
2018-05-04 16:25:15 +03:00
2020-12-17 11:13:11 +03:00
php bin/magento module:enable Retailcrm_Retailcrm
php bin/magento setup:upgrade
php bin/magento setup:di:compile
2018-05-04 16:25:15 +03:00
}
create_db
magento_clone
magento_install
module_install