2
0
Эх сурвалжийг харах

Added new bin/setup-composer-auth helper script

Mark Shust 4 жил өмнө
parent
commit
4db47ddb50

+ 5 - 0
CHANGELOG.md

@@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
 
 
 - PHP image `8.0-fpm-develop` now available for testing purposes.
 - PHP image `8.0-fpm-develop` now available for testing purposes.
 
 
+## [37.0.2] - 2021-02-17
+
+### Added
+- New `bin/setup-composer-auth` file to setup Composer auth creds.
+
 ## [37.0.1] - 2021-02-15
 ## [37.0.1] - 2021-02-15
 
 
 ### Fixed
 ### Fixed

+ 1 - 0
README.md

@@ -263,6 +263,7 @@ It is recommended to keep your root docker config files in one repository, and y
 - `bin/root`: Run any CLI command as root without going into the bash prompt. Ex `bin/root apt-get install nano`
 - `bin/root`: Run any CLI command as root without going into the bash prompt. Ex `bin/root apt-get install nano`
 - `bin/rootnotty`: Run any CLI command as root with no TTY. Ex `bin/rootnotty chown -R app:app /var/www/html`
 - `bin/rootnotty`: Run any CLI command as root with no TTY. Ex `bin/rootnotty chown -R app:app /var/www/html`
 - `bin/setup`: Run the Magento setup process to install Magento from the source code, with optional domain name. Defaults to `magento.test`. Ex. `bin/setup magento.test`
 - `bin/setup`: Run the Magento setup process to install Magento from the source code, with optional domain name. Defaults to `magento.test`. Ex. `bin/setup magento.test`
+- `bin/setup-composer-auth`: Setup authentication credentials for Composer.
 - `bin/setup-grunt`: Install and configure Grunt JavaScript task runner to compile .less files
 - `bin/setup-grunt`: Install and configure Grunt JavaScript task runner to compile .less files
 - `bin/setup-pwa-studio`: (BETA) Install PWA Studio (requires NodeJS and Yarn to be installed on the host machine). Pass in your base site domain, otherwise the default `master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud` will be used. Ex: `bin/setup-pwa-studio magento.test`
 - `bin/setup-pwa-studio`: (BETA) Install PWA Studio (requires NodeJS and Yarn to be installed on the host machine). Pass in your base site domain, otherwise the default `master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud` will be used. Ex: `bin/setup-pwa-studio magento.test`
 - `bin/setup-ssl`: Generate an SSL certificate for one or more domains. Ex. `bin/setup-ssl magento.test foo.test`
 - `bin/setup-ssl`: Generate an SSL certificate for one or more domains. Ex. `bin/setup-ssl magento.test foo.test`

+ 2 - 0
compose/bin/download

@@ -8,4 +8,6 @@ bin/stop
 docker-compose -f docker-compose.yml up -d
 docker-compose -f docker-compose.yml up -d
 [ $? != 0 ] && echo "Failed to start Docker services" && exit
 [ $? != 0 ] && echo "Failed to start Docker services" && exit
 
 
+bin/setup-composer-auth
+
 bin/clinotty composer create-project --repository=https://repo.magento.com/ magento/project-"${EDITION}"-edition="${VERSION}" .
 bin/clinotty composer create-project --repository=https://repo.magento.com/ magento/project-"${EDITION}"-edition="${VERSION}" .

+ 0 - 1
compose/bin/setup

@@ -14,7 +14,6 @@ bin/stop
 
 
 docker-compose -f docker-compose.yml up -d
 docker-compose -f docker-compose.yml up -d
 [ $? != 0 ] && echo "Failed to start Docker services" && exit
 [ $? != 0 ] && echo "Failed to start Docker services" && exit
-sleep 5 #Ensure containers are started...
 
 
 bin/clinotty chmod u+x bin/magento
 bin/clinotty chmod u+x bin/magento
 mv .vscode src
 mv .vscode src

+ 5 - 4
compose/bin/setup-composer-auth

@@ -11,9 +11,9 @@ fi
 if [ -z "$PUBLIC_KEY" ] || [ -z "$PRIVATE_KEY" ]; then
 if [ -z "$PUBLIC_KEY" ] || [ -z "$PRIVATE_KEY" ]; then
     exec < /dev/tty
     exec < /dev/tty
     echo
     echo
-    echo "    Authentication required (repo.magento.com, public_key and private_key):"
-    read -r -p "        Username: " PUBLIC_KEY
-    read -r -p "        Password: " PRIVATE_KEY
+    echo "Composer authentication required (repo.magento.com public and private keys):"
+    read -r -p "    Username: " PUBLIC_KEY
+    read -r -p "    Password: " PRIVATE_KEY
     echo
     echo
     exec <&-
     exec <&-
 fi
 fi
@@ -22,6 +22,7 @@ if [ -z "$PUBLIC_KEY" ] || [ -z "$PRIVATE_KEY" ]; then
     echo "Please setup Composer auth for repo.magento.com to continue." && exit 1
     echo "Please setup Composer auth for repo.magento.com to continue." && exit 1
 fi
 fi
 
 
-bin/clinotty composer config --global http-basic.repo.magento.com "$PUBLIC_KEY" "$PRIVATE_KEY"
+# Output must be piped otherwise file descriptor errors occur. Carriage returns?
+echo "composer config --global http-basic.repo.magento.com ${PUBLIC_KEY} ${PRIVATE_KEY}" | bin/clinotty bash -
 
 
 echo "Composer auth has been setup."
 echo "Composer auth has been setup."

+ 1 - 1
compose/docker-compose.dev.yml

@@ -1,7 +1,7 @@
 # Mark Shust's Docker Configuration for Magento
 # Mark Shust's Docker Configuration for Magento
 # (https://github.com/markshust/docker-magento)
 # (https://github.com/markshust/docker-magento)
 #
 #
-# Version 37.0.1
+# Version 37.0.2
 
 
 version: "3"
 version: "3"
 
 

+ 1 - 1
compose/docker-compose.yml

@@ -1,7 +1,7 @@
 # Mark Shust's Docker Configuration for Magento
 # Mark Shust's Docker Configuration for Magento
 # (https://github.com/markshust/docker-magento)
 # (https://github.com/markshust/docker-magento)
 #
 #
-# Version 37.0.1
+# Version 37.0.2
 
 
 version: "3"
 version: "3"