Add Nitrous.io quickstart configs and update README

yeouchien 8 years ago
parent
commit
cbeb269f0b
4 changed files with 68 additions and 0 deletions
  1. 2 0
      .dockerignore
  2. 10 0
      README.md
  3. 47 0
      nitrous-post-create.sh
  4. 9 0
      nitrous.json

+ 2 - 0
.dockerignore

@@ -36,3 +36,5 @@ deployment/cookbooks
36 36
 manifest.yml
37 37
 config/unicorn.rb
38 38
 db/schema.rb
39
+nitrous-post-create.sh
40
+nitrous.json

+ 10 - 0
README.md

@@ -80,6 +80,16 @@ If you need more detailed instructions, see the [Novice setup guide][novice-setu
80 80
 [wiki]: https://github.com/cantino/huginn/wiki
81 81
 [novice-setup-guide]: https://github.com/cantino/huginn/wiki/Novice-setup-guide
82 82
 
83
+### Nitrous Quickstart
84
+
85
+You can quickly create a free development environment for this Huginn project in the cloud on www.nitrous.io:
86
+
87
+<a href="https://www.nitrous.io/quickstart">
88
+  <img src="https://nitrous-image-icons.s3.amazonaws.com/quickstart.png" alt="Nitrous Quickstart" width=142 height=34>
89
+</a>
90
+
91
+In the IDE, start Huginn via `Run > Start Huginn` and access your site via `Preview > 3000`.
92
+
83 93
 ### Develop
84 94
 
85 95
 All agents have specs! And there's also acceptance tests that simulate running Huginn in a headless browser. 

+ 47 - 0
nitrous-post-create.sh

@@ -0,0 +1,47 @@
1
+#!/bin/bash
2
+
3
+rm -rf ~/code/example
4
+
5
+export LANG=en_US.UTF-8
6
+export LANGUAGE=en_US.UTF-8
7
+export LC_ALL=en_US.UTF-8
8
+export DEBIAN_FRONTEND=noninteractive
9
+
10
+sudo apt-get update
11
+sudo -E apt-get -q -y install mysql-server
12
+sudo apt-get -y install libmysqlclient-dev pwgen
13
+sudo apt-get clean
14
+
15
+cp .env.example .env
16
+
17
+MYSQL_PASSWORD=`pwgen -1`
18
+mysql -u root -e "CREATE USER 'huginn'@'localhost' IDENTIFIED BY '$MYSQL_PASSWORD';"
19
+mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'huginn'@'localhost';"
20
+sed -i 's/DATABASE_USERNAME=.*/DATABASE_USERNAME=huginn/g' .env
21
+sed -i "s/DATABASE_PASSWORD=.*/DATABASE_PASSWORD=\"$MYSQL_PASSWORD\"/g" .env
22
+
23
+APP_SECRET_TOKEN=`pwgen 24 -1`
24
+sed -i "s/APP_SECRET_TOKEN=.*/APP_SECRET_TOKEN=$APP_SECRET_TOKEN/g" .env
25
+
26
+npm install -g phantomjs-prebuilt
27
+gem install bundler
28
+bundle install
29
+bundle exec rake db:create
30
+bundle exec rake db:migrate
31
+bundle exec rake db:seed
32
+
33
+cat >> ~/code/huginn/README.nitrous.md <<EOT
34
+# Setup
35
+
36
+Welcome to your Huginn project on Nitrous.
37
+
38
+## Running the development server:
39
+
40
+In the [Nitrous IDE](https://community.nitrous.io/docs/ide-overview), start Huginn via "Run > Start Huginn" and wait for 30 seconds for the server to be started.
41
+
42
+Now you've got a development server running and can see the output in the Nitrous terminal window. You can open up a new shell or utilize [tmux](https://community.nitrous.io/docs/tmux) to open new shells to run other commands.
43
+
44
+## Preview the app
45
+
46
+In the Nitrous IDE, open the "Preview" menu and click "Port 3000".
47
+EOT

+ 9 - 0
nitrous.json

@@ -0,0 +1,9 @@
1
+{
2
+  "template": "rails",
3
+  "ports": [3000],
4
+  "name": "Huginn",
5
+  "description": "Build agents that monitor and act on your behalf. Your agents are standing by!",
6
+  "scripts": {
7
+    "Start Huginn": "cd ~/code/huginn && bundle exec foreman start"
8
+  }
9
+}