Skip to content

Project Onboarding

Olga Kopylova edited this page Jun 2, 2020 · 21 revisions

Local Development

Note: this version has Linux/OS X specifics. Please contribute to help provide correct guidelines for other OS.

Initial Setup

Prerequisites

  1. Docker
  2. PHP
  3. Composer
  4. GitHub token

Setup

  1. Clone https://github.com/magento-architects/storefront-cloud-project.git and switch to corresponding feature branch branch.
git clone -b <branch> git@github.com:magento-architects/storefront-cloud-project.git

Base branch is production. Add environment variable GITHUB_TOKEN to access necessary repositories: export GITHUB_TOKEN=<your_token>.

  1. Follow https://devdocs.magento.com/cloud/docker/docker-mode-developer.html instructions to generate the project and start DevBox.
  • Make sure Docker has at least 6GB of RAM.
  • Skip step 1 about "application template". This repo is a ready project.
  • auth.json is not needed for ECP project, skip this step.
  • For composer install:
    • Using --ignore-platform-reqs is ok on this stage if not all requirements are covered. Purpose of this step is to install ece-tools, so platform requirements should satisfy at least ece-tools.
    • This step will clone all specified Magento repos (see .magento.env.yaml or composer.json), this may take a while.
  1. Add 127.0.0.1 magento2.docker to hosts file

Magento should be available at https://magento2.docker/

Steps summary

# Clone project
mkdir sf-app && cd sf-app
git clone -b <branch> git@github.com:magento-architects/storefront-cloud-project.git .

# Set GitHub token env var
echo 'export GITHUB_TOKEN=<your_token>' >> ~/.bash_profile
source ~/.bash_profile

# Build project
composer install --ignore-platform-reqs
./vendor/bin/ece-docker build:compose --mode=developer --sync-engine=mutagen --with-cron

# Start DevBox
docker-compose up -d
./mutagen.sh
 
# wait a little bit for files to sync, or next steps can fail

# Deploy Magento application to DevBox 
docker-compose run deploy cloud-deploy
docker-compose run deploy cloud-post-deploy

# Add DevBox Magento domain to hosts
sudo -- sh -c "echo '127.0.0.1 magento2.docker' >> /etc/hosts"