cloudbees 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,48 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+
4
+ def has_program?(program)
5
+ ENV['PATH'].split(File::PATH_SEPARATOR).any? do |directory|
6
+ File.executable?(File.join(directory, program.to_s))
7
+ end
8
+ end
9
+
10
+
11
+ if not has_program?('bees') then
12
+ abort('Please install the CloudBees SDK from here: www.cloudbees.com/run.cb')
13
+ end
14
+
15
+ usage_message = 'Usage: cloudbees deploy USER/APPNAME ["(optional) description here"]'
16
+
17
+ if ARGV.size < 2 then
18
+ abort(usage_message)
19
+ end
20
+
3
21
  task = ARGV[0]
4
- if task == "deploy" then
5
- puts "packaging the application...."
22
+
23
+ if task != "deploy" then
24
+ abort(usage_message)
25
+ end
26
+
27
+
28
+ app_id = ARGV[1]
29
+
30
+
31
+
32
+ puts "Packaging the application locally, please wait..."
33
+
6
34
  `warble`
7
- puts "Now deploying..."
8
- `bees app:deploy -a michaelneale/opiu miko.war`
9
- else
10
- puts "Usage: cloudbees deploy"
11
- end
35
+
36
+ wars = Dir.glob("*.war")
37
+
38
+ if wars.size != 1 then
39
+ abort("Unable to find war to deploy - warbler failure.")
40
+ end
41
+
42
+ puts "Now deploying to CloudBees..."
43
+
44
+ if ARGV.size == 2 then
45
+ `bees app:deploy -a #{app_id} #{wars[0]}`
46
+ else
47
+ `bees app:deploy -a #{app_id} -m "#{ARGV[2]}" #{wars[0]}`
48
+ end
@@ -1,9 +1,23 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ if not has_program?('beex') then
4
+ abort('Please install the CloudBees SDK from here: www.cloudbees.com/run.cb')
5
+ end
6
+
3
7
  task = ARGV[0]
4
8
  if task == "deploy" then
5
9
  puts "packaging the application...."
6
10
  `warble`
7
11
  puts "Now deploying..."
8
12
  `bees app:deploy -a michaelneale/opiu miko.war`
13
+ else
14
+ puts "Usage: cloudbees deploy"
15
+ end
16
+
17
+
18
+
19
+ def has_program?(program)
20
+ ENV['PATH'].split(File::PATH_SEPARATOR).any? do |directory|
21
+ File.executable?(File.join(directory, program.to_s))
22
+ end
9
23
  end
@@ -1,5 +1,5 @@
1
1
  module NAME
2
2
 
3
- VERSION = "0.1.2".freeze
3
+ VERSION = "0.1.3".freeze
4
4
 
5
5
  end
@@ -0,0 +1,5 @@
1
+ module NAME
2
+
3
+ VERSION = "0.1.2".freeze
4
+
5
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudbees
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Neale
@@ -60,6 +60,7 @@ files:
60
60
  - bin/cloudbees
61
61
  - bin/cloudbees~
62
62
  - lib/cloudbees/version.rb
63
+ - lib/cloudbees/version.rb~
63
64
  - lib/cloudbees.rb
64
65
  - spec/spec_helper.rb
65
66
  - tasks/rspec.rb