volley 0.1.9 → 0.1.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.1.9:
4
+ * remove dependency on awesome_print and debug statements. fail me.
5
+ * more docopt fixes
6
+ * handle docopt exit for --version
7
+ * update to use newest docopt version
8
+ * working on getting 'auto' source working
9
+
3
10
  ## v0.1.8:
4
11
  * more docopt fixes
5
12
 
data/README.md CHANGED
@@ -1,24 +1,137 @@
1
1
  # Volley
2
2
 
3
- TODO: Write a gem description
3
+ `Volley` is a Publish/Subscribe deployment mechanism, with some additional functionality allowing
4
+ for scripting of builds. It depends on MCollective as the Publish/Subscribe mechanism.
4
5
 
5
6
  ## Installation
6
7
 
8
+ Volley requires Fog, which requires Nokogiri. Nokogiri requires ruby 1.9.3 and libxml2
9
+ (and possibly libxslt1). To get libxml2 set up, use the following command:
10
+
11
+ ### MacOSX
12
+
13
+ brew install libxml2
14
+
15
+ ### Ubuntu
16
+
17
+ sudo apt-get install libxml2-dev libxslt1-dev
18
+
19
+ now back to your regularly scheduled gem install.
20
+
21
+ ### Gem installation
22
+
7
23
  Add this line to your application's Gemfile:
8
24
 
9
25
  gem 'volley'
10
26
 
11
27
  And then execute:
12
28
 
13
- $ bundle
29
+ bundle
14
30
 
15
31
  Or install it yourself as:
16
32
 
17
- $ gem install volley
33
+ gem install volley
34
+
35
+ By default, volley stores it's data in /opt/volley, you'll need to create this directory and make sure it's world writable.
36
+
37
+ sudo mkdir -p /opt/volley
38
+ sudo chmod 777 /opt/volley
39
+
40
+ ## Configuration
41
+
42
+ Generally, you will provide configuration in either a `/etc/Volleyfile` or `~/.Volleyfile`. It should be either/or, because
43
+ certain configurations (publisher) can only be specified once.
44
+
45
+ ### Publisher
46
+
47
+ For testing, you can use a `Local` publisher:
48
+
49
+ publisher :local,
50
+ :directory => "/tmp/volley/remote"
51
+
52
+ This will allow you to use all of `Volley`'s functionality without requiring a cloud account.
53
+
54
+ Eventually, you will need to configure a cloud-based publisher, for S3, it would look like this:
55
+
56
+ publisher :amazons3,
57
+ :aws_access_key_id => "ACCESS_KEY",
58
+ :aws_secret_access_key => "SECRET_KEY",
59
+ :bucket => "my-bucket-name"
18
60
 
19
61
  ## Usage
20
62
 
21
- TODO: Write usage instructions here
63
+ Usage of `Volley` comes in primarily two parts: Publish and Deploy. Publishing generally involves creating an artifact
64
+ and pushing it to a remote location like S3. Deploying involves pulling the artifact from the remote location and running
65
+ code contained inside of it.
66
+
67
+ ### Volleyfile
68
+
69
+ All of the intelligence required to build, publish and deploy a project should be contained in the project's `Volleyfile`
70
+ If you've used `Capistrano` or other similar gem's, this is similar.
71
+
72
+ A project's `Volleyfile` contains at least a single project with publish and deploy plans.
73
+
74
+ project :myproject do
75
+ plan :publish do
76
+ action :build do
77
+ # run a build command
78
+ end
79
+ push do
80
+ # push is a special action.
81
+ # the push action will automatically create a single artifact for you
82
+ # the last statement of the push action should be a list of files that
83
+ # you want included in the artifact.
84
+ end
85
+ end
86
+
87
+ plan :deploy do
88
+ pull do |dir|
89
+ # pull is a special action
90
+ # this action will be called once the artifact is downloaded and unpacked
91
+ # on the remote server.
92
+ # 'dir' is set to the directory containing the unpacked contents of the
93
+ # artifact.
94
+ end
95
+ end
96
+ end
97
+
98
+ The `Volleyfile` is organized such that:
99
+
100
+ * `Volleyfile`s contain projects
101
+ * Projects contain plans
102
+ * Plans contain actions (which are run in the order that they are specified)
103
+
104
+ ### Project
105
+
106
+ A project is simply a container for a given projects related work. The `project` method requires a name argument,
107
+ either a symbol or string. Projects support a few configurations:
108
+
109
+ * `scm` - specify the source code management being used. currently supports `:git` and `:subversion`
110
+
111
+ ### Plan
112
+
113
+ As in the above `Volleyfile`, plans are simply a block of code. The `plan` method of the project requires a name argument,
114
+ as a symbol or a string.
115
+
116
+ ### Action
117
+
118
+ Actions contain simple blocks of work necessary to build your artifact. The simplest form of an action looks like:
119
+
120
+ action :name do
121
+ # work goes here
122
+ end
123
+
124
+ As with projects and plans, names can be specified as strings or symbols.
125
+
126
+ There are a few specialized actions which have shortcut methods:
127
+
128
+ * `default` - generally used for simple plans, that contain only one action
129
+ * `push` - The push action is specialized in that it's return value is the list of
130
+ files which will be packaged into the remote artifact. This action is the only
131
+ way to push files to publisher.
132
+ * `pull` - The pull action is the only how `Volley` pulls artifacts from the publisher.
133
+ The code block for the pull action should contain the work required to deploy the artifact on the remote server.
134
+ * `volley` - the volley action allows for dependencies between projects, one project can call another.
22
135
 
23
136
  ## Contributing
24
137
 
data/bin/volley CHANGED
@@ -11,25 +11,6 @@ Usage:
11
11
  volley [options] PLAN DESCRIPTOR
12
12
  volley [options] PLAN DESCRIPTOR [ARGUMENT ...]
13
13
 
14
- <plan>
15
- The plan to run. This can be just the plan name or the project:plan.
16
- (will check in the reserved volley project for plan first)
17
-
18
- <descriptor>
19
- A descriptor should conform to the following format:
20
- <project>[@<branch>[:<version>]]
21
-
22
- project: the project name.
23
- branch: the branch name.
24
- Defaults to the branch currently in use,
25
- must be specified for remote mode.
26
- version: the version (revision)
27
- Defaults to the current revision
28
- In remote mode, defaults to "latest"
29
-
30
- <argument>
31
- A list of key=value pairs
32
-
33
14
  Options:
34
15
  -h --help show this help message and exit
35
16
  --version show version and exit
@@ -60,7 +41,9 @@ module Volley
60
41
  log = options["--log"]
61
42
  level = options["--level"]
62
43
  force = options["--force"]
63
- args = { }
44
+ plan = options["PLAN"]
45
+ desc = options["DESCRIPTOR"]
46
+ kvs = options["ARGUMENT"]
64
47
 
65
48
  Volley::Dsl::VolleyFile.init
66
49
  Volley::Dsl::VolleyFile.load(config, :optional => true)
@@ -76,11 +59,10 @@ module Volley
76
59
  Volley::Log.console_quiet
77
60
  end
78
61
 
79
- kvs = argv.select { |e| e.match(/(\w+)\=(\w+)/) }
80
- pos = argv.reject { |e| e.match(/(\w+)\=(\w+)/) }
81
-
82
- plan = pos.shift
83
- desc = pos.shift
62
+ if desc && !Volley::Descriptor.valid?(desc)
63
+ kvs.unshift(desc)
64
+ desc = nil
65
+ end
84
66
 
85
67
  raise "must specify plan" unless plan
86
68
  if plan =~ /\:/
@@ -102,7 +84,6 @@ module Volley
102
84
  Volley::Log.debug "## OPTIONS ##"
103
85
  Volley::Log.debug "plan: #{plan}"
104
86
  Volley::Log.debug "descriptor: #{desc}"
105
- Volley::Log.debug "positional: #{pos.join(",")}"
106
87
  Volley::Log.debug "key:value: #{kvs.join(",")}"
107
88
  end
108
89
 
data/init/Volleyfile CHANGED
@@ -1 +1,24 @@
1
- # TODO: write this
1
+
2
+ project :myproject do
3
+ plan :publish do
4
+ action :build do
5
+ # run a build command
6
+ end
7
+ push do
8
+ # push is a special action.
9
+ # the push action will automatically create a single artifact for you
10
+ # the last statement of the push action should be a list of files that
11
+ # you want included in the artifact.
12
+ end
13
+ end
14
+
15
+ plan :deploy do
16
+ pull do |dir|
17
+ # pull is a special action
18
+ # this action will be called once the artifact is downloaded and unpacked
19
+ # on the remote server.
20
+ # 'dir' is set to the directory containing the unpacked contents of the
21
+ # artifact.
22
+ end
23
+ end
24
+ end
@@ -29,5 +29,14 @@ module Volley
29
29
  def to_s
30
30
  "#@project@#@branch:#@version"
31
31
  end
32
+
33
+ class << self
34
+ def valid?(desc)
35
+ return false if desc.nil? || desc.blank?
36
+ list = desc.split(/[\@\:\.\/\\\-]/)
37
+ return false if (list.count < 2 || list.count > 3)
38
+ true
39
+ end
40
+ end
32
41
  end
33
42
  end
@@ -3,7 +3,7 @@ unless defined?(Volley::Version)
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- TINY = 9
6
+ TINY = 10
7
7
  TAG = nil
8
8
  STRING = [MAJOR, MINOR, TINY, TAG].compact.join('.')
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: volley
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-06 00:00:00.000000000 Z
12
+ date: 2012-09-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: clamp