2
  • I have a local Dev environment and installed Magento 2 using composer
  • I initialized the local /magneto2/ folder as a Git repo
  • I added this .gitignore file to the root of my /magneto2/ folder
  • I have a remote repo ready to use on Beanstalk

From the Beanstalk remote repo I want to deploy the code to the Staging server

  1. What are the steps now to deploy all my files to the Staging server (through the Beanstalk remote repo)?
  2. How do I setup my Magento 2 site on the Staging server with correct database settings etc?
0

Beanstalk doesn't handle composer deployments.

The guys at beanstalk created deploybot to handle composer deployments.

If you want automatic deployments for staging you need to go to beanstalk > integrations > Modular Webhooks and add there the deploybot webhook.

  • I am confused now. What are composer deployments exactly? The only thing I want is: 1) have my code locally so I have my local development environment. 2) I am able to upgrade Magento locally 3) Magento files are in my local Git repository 4) I develop and create my theme locally and push changes to the Beanstalk remote repo. 5) from the Beanstalk remote repo I want to pull the code into Staging. But a lot of files are ignored by .gitignore. How do I get all my files on Staging server and after successful setup, how do I pull in only changes for custom theme and upgrades etc? – meez Jun 1 '16 at 16:46
  • @MeesFrenkelFrank magento2 uses code generation so you shouldn't track certain folders, but instead run magento commands to generate those files. composer does not recommend tracking the vendor folder because it will lead to possible errors with packages. tl;dr if you want to hack it you can just remove the .gitignore, track everything and push to beanstalk. it will be painfully slow, but it will work. but that is not recommended. you cannot have the same workflow as in mage1 because mage2 is built differently. – Claudiu Creanga Jun 1 '16 at 20:48
  • Thanks. So in other words; I have to do the same install with composer first on my Staging server using composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition <installation directory name>. Or does that not work on Shared hosting server? Or can I also alternatively just crab the archive and extract the files on the server and run the setup there? Like in this tutorial? – meez Jun 2 '16 at 4:37
  • And I use this .gitignore file. Is it correct it's still tracking 6965 files and I have to commit and push those files for one time? – meez Jun 2 '16 at 5:29
  • 1
    @MeesFrenkelFrank magento.stackexchange.com/questions/102144/… while you're running a composer install and deploy your site will be down. that's why with composer it is good to run them in a container and then symlink the folder. that's what deploybot does, but can be done with other tools like capistrano – Claudiu Creanga Jun 2 '16 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.