This is the Ginger Zotonic edition. This repository contains:
Clone this repository and install Docker.
You can run Ginger in three ways:
To run Ginger completely in Docker containers, open a terminal and enter:
$ make up
To open a Zotonic shell:
$ make shell
To run Gulp in the Ginger directory:
$ make gulp site=your_site_name
To run the tests for a module, e.g. mod_ginger_collection:
$ docker-compose run zotonic bin/zotonic runtests mod_ginger_collection
If you want to run tests repeatedly, it may be easier to open a shell in a clean Zotonic container:
$ make prompt
and then make and run the tests:
$ make && bin/zotonic runtests mod_ginger_collection
For more, see the Docker doc chapter.
Due to limitations in Docker for Mac, file synchronization performance suffers when you have large amounts of files (i.e. many sites with node_modules/ directories).
By running Zotonic directly on your host (outside Docker) we circumvent this limitation. Another advantage is that you can directly make changes in Zotonic source code, too.
All other services (PostgreSQL, Elasticsearch, Kibana) still run in containers.
First, install Zotonic’s dependencies, including Erlang:
$ brew install erlang@21 fswatch imagemagick
$ brew link erlang@21 --force
Then clone both Ginger and Zotonic:
$ git clone https://github.com/driebit/ginger.git
$ git clone https://github.com/zotonic/zotonic.git --branch 0.x
Copy Ginger’s configuration file, which includes its dependencies:
$ mkdir -p ~/.zotonic/0
$ cp ginger/config/zotonic.config ~/.zotonic/0/zotonic.config
Point Zotonic to your Ginger sites/ and modules/ directories:
$ mkdir zotonic/user
$ ln -s ../../ginger/sites zotonic/user/sites
$ ln -s ../../ginger/modules zotonic/user/modules
And run Zotonic:
$ cd ginger
$ make start
See Troubleshooting if you get errors.
You have to enter your account’s sudo password to enable port forwarding (from port 80 to 8000).
First the supporting Docker containers are started, then Zotonic is run. Zotonic is then available on http://localhost.
When you quit Zotonic, the Docker containers are stopped as well.
yoursite.docker.test
) to your /etc/hosts
file.sites/
directory.Place custom modules in modules/
(no symlinks needed).
$ git fetch
$ git rebase
Please follow the Driebit guidelines for commit messages. Additionally, prefix your message with the module that your change applies to. For instance:
[admin] Fix login form styling
[foundation] Add carousel template
When you are fixing a bug in the current release branch (as it is published on ginger-test or ginger-acceptatie):
$ git fetch
.$ git branch -a
.$ git checkout release-0.1.0
.$ ssh ginger-test.driebit.net
$ cd /srv/zotonic/
$ z git pull
$ z zotonic shell
$ z:m().
git checkout master
git pull
git merge release-0.#.0 (latest release branch)
git push
When working on (larger) features and fixes that should not be part of the current release:
$ git fetch
.$ git checkout master
.To deploy a site, log in to the proper server (ginger-test.driebit.net
,
ginger-acceptatie.driebit.net
or ginger01.driebit.net
):
$ ssh ginger-test.driebit.net
$ cd /srv/zotonic/sites/[site name]
Check the current Git branch, then pull the latest changes:
$ z git pull
Then compile the changes and flush the site:
$ z zotonic shell
$ z:compile(), z:flush([site name]).
Ginger is released under the Apache 2.0 License. See the included LICENSE file for more information.