Last active
November 30, 2020 18:28
-
-
Save gilbertsoft/ed5f08c37d5dddbe83427471f3421b54 to your computer and use it in GitHub Desktop.
Install and Setup Aimeos Dev Packages using TYPO3 and DDEV
This file contains hidden or 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 | |
# --------------------------------------------------------------------------- | |
# start configuration | |
# --------------------------------------------------------------------------- | |
project=typo3-aimeos-dev | |
projectFolder=${project} | |
githubOrg=yourorg | |
typo3Version=9.5 | |
packages='aimeos-core ai-controller-frontend ai-client-jsonapi ai-controller-jobs ai-client-html ai-admin-jsonadm ai-admin-jqadm ai-typo3 ai-gettext aimeos-typo3' | |
# some optional parameters to change the default behavior of DDEV | |
httpPort=80 | |
httpsPort=443 | |
useDNSLookup=true | |
# --------------------------------------------------------------------------- | |
# end configuration | |
# --------------------------------------------------------------------------- | |
# --------------------------------------------------------------------------- | |
# Functions | |
# --------------------------------------------------------------------------- | |
# Clone helper function | |
clone_repo () { | |
# Clone repo from githubOrg, fall back to Aimeos | |
[ -f packages/$1/composer.json ] || ddev exec git clone --branch upstream/master https://github.com/${githubOrg}/$1 packages/$1 || ddev exec git clone https://github.com/aimeos/$1 packages/$1 | |
} | |
# Clone and install helper function | |
prepare_packages () { | |
local cmd="ddev composer require" | |
for package in $packages | |
do | |
clone_repo $package | |
cmd="$cmd aimeos/$package:@dev" | |
done | |
echo $cmd | |
eval "\$cmd --no-update" | |
} | |
# --------------------------------------------------------------------------- | |
# Entry point | |
# --------------------------------------------------------------------------- | |
# Create TYPO3 instance if not already exists | |
[ -d ${projectFolder} ] || mkdir ${projectFolder} | |
cd ${projectFolder} | |
ddev config --project-type php --http-port ${httpPort} --https-port ${httpsPort} --use-dns-when-possible ${useDNSLookup} | |
ddev restart | |
[ -f composer.json ] || ddev composer create "typo3/cms-base-distribution:^${typo3Version}" --no-interaction --prefer-dist --no-install | |
# Allow the installation of dev packages | |
ddev composer config minimum-stability dev | |
ddev composer config prefer-stable true | |
# Create local path repository | |
[ -d packages ] || mkdir packages | |
ddev composer config repositories.local path "'packages/*'" | |
# Clone Aimeos packages to local path repository and require @dev | |
prepare_packages | |
# Configure and start DDEV | |
ddev config --project-name ${project} --project-type typo3 --webserver-type apache-fpm | |
ddev restart | |
ddev composer install | |
# Setup TYPO3 (DDEV 1.16.0 or higher) | |
#ddev typo3cms install:setup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment