Skip to content

Project Onboarding

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

Local Development

Initial Setup

Prerequisites

  1. PHP
  2. Composer
  3. GitHub token
  4. Docker
  5. mutagen.io

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.
  • composer install clones 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

For Linux/OS X:

# 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
./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"

Please contribute to help provide steps summary for other OS.