deep_thought 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +22 -0
- data/README.md +184 -0
- data/Rakefile +50 -0
- data/config.ru +5 -0
- data/db/migrate/20130414012805_create_projects.rb +15 -0
- data/db/migrate/20130426165010_create_states.rb +14 -0
- data/db/migrate/20130501003758_create_users.rb +14 -0
- data/db/migrate/20130508001711_add_api_key_to_users.rb +9 -0
- data/db/migrate/20130509014935_create_deploys.rb +27 -0
- data/db/migrate/20130514062148_create_delayed_jobs.rb +21 -0
- data/db/migrate/20130516042149_change_delayed_job_last_error_to_text.rb +9 -0
- data/db/migrate/20130517010210_add_ci_to_projects.rb +9 -0
- data/db/migrate/20130525001332_add_notification_url_to_users.rb +9 -0
- data/db/migrate/20131127022704_remove_deploy_type_and_ci_from_projects.rb +11 -0
- data/db/schema.rb +72 -0
- data/deep_thought.gemspec +45 -0
- data/lib/deep_thought.rb +62 -0
- data/lib/deep_thought/api.rb +156 -0
- data/lib/deep_thought/app.rb +342 -0
- data/lib/deep_thought/ci_service.rb +39 -0
- data/lib/deep_thought/ci_service/janky.rb +34 -0
- data/lib/deep_thought/deployer.rb +180 -0
- data/lib/deep_thought/deployer/deployer.rb +17 -0
- data/lib/deep_thought/deployer/shell.rb +45 -0
- data/lib/deep_thought/git.rb +76 -0
- data/lib/deep_thought/models/deploy.rb +27 -0
- data/lib/deep_thought/models/project.rb +32 -0
- data/lib/deep_thought/models/state.rb +6 -0
- data/lib/deep_thought/models/user.rb +45 -0
- data/lib/deep_thought/notifier.rb +13 -0
- data/lib/deep_thought/public/assets/javascripts/jquery.min.js +6 -0
- data/lib/deep_thought/public/assets/javascripts/main.js +36 -0
- data/lib/deep_thought/public/assets/stylesheets/main.css +438 -0
- data/lib/deep_thought/public/robots.txt +2 -0
- data/lib/deep_thought/scaler.rb +35 -0
- data/lib/deep_thought/tasks.rb +65 -0
- data/lib/deep_thought/version.rb +3 -0
- data/lib/deep_thought/views/history/index.haml +4 -0
- data/lib/deep_thought/views/history/show.haml +68 -0
- data/lib/deep_thought/views/layouts/layout.haml +32 -0
- data/lib/deep_thought/views/projects/edit.haml +15 -0
- data/lib/deep_thought/views/projects/index.haml +7 -0
- data/lib/deep_thought/views/projects/new.haml +8 -0
- data/lib/deep_thought/views/projects/show.haml +25 -0
- data/lib/deep_thought/views/sessions/login.haml +8 -0
- data/lib/deep_thought/views/users/index.haml +7 -0
- data/lib/deep_thought/views/users/new.haml +12 -0
- data/lib/deep_thought/views/users/show.haml +38 -0
- data/script/bootstrap +3 -0
- data/script/console +7 -0
- data/script/server +7 -0
- data/script/test +3 -0
- data/test/deep_thought_api_test.rb +114 -0
- data/test/deep_thought_app_test.rb +315 -0
- data/test/deep_thought_ci_service_test.rb +44 -0
- data/test/deep_thought_deployer_test.rb +72 -0
- data/test/deep_thought_git_test.rb +62 -0
- data/test/deep_thought_janky_test.rb +42 -0
- data/test/deep_thought_notifier_test.rb +35 -0
- data/test/deep_thought_project_test.rb +34 -0
- data/test/deep_thought_shell_test.rb +38 -0
- data/test/fixtures/project-test/HEAD +1 -0
- data/test/fixtures/project-test/config +8 -0
- data/test/fixtures/project-test/description +1 -0
- data/test/fixtures/project-test/hooks/applypatch-msg.sample +15 -0
- data/test/fixtures/project-test/hooks/commit-msg.sample +24 -0
- data/test/fixtures/project-test/hooks/post-update.sample +8 -0
- data/test/fixtures/project-test/hooks/pre-applypatch.sample +14 -0
- data/test/fixtures/project-test/hooks/pre-commit.sample +49 -0
- data/test/fixtures/project-test/hooks/pre-push.sample +54 -0
- data/test/fixtures/project-test/hooks/pre-rebase.sample +169 -0
- data/test/fixtures/project-test/hooks/prepare-commit-msg.sample +36 -0
- data/test/fixtures/project-test/hooks/update.sample +128 -0
- data/test/fixtures/project-test/info/exclude +6 -0
- data/test/fixtures/project-test/objects/13/8b8baba400e64fc384d468e80f10cf707e38d7 +1 -0
- data/test/fixtures/project-test/objects/6b/8fb16e1675767742afc70ac2ce038da46461f8 +0 -0
- data/test/fixtures/project-test/objects/7f/fc496d150b8a0015e3a16be8bacd47daed1a1c +0 -0
- data/test/fixtures/project-test/objects/8f/8606174a2aa11545d119fe3c4d6840fe0c4825 +0 -0
- data/test/fixtures/project-test/objects/9c/362942288a8ff6dc1addf7c5199bd9837e09de +0 -0
- data/test/fixtures/project-test/objects/b5/f7341de6145d3f8b95877cd2675d798fd172f1 +0 -0
- data/test/fixtures/project-test/objects/d1/f1e8664b0326316fb18796ac4ae1171e239cb6 +1 -0
- data/test/fixtures/project-test/objects/e6/d7ad6d61242936a2cd2bb9ae236adf43e59718 +0 -0
- data/test/fixtures/project-test/objects/fa/4cf5ff52462d17b6378a06fae8771c13b654b0 +1 -0
- data/test/fixtures/project-test/objects/fa/dda6bc20afa5cf93196bfb08a4989ee3b75ed7 +0 -0
- data/test/fixtures/project-test/packed-refs +4 -0
- data/test/fixtures/project-test/refs/heads/.gitkeep +0 -0
- data/test/fixtures/project-test/refs/tags/.gitkeep +0 -0
- data/test/test_helper.rb +42 -0
- metadata +462 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a46a75aa7fcacd8d1492652f8c961bc6d256e737
|
4
|
+
data.tar.gz: 73151bb16afadfdb0bb284989a7f17656b477e2a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 74361c6cb41cc55f79f8b1a495bebf040ab4702c774ae2db5a2752f73f33c20f351a743f0a3eccea11fbc83f6031b4c4463aab1432642956f3e92bcf85b654c5
|
7
|
+
data.tar.gz: 00b5faf81cd62a8952da46b1de010ab8fae5eeafaf6221e3340703298a47703943a71fc3deb95c54a25229964c134045bc80139827b1538b18779b08a3cbbc18
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Ian Lollar
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,184 @@
|
|
1
|
+
# DeepThought
|
2
|
+
|
3
|
+
Deploy smart, not hard.
|
4
|
+
|
5
|
+
## See
|
6
|
+
|
7
|
+
Deep Thought takes all of the thought out of deploying.
|
8
|
+
|
9
|
+
Want to prevent deployment conflicts? Deep Thought does that. Want to deploy with Hubot? Deep Thought has you covered. Looking to ensure a build is green before it is deployed? Deep Thought yawns at your puny requests. Want a web interface? Got it. How about an API? Yep. Security? Totally locked down. Deep Thought has your deployments covered.
|
10
|
+
|
11
|
+
Deep Thought was inspired by GitHub's own Hubot+Heaven workflow. Check out [Zach Holman's talk](http://zachholman.com/talk/unsucking-your-teams-development-environment/) to see the original inspiration.
|
12
|
+
|
13
|
+
## Want
|
14
|
+
|
15
|
+
Use [this Gist](https://gist.github.com/redhotvengeance/5746731) to get started:
|
16
|
+
|
17
|
+
git clone git://gist.github.com/5746731 deep_thought
|
18
|
+
|
19
|
+
## Use
|
20
|
+
|
21
|
+
### Setup
|
22
|
+
|
23
|
+
Deep Thought is designed to be deployed to Heroku:
|
24
|
+
|
25
|
+
heroku apps:create [NAME]
|
26
|
+
heroku config:set RACK_ENV=production
|
27
|
+
|
28
|
+
Deep Thought will, by default, route all requests through https for security. It is *strongly* recommended to set a secret token to be used for session cookies:
|
29
|
+
|
30
|
+
uuid=`UUIDGEN`
|
31
|
+
secret=$(echo -ne "\0$uuid" | base64 | sed -e "s/=//g")
|
32
|
+
heroku config:set SESSION_SECRET="$secret"
|
33
|
+
|
34
|
+
Deep Thought requires a PostgreSQL database. Add one to your Heroku app:
|
35
|
+
|
36
|
+
heroku addons:add heroku-postgresql
|
37
|
+
|
38
|
+
Now go ahead and push Deep Thought to Heroku:
|
39
|
+
|
40
|
+
git push heroku master
|
41
|
+
|
42
|
+
To start using Deep Thought, you'll need to create an initial user. Fortunately, Deep Thought makes this easy to do:
|
43
|
+
|
44
|
+
heroku run rake create_user[user@email.com,secretpassword]
|
45
|
+
|
46
|
+
Now head over to your Deep Thought instance and login:
|
47
|
+
|
48
|
+
open https://<app-name>.herokuapp.com
|
49
|
+
|
50
|
+
Deep Thought requires the use of a background worker for deployments. Normally, on Heroku, this could become costly, as it would require spinning up a second (worker) dyno. However, Deep Thought includes the ability to intelligently spin this dyno up and down to help minimize (or even eliminate) costs. To enable this functionality, two environment variables need to be set:
|
51
|
+
|
52
|
+
HEROKU_APP=<app-name>
|
53
|
+
HEROKU_API_KEY=<your-heroku-api-key>
|
54
|
+
|
55
|
+
### Add a project
|
56
|
+
|
57
|
+
Once logged in, click the `+ add project` button on the `projects` page. Enter a unique project name and the remote Git repository url for the project. Click `create project`, and now your project is set up and ready to deploy.
|
58
|
+
|
59
|
+
### .deepthought.yml
|
60
|
+
|
61
|
+
Deep Thought expects to find a `.deepthought.yml` file in the root of all projects. This file serves as a config for the project - it tells Deep Thought the information it needs to know to deploy the project.
|
62
|
+
|
63
|
+
Here's an example `.deepthought.yml`:
|
64
|
+
|
65
|
+
deploy_type: shell
|
66
|
+
ci:
|
67
|
+
enabled: true
|
68
|
+
name: project-name
|
69
|
+
root: script/deploy
|
70
|
+
|
71
|
+
`deploy_type` should be the key name for the deployer (defaults to `shell`). `ci` is group for continuous integration setting - `enabled` tells Deep Thought to check the CI server for green builds and `name` is the name of the project on the CI server. `root` is a shell deployer-specific setting - it tells Deep Thought where the deploy shell script it located in the project (defaults to `script/deploy`).
|
72
|
+
|
73
|
+
Make sure to add any dependencies needed to deploy your project to your Gemfile.
|
74
|
+
|
75
|
+
### Add a key
|
76
|
+
|
77
|
+
It is likely that your project repos are private, and even if they are not, you still probably need to authenticate via ssh key to access servers for deployment. If you need to add an ssh key to Deep Thought hosted on Heroku, then you can use the Deep Thought buildpack:
|
78
|
+
|
79
|
+
heroku config:set BUILDPACK_URL=https://github.com/redhotvengeance/heroku-buildpack-deep-thought
|
80
|
+
ssh_key=`cat ~/.ssh/your_ssh_key`
|
81
|
+
heroku config:set SSH_KEY="$ssh_key"
|
82
|
+
heroku config:set SSH_HOST=github.com
|
83
|
+
|
84
|
+
Keep in mind that the ssh key shouldn't have a password - otherwise Deep Thought won't be able to use it!
|
85
|
+
|
86
|
+
### Deploy
|
87
|
+
|
88
|
+
Click on a project from the homepage. Select the branch to deploy, and optionally define additional parameters:
|
89
|
+
|
90
|
+
- `environment`: Sets the environment to deploy to (`development`, `staging`, `production`, etc - defaults to `development`).
|
91
|
+
- `box`: Sets a specific server to deploy to (passed as an argument to the shell script - `script/deploy development deploy box=prod`).
|
92
|
+
- `action`: Sets a subtask to deploy (for instance, if "config" is added, then Deep Thought would execute `script/deploy development deploy:config`).
|
93
|
+
- `variable`: Sets additional values that can be passed to the deploy (for instance, if set to `force=true`, Deep Thought would execute `script/deploy development deploy force=true`).
|
94
|
+
|
95
|
+
Click `deploy` - now a deployment is underway!
|
96
|
+
|
97
|
+
Deep Thought will let you know once the deployment is finished. If you'd like to see a log of previous deployments, click the `history` button. Clicking on a subsequent deployment will show you the details of that deployment.
|
98
|
+
|
99
|
+
### Continuous integration
|
100
|
+
|
101
|
+
If you use continuous integration, you can have Deep Thought check to make sure a build is green before deploying. By default, Heroku supports interfacing with [Janky](https://github.com/github/janky).
|
102
|
+
|
103
|
+
To enable continuous integration, several environment variables must be set:
|
104
|
+
|
105
|
+
heroku config:set CI_SERVICE=janky
|
106
|
+
heroku config:set CI_SERVICE_ENDPOINT=http://your-janky-server.com
|
107
|
+
heroku config:set CI_SERVICE_USERNAME=janky_username
|
108
|
+
heroku config:set CI_SERVICE_PASSWORD=janky_password
|
109
|
+
|
110
|
+
Now, so long as a project enables continuous integration in its `.deepthought.yml` file, Deep Thought will check the project/branch build status before deploying.
|
111
|
+
|
112
|
+
### API
|
113
|
+
|
114
|
+
To use the API, you must have an API key. To generate a key, go to the `me` page and click `generate new api key`.
|
115
|
+
|
116
|
+
All API requests must have the `Accept` header set to `application/json`. To authenticate, the `Authorization` header should be set to `Token token="<your api key>"`.
|
117
|
+
|
118
|
+
The current API routes are:
|
119
|
+
|
120
|
+
- `GET /deploy/status` - Get the current status of Deep Thought.
|
121
|
+
- `POST /deploy/:app` - Deploy a project. Optionally pass (JSON encoded) `environment`, `box`, `actions` (array), `variables` (key/value object), and `on_behalf_of` (username requesting deploy - useful for bots).
|
122
|
+
- `POST /deploy/setup/:app` - Setup a new project. Required to include (JSON encoded) `repo_url`.
|
123
|
+
|
124
|
+
### Hubot
|
125
|
+
|
126
|
+
Hubot integrates wonderfully with Deep Thought. He communicates via the API, which means he'll need an account with an API generated.
|
127
|
+
|
128
|
+
Once you've setup the Hubot user and have its API key, grab the Deep Thought Hubot script and add it to your Hubot.
|
129
|
+
|
130
|
+
Set the following config variables for your Hubot:
|
131
|
+
|
132
|
+
heroku config:set DEEP_THOUGHT_URL=https://your-deep-thought.herokuapp.com
|
133
|
+
heroku config:set DEEP_THOUGHT_TOKEN=<hubot api key>
|
134
|
+
|
135
|
+
Finally, Deep Thought likes to talk back to Hubot to let him know how deploys are going. Login to the Hubot account on Deep Thought, head to the `me` page, and set the `notification url` to `http://your.hubot.com/notify`.
|
136
|
+
|
137
|
+
To learn more about how to ask Hubot to deploy, check out the Hubot script.
|
138
|
+
|
139
|
+
## Enjoy
|
140
|
+
|
141
|
+
Feel that? Yep - that's your stresses melting away. Look at all this time you have now! Maybe you'll make a sandwich. Or watch a documentary. Perhaps start a cute herb garden.
|
142
|
+
|
143
|
+
## Hack
|
144
|
+
|
145
|
+
Want to hack on Deep Thought?
|
146
|
+
|
147
|
+
Set it up:
|
148
|
+
|
149
|
+
script/bootstrap
|
150
|
+
|
151
|
+
Create an `.env`:
|
152
|
+
|
153
|
+
echo RACK_ENV=development > .env
|
154
|
+
|
155
|
+
Set up the databases (PostgreSQL):
|
156
|
+
|
157
|
+
createuser deep_thought
|
158
|
+
createdb -O deep_thought -E utf8 deep_thought_development
|
159
|
+
createdb -O deep_thought -E utf8 deep_thought_test
|
160
|
+
rake db:migrate
|
161
|
+
|
162
|
+
Start the server:
|
163
|
+
|
164
|
+
script/server
|
165
|
+
|
166
|
+
Open it:
|
167
|
+
|
168
|
+
open http://localhost:4242
|
169
|
+
|
170
|
+
Test it:
|
171
|
+
|
172
|
+
script/test
|
173
|
+
|
174
|
+
## Give
|
175
|
+
|
176
|
+
Want to make Deep Thought even deeper and more thoughtier? Contribute!
|
177
|
+
|
178
|
+
1. Fork
|
179
|
+
2. Create
|
180
|
+
3. Code
|
181
|
+
4. Test
|
182
|
+
5. Push
|
183
|
+
6. Submit
|
184
|
+
7. Yay!
|
data/Rakefile
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.expand_path("../lib", __FILE__))
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "active_record"
|
5
|
+
require "fileutils"
|
6
|
+
|
7
|
+
ENV["RACK_ENV"] ||= "development"
|
8
|
+
|
9
|
+
require "deep_thought"
|
10
|
+
|
11
|
+
DeepThought.setup(ENV)
|
12
|
+
|
13
|
+
require "deep_thought/tasks"
|
14
|
+
|
15
|
+
namespace :db do
|
16
|
+
desc 'Output the schema to db/schema.rb'
|
17
|
+
task :schema do
|
18
|
+
ActiveRecord::Schema.verbose = true
|
19
|
+
File.open('db/schema.rb', 'w') do |f|
|
20
|
+
ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, f)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
desc "Create a migration at ./db/migrate/{NAME}"
|
25
|
+
task :create_migration do
|
26
|
+
name = ENV['NAME']
|
27
|
+
abort("No name specified. Use `rake db:create_migration NAME=migration_name`") if !name
|
28
|
+
|
29
|
+
migrations_dir = File.join("db", "migrate")
|
30
|
+
version = ENV["VERSION"] || Time.now.utc.strftime("%Y%m%d%H%M%S")
|
31
|
+
filename = "#{version}_#{name}.rb"
|
32
|
+
migration_name = name.gsub(/_(.)/) { $1.upcase }.gsub(/^(.)/) { $1.upcase }
|
33
|
+
|
34
|
+
FileUtils.mkdir_p(migrations_dir)
|
35
|
+
|
36
|
+
open(File.join(migrations_dir, filename), 'w') do |f|
|
37
|
+
f << (<<-EOS).gsub(" ", "")
|
38
|
+
class #{migration_name} < ActiveRecord::Migration
|
39
|
+
def up
|
40
|
+
end
|
41
|
+
|
42
|
+
def down
|
43
|
+
end
|
44
|
+
end
|
45
|
+
EOS
|
46
|
+
end
|
47
|
+
|
48
|
+
puts "New migration created at #{migrations_dir}/#{filename}"
|
49
|
+
end
|
50
|
+
end
|
data/config.ru
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
class CreateDeploys < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :deploys do |t|
|
4
|
+
t.text :actions
|
5
|
+
t.string :branch
|
6
|
+
t.string :environment
|
7
|
+
t.string :box
|
8
|
+
t.text :variables
|
9
|
+
t.string :commit
|
10
|
+
t.datetime :started_at
|
11
|
+
t.datetime :finished_at
|
12
|
+
t.boolean :in_progress, :default => false
|
13
|
+
t.boolean :was_successful
|
14
|
+
t.text :log
|
15
|
+
t.string :via
|
16
|
+
t.string :on_behalf_of
|
17
|
+
t.references :project
|
18
|
+
t.references :user
|
19
|
+
|
20
|
+
t.timestamps
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def down
|
25
|
+
drop_table :deploys
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class CreateDelayedJobs < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :delayed_jobs do |t|
|
4
|
+
t.integer :priority, :default => 0
|
5
|
+
t.integer :attempts, :default => 0
|
6
|
+
t.text :handler
|
7
|
+
t.string :last_error
|
8
|
+
t.datetime :run_at
|
9
|
+
t.datetime :locked_at
|
10
|
+
t.datetime :failed_at
|
11
|
+
t.string :locked_by
|
12
|
+
t.string :queue
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def down
|
19
|
+
drop_table :delayed_jobs
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class RemoveDeployTypeAndCiFromProjects < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
remove_column :projects, :ci
|
4
|
+
remove_column :projects, :deploy_type
|
5
|
+
end
|
6
|
+
|
7
|
+
def down
|
8
|
+
add_column :projects, :ci, :string
|
9
|
+
add_column :projects, :deploy_type, :string
|
10
|
+
end
|
11
|
+
end
|
data/db/schema.rb
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
# This file is auto-generated from the current state of the database. Instead
|
2
|
+
# of editing this file, please use the migrations feature of Active Record to
|
3
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
+
#
|
5
|
+
# Note that this schema.rb definition is the authoritative source for your
|
6
|
+
# database schema. If you need to create the application database on another
|
7
|
+
# system, you should be using db:schema:load, not running all the migrations
|
8
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
9
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
10
|
+
#
|
11
|
+
# It's strongly recommended to check this file into your version control system.
|
12
|
+
|
13
|
+
ActiveRecord::Schema.define(:version => 20131127022704) do
|
14
|
+
|
15
|
+
create_table "delayed_jobs", :force => true do |t|
|
16
|
+
t.integer "priority", :default => 0
|
17
|
+
t.integer "attempts", :default => 0
|
18
|
+
t.text "handler"
|
19
|
+
t.text "last_error"
|
20
|
+
t.datetime "run_at"
|
21
|
+
t.datetime "locked_at"
|
22
|
+
t.datetime "failed_at"
|
23
|
+
t.string "locked_by"
|
24
|
+
t.string "queue"
|
25
|
+
t.datetime "created_at", :null => false
|
26
|
+
t.datetime "updated_at", :null => false
|
27
|
+
end
|
28
|
+
|
29
|
+
create_table "deploys", :force => true do |t|
|
30
|
+
t.text "actions"
|
31
|
+
t.string "branch"
|
32
|
+
t.string "environment"
|
33
|
+
t.string "box"
|
34
|
+
t.text "variables"
|
35
|
+
t.string "commit"
|
36
|
+
t.datetime "started_at"
|
37
|
+
t.datetime "finished_at"
|
38
|
+
t.boolean "in_progress", :default => false
|
39
|
+
t.boolean "was_successful"
|
40
|
+
t.text "log"
|
41
|
+
t.string "via"
|
42
|
+
t.string "on_behalf_of"
|
43
|
+
t.integer "project_id"
|
44
|
+
t.integer "user_id"
|
45
|
+
t.datetime "created_at", :null => false
|
46
|
+
t.datetime "updated_at", :null => false
|
47
|
+
end
|
48
|
+
|
49
|
+
create_table "projects", :force => true do |t|
|
50
|
+
t.string "name"
|
51
|
+
t.string "repo_url"
|
52
|
+
t.datetime "created_at", :null => false
|
53
|
+
t.datetime "updated_at", :null => false
|
54
|
+
end
|
55
|
+
|
56
|
+
create_table "states", :force => true do |t|
|
57
|
+
t.string "name"
|
58
|
+
t.string "state"
|
59
|
+
t.datetime "created_at", :null => false
|
60
|
+
t.datetime "updated_at", :null => false
|
61
|
+
end
|
62
|
+
|
63
|
+
create_table "users", :force => true do |t|
|
64
|
+
t.string "email"
|
65
|
+
t.string "password_digest"
|
66
|
+
t.datetime "created_at", :null => false
|
67
|
+
t.datetime "updated_at", :null => false
|
68
|
+
t.string "api_key"
|
69
|
+
t.string "notification_url"
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|