Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 121 lines (85 sloc) 3.73 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
Zotonic Commands
================
The zotonic command can run a number of utility commands availble in
zotonic/bin.

OS X Compatibility Problem
--------------------------
If you symlink to zotonic/bin/zotonic, then you will need GNU coreutils on
OS X or `readlink -e` will fail. I could not find a clean work-around for
this with built-in OS X CLI tools. This is needed to traverse deeply
symlinked commands.


zotonic addsite [options] <site_name>
-------------------------------------
Create a new site with [site_name] as its name. This new site will be
based on a so-called skeleton site. Currently there are two skeletons:
'blog' and 'empty'. "blog" is the default.

"zotonic addsite -s empty yoursite" creates a new site called
"yoursite" based on the skeleton called "empty". Full usage:

zotonic-addsite [options] <site_name>

  -s <skel> Skeleton site ('blog' or 'empty'; default: blog)

  -h <host> Database host (default: 127.0.0.1)
  -p <port> Database port (default: 5432)
  -u <user> Database user (default: zotonic)
  -P <pass> Database password (default: zotonic)
  -d <name> Database name (default: zotonic)
  -n <schema> Database schema (default: public)
  -a <pass> Admin password (default: admin)


zotonic copysite [site_name] [source_server]
--------------------------------------------
Copy [site_name] and its database content from the [source_server] over SSH
and load its content into the filesystem and database of the local machine.

You will need to have created the database zotonic_[site_name] for this to
work.

Warning: This command will reset the content of the database to the content
retrieved from the [source_server]. It does, however, generate and output
a restore file in case this was run by accident and explains how to recover.


zotonic createdb [site_name]
----------------------------
Create a database called zotonic_[site_name] with the basic setup in place to
host a Zotonic datastore.

This script will likely need to be run as postgres unless zotonic has been
granted CREATEDB in postgres as follows:

ALTER ROLE zotonic WITH CREATEDB


zotonic debug
-------------
Launch the Zotonic server interactively and get an EShell on the
running instance. There is a "start.sh" command in the root folder
which is a shortcut for this command.


zotonic restart
---------------
Restart the background Zotonic server instance.


zotonic shell
-------------
Connect to the background Zotonic server instance and provide and EShell.


zotonic sitedir [site_name]
---------------------------
Get the absolute path for a site based on [site_name]


zotonic snapshot [site_name]
----------------------------
Take a version control snapshot of [site_name] including its database content.

This works differently from mod_backup in that it consistently uses the same
filename for the SQL backup to make revision-based full site rollbacks
possible.


zotonic start
-------------
Start the background Zotonic server instance.


zotonic stop
------------
Stop the background Zotonic server instance.


zotonic update
--------------
Update the server. Compiles and loads any new code, flushes caches and
rescans all modules.


zotonic compilefile [files...]
------------------------------

Compiles a single file within the zotonic folder. This runs very fast
and works very well on a save-hook of your text editor. In Emacs, it
would be called like this:

(add-hook 'erlang-mode-hook
          '(lambda ()
             (add-hook 'after-save-hook '
                       (lambda ()
                         (call-process "/path/to/your/bin/zotonic" nil "*scratch*" nil "compilefile" buffer-file-name)
                         )
                       )
             ))
Something went wrong with that request. Please try again.