Skip to content
This repository has been archived by the owner on Sep 4, 2018. It is now read-only.

Commit

Permalink
Merge pull request #204 from smt116/documentation-for-deploying-spree…
Browse files Browse the repository at this point in the history
…-on-shelly-cloud

Added instructions for deploying Spree on Shelly Cloud.
  • Loading branch information
JDutil committed Jul 22, 2014
2 parents 4eaeb05 + c4bf8ed commit 78f3b1e
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
103 changes: 103 additions & 0 deletions content/developer/deployment/shelly-cloud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
title: "Deploying to Shelly Cloud"
section: deployment
---

## Overview

This guide will show you how to deploy the Spree Commerce to
[Shelly Cloud](https://shellycloud.com/). Before we can start
you need to [create an account](https://shellycloud.com/sign_up).
Shelly Cloud is a git-based cloud hosting, so make sure that
your application is under Git version control system.

## Requirements

First you need to install client tool and login to your account

$ gem install shelly
$ shelly login

This procedure will upload your SSH public key.

To fill up application requirements you need to just add one gem into
your `Gemfile`

gem 'rails', '4.0.2'
+gem 'shelly-dependencies'

`shelly-dependencies` gem includes `thin` and `rake` gems. It will
also configure your application to serve static assets and compile
assets on request.

## Creating new cloud

Create new cloud for your application by running `shelly add`.
Just remember to choose PostgreSQL as a database engine.

As you can see the [Cloudfile](https://shellycloud.com/documentation/cloudfile)
appeared. It defines your cloud structure. Now you have to add it
to your git repository and push to `shelly` remote:

$ git add Cloudfile
$ git commit -m "Added Cloudfile for Shelly Cloud"
$ git push shelly master

***
There is no need to configure PostgreSQL credentials, because
Shelly Cloud generates it by default. More information can be
found in [documentation](https://shellycloud.com/documentation/managing_databases).
***

## Importing sample Spree data

You can load sample Spree data by running

$ shelly rake 'spree_sample:load'

or just

$ shelly rake 'db:seed'

for loading basic seeds.

***
Shelly Cloud will run `db:setup` task if there is no `db/schema.rb`
file. During the seed task (which is a part of setup), Spree
asks for user login and password. Shelly Cloud is non interactive, so you
need to set `AUTO_ACCEPT` flag as an environment variable. You can set it
using [dotenv](https://shellycloud.com/documentation/environment_variables#dotenv)
gem.
***

## Storing files

Shelly Cloud provides
[local file storage](https://shellycloud.com/documentation/storing_files)
which is shared between all virtual servers.
The only thing that you have to do is to create
`config/deploy/shelly/before_restart`
[hook](https://shellycloud.com/documentation/deployment_hooks) with the
following content:

set -e

mkdir -p disk/spree
ln -s ../disk/spree public/spree

## Pushing to Shelly Cloud

Shelly Cloud is a git-based cloud hosting, so all you need to do is to run

$ git push shelly master

for push and deploy your application. Now you can start your cloud by
running

$ shelly start

***
You do not have to run migrations manually. Shelly Cloud runs
`rake db:migrate` task on each deployment.
***
1 change: 1 addition & 0 deletions layouts/developer/_sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ <h3>
<ul class="js-guides">
<li><i class="icon-dot"></i><%= link_to "Ninefold", '/developer/ninefold' %> <div class="toc"></div> </li>
<li><i class="icon-dot"></i><%= link_to "Heroku", '/developer/heroku' %> <div class="toc"></div> </li>
<li><i class="icon-dot"></i><%= link_to "Shelly Cloud", '/developer/shelly-cloud' %> <div class="toc"></div> </li>
<li><i class="icon-dot"></i><%= link_to "Ansible Ubuntu Deployment", '/developer/ansible-ubuntu' %> <div class="toc"></div> </li>
<li><i class="icon-dot"></i><%= link_to "Manual Ubuntu Deployment", '/developer/manual-ubuntu' %> <div class="toc"></div> </li>
<li><i class="icon-dot"></i><%= link_to "Deployment Options", '/developer/deployment_options' %> <div class="toc"></div> </li>
Expand Down

0 comments on commit 78f3b1e

Please sign in to comment.