Skip to content
This repository was archived by the owner on Dec 11, 2021. It is now read-only.

Commit b1bf5c1

Browse files
author
fmarczewski
committed
Update versions bin and env from upstream
1 parent 74c0861 commit b1bf5c1

27 files changed

Lines changed: 405 additions & 134 deletions

‎bin/cache-clean‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
bin/cli /var/www/.composer-global/vendor/bin/cache-clean.js "$@"

‎bin/cliq‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
[ -z "$1" ] && echo "Please specify a CLI command (ex. ls)" && exit
3+
bin/clinotty "$@" >/dev/null

‎bin/copyfromcontainer‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
[ -z "$1" ] && echo "Please specify a directory or file to copy from container (ex. vendor, --all)" && exit
3+
4+
REAL_SRC=$(cd -P "src" && pwd)
5+
if [ "$1" == "--all" ]; then
6+
docker cp "$(docker-compose ps -q phpfpm|awk '{print $1}')":/var/www/html/./ "$REAL_SRC/"
7+
echo "Completed copying all files from container to host"
8+
else
9+
if [ -f "$1" ] ; then
10+
docker cp "$(docker-compose ps -q phpfpm|awk '{print $1}')":/var/www/html/"$1" "$REAL_SRC/$1"
11+
else
12+
docker cp "$(docker-compose ps -q phpfpm|awk '{print $1}')":/var/www/html/"$1" "$REAL_SRC/$(dirname "$1")"
13+
fi
14+
echo "Completed copying $1 from container to host"
15+
fi

‎bin/copytocontainer‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
[ -z "$1" ] && echo "Please specify a directory or file to copy to container (ex. vendor, --all)" && exit
3+
4+
REAL_SRC=$(cd -P "src" && pwd)
5+
if [ "$1" == "--all" ]; then
6+
docker cp "$REAL_SRC/./" "$(docker-compose ps -q phpfpm|awk '{print $1}')":/var/www/html/
7+
echo "Completed copying all files from host to container"
8+
bin/fixowns
9+
bin/fixperms
10+
else
11+
if [ -f "$REAL_SRC/$1" ]; then
12+
docker cp "$REAL_SRC/${1}" "$(docker-compose ps -q phpfpm|awk '{print $1}')":/var/www/html/"$1"
13+
else
14+
docker cp "$REAL_SRC/${1}" "$(docker-compose ps -q phpfpm|awk '{print $1}')":/var/www/html/"$(dirname "$1")"
15+
fi
16+
echo "Completed copying $1 from host to container"
17+
bin/fixowns "$1"
18+
bin/fixperms "$1"
19+
fi

‎bin/dev-test-run‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
[ -z "$1" ] && echo "Please specify test type (ex. integration)" && exit
4+
5+
TEST_TYPE="$1"
6+
shift
7+
bin/clinotty bash -c "cd dev/tests/${TEST_TYPE} && ../../../vendor/bin/phpunit -c phpunit.xml.dist $*"

‎bin/devtools-cli-check‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
if ! bin/clinotty ls /var/www/.composer-global/vendor/bin/cache-clean.js 1> /dev/null 2>&1; then
3+
echo "Installing devtools metapackage, just a moment..."
4+
bin/cliq mkdir -p /var/www/.composer-global
5+
bin/composer require --working-dir=/var/www/.composer-global --quiet markshust/magento2-metapackage-devtools-cli:^1.0
6+
echo "Devtools installed."
7+
fi

‎bin/download‎

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,13 @@
11
#!/bin/bash
2-
[ -z "$1" ] && echo "Please specify the version to download (ex. 2.0.0)" && exit
2+
set -o errexit
33

4-
edition=${2:-community}
4+
VERSION=${1:-2.4.2}
5+
EDITION=${2:-community}
56

6-
if [[ "$edition" == "enterprise" ]]; then
7-
rm -rf src
8-
composer create-project --repository=https://repo.magento.com/ --ignore-platform-reqs magento/project-enterprise-edition=$1 src
9-
exit 0
10-
fi
7+
bin/stop
8+
docker-compose -f docker-compose.yml up -d
9+
[ $? != 0 ] && echo "Failed to start Docker services" && exit
1110

12-
if [ ! -f ~/.docker-magento/magento2-$1.tar.gz ]; then
13-
mkdir -p ~/.docker-magento
14-
(cd ~/.docker-magento && curl -fOL http://pubfiles.nexcess.net/magento/ce-packages/magento2-$1.tar.gz)
15-
fi
11+
bin/setup-composer-auth
1612

17-
# Fallback download to hypernode if archive doesn't exist on Nexcess (smaller than 1MB)
18-
if [ $(find ~/.docker-magento/magento2-$1.tar.gz -size -1M) ]; then
19-
(cd ~/.docker-magento && curl -o magento2-$1.tar.gz -fOL https://www.magento.mirror.hypernode.com/releases/magento-$1.tar.gz)
20-
fi
21-
22-
# Final fallback. If no archive exists, let's use Composer!
23-
if [ ! -f ~/.docker-magento/magento2-$1.tar.gz ]; then
24-
echo "Archive not found, or not yet available due to new version release."
25-
echo "Attempting install with Composer..."
26-
rm -rf src
27-
composer create-project --repository=https://repo.magento.com/ --ignore-platform-reqs magento/project-community-edition=$1 src
28-
else
29-
echo "Extracting magento2-$1.tar.gz to ./src"
30-
mkdir -p src && tar xzf ~/.docker-magento/magento2-$1.tar.gz -o -C src
31-
fi
13+
bin/clinotty composer create-project --repository=https://repo.magento.com/ magento/project-"${EDITION}"-edition="${VERSION}" .

‎bin/fixowns‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
2-
echo "Correcting filesystem ownerships..."
2+
echo "Fixing filesystem ownerships..."
33

44
if [ -z "$1" ]; then
55
bin/rootnotty chown -R app:app /var/www/
66
else
7-
bin/rootnotty chown -R app:app /var/www/html/$1
7+
bin/rootnotty chown -R app:app /var/www/html/"$1"
88
fi
99

10-
echo "Filesystem ownerships corrected."
10+
echo "Filesystem ownerships fixed."

‎bin/fixperms‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
echo "Correcting filesystem permissions..."
2+
echo "Fixing filesystem permissions..."
33

44
if [ -z "$1" ]; then
55
bin/clinotty find var vendor pub/static pub/media app/etc \( -type f -or -type d \) -exec chmod u+w {} +;
@@ -8,4 +8,4 @@ else
88
bin/clinotty find "$1" \( -type f -or -type d \) -exec chmod u+w {} +;
99
fi
1010

11-
echo "Filesystem permissions corrected."
11+
echo "Filesystem permissions fixed."

‎bin/mysql‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#!/bin/bash
2+
3+
# shellcheck source=../env/db.env
24
source env/db.env
35
if [ -t 0 ]; then
46
# Need tty to run mysql shell
5-
bin/cli mysql -h${MYSQL_HOST} -u${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} "$@"
7+
bin/cli mysql -h"${MYSQL_HOST}" -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" "${MYSQL_DATABASE}" "$@"
68
else
79
# Read from stdin, ex: bin/mysql < dbdump.sql
8-
bin/clinotty mysql -h${MYSQL_HOST} -u${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} "$@"
10+
bin/clinotty mysql -h"${MYSQL_HOST}" -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" "${MYSQL_DATABASE}" "$@"
911
fi

0 commit comments

Comments
 (0)