Giter Club home page Giter Club logo

shopware-platform-vagrant's Introduction

Shopware Development build with Vagrant

Table of contents

  1. Vagrant VM
  2. Installation
  3. Usage
  4. Shopware Dev setup
  5. Useful vagrant commands
  6. Connecting your IDE

Vagrant VM

If using docker is not an option for you, vagrant is another great technology to quickly get a local Shopware up and running.

Other than with the docker or local setup, with vagrant you will have a complete seperate server on your machine.

Because of technical reasons, the vagrant machine acts like a remote web server, so with this setup, you'll develop your code on your PC like and then you upload/synchronize it to the vagrant machine.

For this, the vagrant machine supports SCP/SSH, which is integrated in Editors like PHPStorm or Visual Studio Code.

Installation

You need VirtualBox, Vagrant (min. Version 2.0) and Git installed locally on your machine.

The IP address 192.168.33.10 is used by the vagrant box, so it must not be in use in the network already. If this is not possible, you manually have to change the IP address in the Vagrantfile you'll clone in the next step.

Usage

This section explains the basic setup of the virtual machine, as well as an advanced setup, using a reverse proxy and SSL.

Basic setup

Start by cloning this repository to your local machine

$ git clone [email protected]:shopwareLabs/shopware-platform-vagrant.git
$ cd shopware-platform-vagrant

Boot up the virtual machine by executing vagrant up

$ vagrant up

The first boot takes a while due to box download and ansible provisioning. Feel free to grab a drink.

After the process completes your virtual machine will be up an running with your development environment ready to use.

The storefront will be available at http://192.168.33.10/.

The administration will be available at http://192.168.33.10/admin.

Credentials for ssh access are vagrant/vagrant.

You connect via vagrant ssh or use credentials and ssh with the following command (make sure ssh known_hosts is correct):

Shopware versions

By editing the ansible/vars/all.yml file you are able to set the shopware_version variable. This variable references the branch name of the devlopment template which is used to build the vagrant VM. This can be the literal string HEAD, a branch name or a tag name of this repository: https://github.com/shopware/development

By default this variable is set to the master branch. To use a specific version you can set the corresponding git tag: v6.2.2

In it's current state this setup cannot be used to update a running shopware instance via shopware_version variable and re-provisioning via vagrant.

Advanced setup

If you would like to access the Shopware instance using a hostname, rather than the IP address, you can enable the reverse proxy and - if you like - SSL encryption.

Both proxy and SSL can be enabled by editing the ansible/vars/all.yml. In this file, you will find the following options and be able to modify them accordingly.

Variable Type Default Description
proxy_enabled Boolean (yes/no) no Enables the installation of nginx as a reverse proxy
proxy_hostname Hostname "shopware.local" Defines the hostname that will be used to access the Shopware instance
proxy_ssl Boolean (yes/no) no Enables SSL

Please notice that you will have to modify your hosts file or use the Vagrant Hostsupdater plugin, when using a reverse proxy setup.

Given the hosts entry is set, you can access the Shopware instance via https://<proxy_hostname>, whereas <proxy_hostname> is a placeholder for the configured hostname (shopware.local per default).


Shopware Dev setup

For more info on the Shopware dev setup visit our Shopware platform docs or take a look at the vagrant guide


Useful vagrant commands

Connect to your VM via ssh

$ vagrant ssh 

(Re-)provision your environment

$ vagrant provision

Delete your VM

$ vagrant destroy

Status of your VM

$ vagrant status

Connecting your IDE

The vagrant box fully encapsulates the whole platform with all its sources. So the development process works just like with any other foreign system. The machine supports SCP with the following credentials.

Key Setting
Host 192.168.33.10
User vagrant
Password vagrant
Path ~/shopware-dev

shopware-platform-vagrant's People

Contributors

flohessling avatar mitelg avatar rherwig avatar xndrdev avatar janpietrzyk avatar jlhmn avatar audaki avatar konstantin-sharohin avatar mrdevries avatar nicoanders avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.