Skip to content

Deployment

Cătălin Stan edited this page Mar 13, 2016 · 2 revisions

Criollo is meant to run on OS X. I have no plans for the near future to make it run on Linux. That being said, there seems to be a sustained effort from the community to port OS X APIs to Linux. As this becomes mature I will look into it.

Deploying to the Server

The final product will always be an application bundle, which can be simply deployed to the target server as any other application would be.

A more elegant solution would be deploying from source, using a git hook on the target machine. A deployment script is coming.

(to be continued)

Integrating with launchd

Launchd is OS X’s builtin process manager. Wikipedia defines it as

a unified, open-source service management framework for starting, stopping and managing daemons, applications, processes, and scripts. Written and designed by Dave Zarzycki at Apple, it was introduced with Mac OS X Tiger and is licensed under the Apache License.

The only thing that you need to make your Criollo application start and stop on launchd commands is to create a launchd.plist file and place it in /Library/LaunchDaemons/.

Here is an example file for the HelloWorld project described above is this:

io.criollo.HelloWorld.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Disabled</key>
	<false/>
	<key>KeepAlive</key>
	<true/>
	<key>Label</key>
	<string>io.criollo.HelloWorld</string>
	<key>ProgramArguments</key>
	<array>
		<string>/WebApplications/HelloWorld.app/Contents/MacOS/HelloWorld</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
	<key>ServiceDescription</key>
	<string>A simple "Hello World" serving app</string>
	<key>StandardErrorPath</key>
	<string>/var/log/io.criollo.HelloWorld.log</string>
	<key>StandardOutPath</key>
	<string>/var/log/io.criollo.HelloWorld.log</string>
</dict>
</plist>

The example above assumes the app will be deployed at /WebApplications/HelloWorld.app.

Read more about launchd plists in the launchd.plist(5) man page.

Starting and Stopping

You can then start and stop the app using launchctl as follows.

sudo launchctl load /Library/LaunchDaemons/io.criollo.HelloWorld.plist

sudo launchctl unload /Library/LaunchDaemons/io.criollo.HelloWorld.plist

Read more about launchctl in the launchctl(1) man page.

Clone this wiki locally
You can’t perform that action at this time.