diff --git a/.env.sample b/.env.sample index e956323..72684a5 100644 --- a/.env.sample +++ b/.env.sample @@ -31,6 +31,12 @@ COMPOSE_PROJECT_NAME=YOUR_PROJECT_NAME ########### COMPOSER_PROJECT_ENABLED=true +########################################################################## +# The repository that composer will use to create your magento project +# by default the value is the mage-OS (https://mage-os.org/) repository +########### +COMPOSER_PROJECT_REPO=https://mirror.mage-os.org/ + ########################################################################## # The Composer Project to install. Note, that on certain PHP versions, the glob # syntax does not work, so you may need to specify an exact version. @@ -80,8 +86,8 @@ MAGENTO_CURRENCY=USD MAGENTO_TIMEZONE="America/Chicago" ########################################################################## -# Whether or not to use sample data. By default, we use Venia. +# Whether or not to use sample data. By default, we use Luma. # Supported values include 'venia', 'luma', 'none' -# Default: 'venia' +# Default: 'luma' ########### -MAGENTO_SAMPLE_DATA="venia" \ No newline at end of file +MAGENTO_SAMPLE_DATA="luma" \ No newline at end of file diff --git a/.github/workflows/test-env-startup.yml b/.github/workflows/test-env-startup.yml index c3578ae..2532bd1 100644 --- a/.github/workflows/test-env-startup.yml +++ b/.github/workflows/test-env-startup.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ matrix.COMPOSER_PROJECT }} + key: ${{ runner.os }}-composer-${{ matrix.COMPOSER_PROJECT }}-v1.0 restore-keys: | ${{ runner.os }}-composer- - name: Add HTTP basic auth credentials for composer diff --git a/docs/stories/composer/auth.md b/docs/stories/composer/auth.md new file mode 100644 index 0000000..a6892b0 --- /dev/null +++ b/docs/stories/composer/auth.md @@ -0,0 +1,22 @@ +### Setting up your Magento Account +[The process of creating a Magento account is fully documented by Magento and you should follow their process](https://docs.magento.com/m2/ce/user_guide/magento/magento-account-create.html). + +### Configuring Composer +In case you have not done so, we will add your Magento composer authentication credentials to your user's local `auth.json`. + +First check to see if you have a credentials file under `~/.composer/auth.json`. + +```bash +cat ~/.composer/auth.json +``` + +If you have a `auth.json` file here, you have most likely already configured your credentials and can skip to the next step. + +If you don't see your credentials there, [you can follow the Magento 2 guide to find your credentials](https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html) and copy the `auth.json.sample` [found in the Magento 2 repo](https://github.com/magento/magento2/blob/2.4-develop/auth.json.sample) to your user's `auth.json` file: `~/.composer/auth.json` file and fill out the required credentials. + +```bash +cp /path/to/magento/project/auth.json.sample ~/.composer/auth.json +``` + +### Per-project configuration +We recommend using `auth.json` in your user's directory, but when you're working on multiple Magento 2 applications at once, you may need multiple `auth.json`. You can simply add the `auth.json` to the root of your Magento 2 project after project creation, and composer will use those credentials instead. \ No newline at end of file diff --git a/docs/stories/dolphin.md b/docs/stories/dolphin.md index 5af4f57..defab49 100644 --- a/docs/stories/dolphin.md +++ b/docs/stories/dolphin.md @@ -13,29 +13,6 @@ git clone https://www.github.com/graycoreio/mage2docker \ && cd mage2docker ``` -### Setting up your Magento Account -[The process of creating a Magento account is fully documented by Magento and you should follow their process](https://docs.magento.com/m2/ce/user_guide/magento/magento-account-create.html). - -### Configuring Composer -In case you have not done so, we will add your Magento composer authentication credentials to your user's local `auth.json`. - -First check to see if you have a credentials file under `~/.composer/auth.json`. - -```bash -cat ~/.composer/auth.json -``` - -If you have a `auth.json` file here, you have most likely already configured your credentials and can skip to the next step. - -If you don't see your credentials there, [you can follow the Magento 2 guide to find your credentials](https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html) and copy the `auth.json.sample` [found in the Magento 2 repo](https://github.com/magento/magento2/blob/2.4-develop/auth.json.sample) to your user's `auth.json` file: `~/.composer/auth.json` file and fill out the required credentials. - -```bash -cp /path/to/magento/project/auth.json.sample ~/.composer/auth.json -``` - -### Per-project configuration -We recommend using `auth.json` in your user's directory, but when you're working on multiple Magento 2 applications at once, you may need multiple `auth.json`. You can simply add the `auth.json` to the root of your Magento 2 project after project creation, and composer will use those credentials instead. - ### Configuring Docker Compose Mage2Docker comes with a basic environment configuration file `.env.sample`, you can utilize this file to tailor your environment to your needs. @@ -72,6 +49,16 @@ If you're using [WSL2, use this instead.](https://github.com/microsoft/WSL/issue * [Install Recommended Extensions](../../.vscode/extensions.json) * [Install the devcontainer cli](https://code.visualstudio.com/docs/remote/devcontainer-cli) + +### Magento Open Source and Adobe Commerce Only - Composer auth.json +By default this project uses [Mage-OS](https://mage-os.org/). To use Adobe's Magento Open Source or Adobe Commerce you will need to: +1. Follow [these steps](./composer/auth.md) to configure composer's `auth.json` with your Magento Account credentials. +2. Change the `COMPOSER_PROJECT_REPO` variable in `.env` file to `https://repo.magento.com/` + + +### Using Venia Data Sample +For now, if you want to use Venia data sample you'll need to configure your `auth.json` because it is only available repo.magento.com. Please follow [these steps](./composer/auth.md) to set up composer's `auth.json` + ### Start your environment From your `mage2docker` repo: diff --git a/php/7.2/fpm-alpine-dolphin/bin/setup.sh b/php/7.2/fpm-alpine-dolphin/bin/setup.sh index 4d8a676..180d891 100755 --- a/php/7.2/fpm-alpine-dolphin/bin/setup.sh +++ b/php/7.2/fpm-alpine-dolphin/bin/setup.sh @@ -19,7 +19,7 @@ if [ -f 'pub/index.php' ]; then echo "Setup took: $((SETUP_END-SETUP_START)) seconds..." exit 0; elif [ "$COMPOSER_PROJECT_ENABLED" == true ]; then - composer create-project --no-install --repository-url=https://repo.magento.com/ $COMPOSER_PROJECT . + composer create-project --no-install --repository-url=$COMPOSER_PROJECT_REPO $COMPOSER_PROJECT . composer config --no-interaction allow-plugins.dealerdirect/phpcodesniffer-composer-installer true composer config --no-interaction allow-plugins.laminas/laminas-dependency-plugin true @@ -79,7 +79,7 @@ bin/magento config:set web/seo/use_rewrites 1 if [ "$MAGENTO_SAMPLE_DATA" == "venia" ]; then echo "Installing 'Venia' Sample Data..."; - composer config --no-interaction --ansi repositories.venia-sample-data composer https://repo.magento.com + composer config --no-interaction --ansi repositories.venia-sample-data composer https://repo.magento.com/ composer require --no-interaction --ansi magento/venia-sample-data:* bin/magento setup:upgrade diff --git a/php/7.3/fpm-alpine-dolphin/bin/setup.sh b/php/7.3/fpm-alpine-dolphin/bin/setup.sh index 4d8a676..180d891 100755 --- a/php/7.3/fpm-alpine-dolphin/bin/setup.sh +++ b/php/7.3/fpm-alpine-dolphin/bin/setup.sh @@ -19,7 +19,7 @@ if [ -f 'pub/index.php' ]; then echo "Setup took: $((SETUP_END-SETUP_START)) seconds..." exit 0; elif [ "$COMPOSER_PROJECT_ENABLED" == true ]; then - composer create-project --no-install --repository-url=https://repo.magento.com/ $COMPOSER_PROJECT . + composer create-project --no-install --repository-url=$COMPOSER_PROJECT_REPO $COMPOSER_PROJECT . composer config --no-interaction allow-plugins.dealerdirect/phpcodesniffer-composer-installer true composer config --no-interaction allow-plugins.laminas/laminas-dependency-plugin true @@ -79,7 +79,7 @@ bin/magento config:set web/seo/use_rewrites 1 if [ "$MAGENTO_SAMPLE_DATA" == "venia" ]; then echo "Installing 'Venia' Sample Data..."; - composer config --no-interaction --ansi repositories.venia-sample-data composer https://repo.magento.com + composer config --no-interaction --ansi repositories.venia-sample-data composer https://repo.magento.com/ composer require --no-interaction --ansi magento/venia-sample-data:* bin/magento setup:upgrade diff --git a/php/7.4/fpm-alpine-dolphin/bin/setup.sh b/php/7.4/fpm-alpine-dolphin/bin/setup.sh index 1be933d..0c407d9 100755 --- a/php/7.4/fpm-alpine-dolphin/bin/setup.sh +++ b/php/7.4/fpm-alpine-dolphin/bin/setup.sh @@ -23,7 +23,7 @@ if [ -f 'pub/index.php' ]; then echo "Setup took: $((SETUP_END-SETUP_START)) seconds..." exit 0; elif [ "$COMPOSER_PROJECT_ENABLED" == true ]; then - composer create-project --no-interaction --no-install --repository-url=https://repo.magento.com/ $COMPOSER_PROJECT . + composer create-project --no-interaction --no-install --repository-url=$COMPOSER_PROJECT_REPO $COMPOSER_PROJECT . composer config --no-interaction allow-plugins.dealerdirect/phpcodesniffer-composer-installer true composer config --no-interaction allow-plugins.laminas/laminas-dependency-plugin true @@ -83,7 +83,7 @@ bin/magento config:set web/seo/use_rewrites 1 if [ "$MAGENTO_SAMPLE_DATA" == "venia" ]; then echo "Installing 'Venia' Sample Data..."; - composer config --no-interaction --ansi repositories.venia-sample-data composer https://repo.magento.com + composer config --no-interaction --ansi repositories.venia-sample-data composer https://repo.magento.com/ composer require --no-interaction --ansi magento/venia-sample-data:* bin/magento setup:upgrade