-
Notifications
You must be signed in to change notification settings - Fork 1
/
fetch-shops.sh
29 lines (22 loc) · 944 Bytes
/
fetch-shops.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# Versions to be installed with their corresponding Composer versions
declare -A versions=( ["6.1"]="1" ["6.2"]="1" ["6.3"]="1" ["6.4"]="2" ["6.5"]="2" )
# Loop through each version and set up the projects
for version in "${!versions[@]}"
do
# Determine which Composer version to use based on the version
composer_version="${versions[$version]}"
# Target directory for each project
TARGET_DIR="shops/$version"
# Remove the existing directory and recreate it
rm -rf "$TARGET_DIR"
mkdir -p "$TARGET_DIR"
# Use Docker to run Composer 2 for each project version
docker run --rm \
-v $(pwd):/app \
-w /app \
composer:$composer_version \
composer create-project --no-dev --ignore-platform-reqs oxid-esales/oxideshop-project $TARGET_DIR dev-b-$version-ce
done
# Change the owner of the shops directory to the user who ran the script
sudo chown -R $(whoami) shops/