bard 0.8.25 → 0.8.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +12 -21
- data/Rakefile +2 -0
- data/VERSION +1 -1
- data/bard.gemspec +2 -2
- data/lib/bard.rb +3 -3
- data/lib/bard/capistrano.rb +5 -19
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -1,15 +1,19 @@
|
|
1
1
|
= BARD gem
|
2
2
|
|
3
|
-
|
3
|
+
This is a collection of tools designed to ease collaboration within BOTandROSE design.
|
4
|
+
It wraps git, capistrano, thor, and rake to make things as simple as:
|
5
|
+
|
6
|
+
bard push
|
7
|
+
bard pull
|
4
8
|
|
5
9
|
=== Requirements
|
6
|
-
git
|
10
|
+
git --version >= 1.6.4
|
11
|
+
rubygems --version >= 1.3.4
|
12
|
+
ruby --version == 1.8.7
|
7
13
|
|
8
14
|
=== Joining Bard
|
9
15
|
|
10
16
|
==== On any platform:
|
11
|
-
- gem install gemcutter
|
12
|
-
- gem tumble
|
13
17
|
- gem install bard
|
14
18
|
|
15
19
|
==== On Linux:
|
@@ -49,12 +53,6 @@
|
|
49
53
|
|
50
54
|
== Todos
|
51
55
|
|
52
|
-
=== Adding Adva to an exising project
|
53
|
-
- Git clone latest tagged release from github
|
54
|
-
- Set up integration branch on staging
|
55
|
-
- Add as submodule
|
56
|
-
- Bard pull will "just work" (tm)
|
57
|
-
|
58
56
|
=== Joining an existing project
|
59
57
|
bard join will probably either do all these steps automatically, or help you do them:
|
60
58
|
This list summarizes the existing steps needed to join a project.
|
@@ -62,7 +60,7 @@
|
|
62
60
|
$> bard join <project-name>
|
63
61
|
|
64
62
|
- Clone the project
|
65
|
-
- (git clone
|
63
|
+
- (git clone git@git.botandrose.com:<project-name>.git)
|
66
64
|
- Init and update submodules
|
67
65
|
|
68
66
|
- Set up local environment:
|
@@ -107,15 +105,8 @@
|
|
107
105
|
$> rake db:create
|
108
106
|
$> rake db:migrate
|
109
107
|
|
110
|
-
-
|
111
|
-
$>
|
112
|
-
Add line to Capfile:
|
113
|
-
load '../cap.tasks'
|
114
|
-
Have cap.tasks.rb in your root work directory (eg. $HOME/work/bard )
|
115
|
-
|
116
|
-
- Seed database from staging
|
117
|
-
$> cap data:pull:staging
|
118
|
-
|
108
|
+
- Seed database from staging or production
|
109
|
+
$> bard data
|
119
110
|
|
120
111
|
=== Note on Patches/Pull Requests
|
121
112
|
|
@@ -125,7 +116,7 @@
|
|
125
116
|
future version unintentionally.
|
126
117
|
* Commit, do not mess with rakefile, version, or history.
|
127
118
|
(if you want to have your own version, that is fine but
|
128
|
-
|
119
|
+
bump version in a commit by itself I can ignore when I pull)
|
129
120
|
* Send me a pull request. Bonus points for topic branches.
|
130
121
|
|
131
122
|
== Copyright
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.26
|
data/bard.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{bard}
|
8
|
-
s.version = "0.8.
|
8
|
+
s.version = "0.8.26"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Micah Geisel", "Nick Hogle"]
|
12
|
-
s.date = %q{2010-03-
|
12
|
+
s.date = %q{2010-03-09}
|
13
13
|
s.default_executable = %q{bard}
|
14
14
|
s.description = %q{This immaculate work of engineering genius allows mere mortals to collaborate with beings of transcendent intelligence like Micah, Michael, and Nick.}
|
15
15
|
s.email = %q{info@botandrose.com}
|
data/lib/bard.rb
CHANGED
@@ -38,10 +38,10 @@ class Bard < Thor
|
|
38
38
|
check_project project_path if project_path
|
39
39
|
end
|
40
40
|
|
41
|
-
desc "data", "copy
|
42
|
-
def data
|
41
|
+
desc "data [ROLE=production]", "copy database and assets down to your local machine from ROLE"
|
42
|
+
def data(role = "production")
|
43
43
|
ensure_sanity!(true)
|
44
|
-
exec "cap data:pull"
|
44
|
+
exec "cap data:pull ROLES=#{role}"
|
45
45
|
end
|
46
46
|
|
47
47
|
method_options %w( verbose -v ) => :boolean
|
data/lib/bard/capistrano.rb
CHANGED
@@ -3,29 +3,15 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
3
3
|
|
4
4
|
namespace "data" do
|
5
5
|
namespace "pull" do
|
6
|
-
desc "pull data
|
7
|
-
task
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
data_pull :staging
|
6
|
+
desc "pull data"
|
7
|
+
task "default" do
|
8
|
+
run "cd #{application} && rake db:dump && gzip -9f db/data.sql"
|
9
|
+
transfer :down, "#{application}/db/data.sql.gz", "db/data.sql.gz"
|
10
|
+
system "gunzip -f db/data.sql.gz && rake db:load"
|
12
11
|
end
|
13
12
|
end
|
14
13
|
end
|
15
14
|
|
16
|
-
def data_pull(env)
|
17
|
-
config = YAML::load(File.open("config/database.yml"))
|
18
|
-
source = config[env.to_s]
|
19
|
-
target = config[ENV['RAILS_ENV'] || "development"]
|
20
|
-
run "cd #{application} && mysqldump -u#{source["username"]} --password=#{source["password"]} '#{source["database"]}' > db/data.sql && gzip -9f db/data.sql"
|
21
|
-
transfer :down, "#{application}/db/data.sql.gz", "db/data.sql.gz"
|
22
|
-
run "cd #{application} && rm db/data.sql.gz"
|
23
|
-
system "gunzip -f db/data.sql.gz"
|
24
|
-
system "echo 'DROP DATABASE `#{target["database"]}`; CREATE DATABASE `#{target["database"]}`;' | mysql -u#{target["username"]} --password=#{target["password"]}"
|
25
|
-
system "mysql -u#{target["username"]} --password=#{target["password"]} '#{target["database"]}' < db/data.sql"
|
26
|
-
# system "rm db/data.sql"
|
27
|
-
end
|
28
|
-
|
29
15
|
desc "push app from staging to production"
|
30
16
|
task :deploy, :roles => :production do
|
31
17
|
system "git push github" if `git remote` =~ /\bgithub\b/
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2010-03-
|
13
|
+
date: 2010-03-09 00:00:00 -08:00
|
14
14
|
default_executable: bard
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|