Parcourir la source

Remove duplicate bin/setup-composer-auth from bin/setup, updated bin/setup-composer-auth to check if creds are set in container, if they are, it will exit #587

Mark Shust il y a 3 ans
Parent
commit
5540ffba91
2 fichiers modifiés avec 8 ajouts et 3 suppressions
  1. 0 3
      compose/bin/setup
  2. 8 0
      compose/bin/setup-composer-auth

+ 0 - 3
compose/bin/setup

@@ -89,9 +89,6 @@ bin/setup-domain "${DOMAIN}"
 echo "Clearing the cache to apply updates..."
 bin/clinotty bin/magento cache:flush
 
-echo "Ensuring Composer auth.json is setup..."
-bin/setup-composer-auth
-
 echo "Installing cron, run 'bin/cron start' to enable..."
 bin/clinotty bin/magento cron:install
 

+ 8 - 0
compose/bin/setup-composer-auth

@@ -3,6 +3,14 @@ MAGENTO_USERNAME_PROP="http-basic.repo.magento.com.username"
 MAGENTO_PASSWORD_PROP="http-basic.repo.magento.com.password"
 hash composer 2>/dev/null && IS_COMPOSER_ON_HOST=true
 
+PUBLIC_KEY="$(bin/clinotty composer config --global $MAGENTO_USERNAME_PROP 2>/dev/null)"
+PRIVATE_KEY="$(bin/clinotty composer config --global $MAGENTO_PASSWORD_PROP 2>/dev/null)"
+
+if [ ! -z "$PUBLIC_KEY" ] && [ ! -z "$PRIVATE_KEY" ]; then
+    echo "Composer auth has already been setup."
+    exit 0
+fi
+
 if [ $IS_COMPOSER_ON_HOST ]; then
     PUBLIC_KEY="$(composer config --global $MAGENTO_USERNAME_PROP 2>/dev/null)"
     PRIVATE_KEY="$(composer config --global $MAGENTO_PASSWORD_PROP 2>/dev/null)"