bob_the_builder 0.0.0 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1,117 @@
1
+ # Bob The Builder
2
+
3
+ Bob The Builder is easy building and deploying applications.
4
+
5
+ ![Bob The Builder](http://i.imgur.com/C7GBG.jpg "Bob The Builder")
6
+
7
+ ## Installation
8
+
9
+ This can be achieved by easily using RubyGems
10
+
11
+ $ gem install bob_the_builder
12
+
13
+ ## What to do after installation
14
+
15
+ Once it is installed, you can configure any project by running its handy tool, called ```bobify```. It receives only one argument, and it is the location of the application's folder. If you are inside it, you just need to do:
16
+
17
+ $ bobify .
18
+
19
+ This will generate a set of files, including a sample configuration YAML, and a couple sample scripts.
20
+
21
+ ## Configuration
22
+
23
+ There should be a file called ```script/config.yml```. The main idea is that it contains a set of variables, that can be overridden per environment in different ways. The precedence order is:
24
+
25
+ 1. Environment variables
26
+ 2. Git configuration variables
27
+ 3. YAML variable per environment
28
+ 4. YAML global variable
29
+
30
+ Configuration variables defined in the YAML can call to another variable. There's a set of needed variables, here's the basic set:
31
+
32
+ ```yaml
33
+ output: builds/my_output_v{{version}}_{{date}}.o
34
+ build_command: {{gcc}} {{input}} -o {{output}}
35
+ changes_regexp: "(Bug Fix|Improvement)"
36
+ gcc: /usr/bin/env gcc
37
+ input: src/input.c
38
+
39
+ github:
40
+ username: my_github_username
41
+ password: mypassword
42
+ repo: ivanvc/bob
43
+
44
+ production:
45
+ server: ivanvc@ec-12.compute1.amazonaws.com:/var/www/prod
46
+ output: builds/output_prod.o
47
+ daily_build:
48
+ server: ivanvc@ec-12.compute1.amazonaws.com:/var/www/daily
49
+ development:
50
+ server: ivanvc@localhost:/Users/ivan/Sites/project
51
+ output: builds/output.o
52
+ ```
53
+
54
+ Here are a couple of things demonstrated, a variable can request another one using a [mustache](http://mustache.github.com/) similar syntax. There are two **Magic Variables** ```date``` and ```version```. The first one is the date when the command was called, ehmmm, Today... And version is the one read from the latest git tag.
55
+
56
+ Also, the variables inside each environment (development, daily_build and production) override the ones at the root.
57
+
58
+ If you specify GitHub's credentials, you will be able to upload the latest version to a GitHub repo, directly to the downloads section.
59
+
60
+ ## Usage
61
+
62
+ In order to use Bob, you need to instantiate it, and do a build, deploy, version bump, etc. Here's a sample script:
63
+
64
+ ```ruby
65
+ #!/usr/bin/env ruby
66
+ require 'rubygems'
67
+ require 'bob_the_builder'
68
+ include BobTheBuilder
69
+
70
+ # The first argument is the environment, matches the one from the config
71
+ # file. It also takes two optional arguments, the directory where the git
72
+ # repo is, defaults to '.'. The last one is the branch that bob should use
73
+ # defaults to 'master'.
74
+ builder = Bob.new('daily_build')
75
+
76
+ # We don't want the daily build if there are no changes, or if the source
77
+ # doesn't compiles.
78
+ if builder.changes_since_last_version? && builder.build
79
+ # Bump the version 'patch', 'minor' or 'major'.
80
+ builder.version_bump! ARGV[0]
81
+ builder.build
82
+ # Deploy to the server, and to GitHub.
83
+ builder.deploy
84
+ builder.deploy 'github'
85
+ end
86
+ ```
87
+
88
+ This is the sample for a daily building script, it can be found in the script folder, and to call it, you just need to do:
89
+
90
+ $ script/daily_build
91
+
92
+ And to do a simple deploy, here's a sample script:
93
+
94
+ ```ruby
95
+ #!/usr/bin/env ruby
96
+ require 'rubygems'
97
+ require 'bob_the_builder'
98
+ include BobTheBuilder
99
+
100
+ # The first argument is the environment, matches the one from the config
101
+ # file. It also takes two optional arguments, the directory where the git
102
+ # repo is, defaults to '.'. The last one is the branch that bob should use
103
+ # defaults to 'master'.
104
+ builder = Bob.new(ARGV[0] || 'development')
105
+ builder.build
106
+ # The deploy option has an optional argument, where this deploy should be
107
+ # done. Defaults to 'server', but can be 'github'.
108
+ builder.deploy
109
+ ```
110
+
111
+ In the latter, it initializes with the passed environment, i.e. ```script/deploy production``` will deploy and build using production settings.
112
+
113
+ As said before, any variable can be overridden using environment variables, let's say: ```OUTPUT=hello.o script/deploy development``` will use hello.o as the output instead of the stated in the configuration file.
114
+
115
+ ## License
116
+
117
+ Copyright (c) 2011 Ivan Valdes (@ivanvc). See LICENSE.txt for further details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.1.0
data/bin/bobify CHANGED
@@ -82,13 +82,13 @@ FILE
82
82
  #!/usr/bin/env ruby
83
83
  require 'rubygems'
84
84
  require 'bob_the_builder'
85
+ include BobTheBuilder
85
86
 
86
87
  # The first argument is the environment, matches the one from the config
87
88
  # file. It also takes two optional arguments, the directory where the git
88
89
  # repo is, defaults to '.'. The last one is the branch that bob should use
89
90
  # defaults to 'master'.
90
91
  builder = Bob.new('daily_build')
91
- include BobTheBuilder
92
92
 
93
93
  # We don't want the daily build if there are no changes, or if the source
94
94
  # doesn't compiles.
@@ -0,0 +1,91 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{bob_the_builder}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = [%q{Ivan Valdes (@ivanvc)}]
12
+ s.date = %q{2011-11-04}
13
+ s.description = %q{longer description of your gem}
14
+ s.email = %q{ivan@ooyala.com}
15
+ s.executables = [%q{bobify}]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE.txt",
18
+ "README.md"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ ".rspec",
23
+ "Gemfile",
24
+ "Gemfile.lock",
25
+ "LICENSE.txt",
26
+ "README.md",
27
+ "Rakefile",
28
+ "VERSION",
29
+ "bin/bobify",
30
+ "bob_the_builder.gemspec",
31
+ "lib/bob_the_builder.rb",
32
+ "lib/bob_the_builder/bob.rb",
33
+ "lib/bob_the_builder/git_hub_uploader.rb",
34
+ "spec/bob_the_builder_spec.rb",
35
+ "spec/spec_helper.rb"
36
+ ]
37
+ s.homepage = %q{http://github.com/ivanvc/bob_the_builder}
38
+ s.licenses = [%q{MIT}]
39
+ s.require_paths = [%q{lib}]
40
+ s.rubygems_version = %q{1.8.5}
41
+ s.summary = %q{one-line summary of your gem}
42
+
43
+ if s.respond_to? :specification_version then
44
+ s.specification_version = 3
45
+
46
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
47
+ s.add_runtime_dependency(%q<rest-client>, [">= 0"])
48
+ s.add_runtime_dependency(%q<json>, [">= 0"])
49
+ s.add_runtime_dependency(%q<git>, [">= 0"])
50
+ s.add_runtime_dependency(%q<zipruby>, [">= 0"])
51
+ s.add_runtime_dependency(%q<orderedhash>, [">= 0"])
52
+ s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
53
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
54
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
55
+ s.add_development_dependency(%q<rcov>, [">= 0"])
56
+ s.add_runtime_dependency(%q<rest-client>, [">= 0"])
57
+ s.add_runtime_dependency(%q<json>, [">= 0"])
58
+ s.add_runtime_dependency(%q<git>, [">= 0"])
59
+ s.add_runtime_dependency(%q<zipruby>, [">= 0"])
60
+ else
61
+ s.add_dependency(%q<rest-client>, [">= 0"])
62
+ s.add_dependency(%q<json>, [">= 0"])
63
+ s.add_dependency(%q<git>, [">= 0"])
64
+ s.add_dependency(%q<zipruby>, [">= 0"])
65
+ s.add_dependency(%q<orderedhash>, [">= 0"])
66
+ s.add_dependency(%q<rspec>, ["~> 2.3.0"])
67
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
68
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
69
+ s.add_dependency(%q<rcov>, [">= 0"])
70
+ s.add_dependency(%q<rest-client>, [">= 0"])
71
+ s.add_dependency(%q<json>, [">= 0"])
72
+ s.add_dependency(%q<git>, [">= 0"])
73
+ s.add_dependency(%q<zipruby>, [">= 0"])
74
+ end
75
+ else
76
+ s.add_dependency(%q<rest-client>, [">= 0"])
77
+ s.add_dependency(%q<json>, [">= 0"])
78
+ s.add_dependency(%q<git>, [">= 0"])
79
+ s.add_dependency(%q<zipruby>, [">= 0"])
80
+ s.add_dependency(%q<orderedhash>, [">= 0"])
81
+ s.add_dependency(%q<rspec>, ["~> 2.3.0"])
82
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
83
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
84
+ s.add_dependency(%q<rcov>, [">= 0"])
85
+ s.add_dependency(%q<rest-client>, [">= 0"])
86
+ s.add_dependency(%q<json>, [">= 0"])
87
+ s.add_dependency(%q<git>, [">= 0"])
88
+ s.add_dependency(%q<zipruby>, [">= 0"])
89
+ end
90
+ end
91
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bob_the_builder
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
+ - 1
8
9
  - 0
9
- - 0
10
- version: 0.0.0
10
+ version: 0.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ivan Valdes (@ivanvc)
@@ -213,17 +213,18 @@ extensions: []
213
213
 
214
214
  extra_rdoc_files:
215
215
  - LICENSE.txt
216
- - README.rdoc
216
+ - README.md
217
217
  files:
218
218
  - .document
219
219
  - .rspec
220
220
  - Gemfile
221
221
  - Gemfile.lock
222
222
  - LICENSE.txt
223
- - README.rdoc
223
+ - README.md
224
224
  - Rakefile
225
225
  - VERSION
226
226
  - bin/bobify
227
+ - bob_the_builder.gemspec
227
228
  - lib/bob_the_builder.rb
228
229
  - lib/bob_the_builder/bob.rb
229
230
  - lib/bob_the_builder/git_hub_uploader.rb
data/README.rdoc DELETED
@@ -1,19 +0,0 @@
1
- = bob_the_builder
2
-
3
- Description goes here.
4
-
5
- == Contributing to bob_the_builder
6
-
7
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
- * Fork the project
10
- * Start a feature/bugfix branch
11
- * Commit and push until you are happy with your contribution
12
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
-
15
- == Copyright
16
-
17
- Copyright (c) 2011 Ivan Valdes (@ivanvc). See LICENSE.txt for
18
- further details.
19
-