assemblyline-cli 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MzIxNTEzMDE1YWZlNTFkNjVkODQwZmY2Yjg4MzNiMDAzOTNiZDg5OA==
5
+ data.tar.gz: !binary |-
6
+ ZWY5ZDhlYzA5NzZhYTA3NGNjMjA0NmM3ZmVlZDBjNTc3MDIyYjMwMg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZDJkMDU3N2E4YmVhZGI3MWM4ZGM0ZGE4NDQ1YmQ5ZmFjOWZlMTU3YzdkMzdi
10
+ NDQ2NzI1NDM4NmUxZjIzZDVmNjkzMjk4MmY5NDUxYmIwMTI5M2E3ODk2ZmJm
11
+ YzA2YzRmZDc3MjcyYzU3ZDVmM2JiNTQxYjhlYjg0ZjVmZmIyMDQ=
12
+ data.tar.gz: !binary |-
13
+ ODBlYzFlODk2ZTRhOTI2ZWYzMWRlZDFlODcwOWU0YTFiYTY1NTUxZWYxZWY0
14
+ OWU0NmZiNDIyM2JkNDA3OGQyOWYxZDY4NDE1NmRjNzI5MzY3M2U5NjJjZmYx
15
+ ZjhjOThjZTI2ZGY2OGEyMTg3OGQyYTJlZjJkZjIzYTk3NzY1YTc=
data/README.md CHANGED
@@ -1,25 +1,25 @@
1
1
  # Assemblyline::Cli
2
2
 
3
- A super-lightweight wrapper to start init.d services inside dockerised test containers
3
+ A super-lightweight wrapper to start assemblyline tasks
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
7
+ Or install with:
8
8
 
9
- gem 'assemblyline-cli'
10
-
11
- And then execute:
12
-
13
- $ bundle
9
+ $ gem install assemblyline-cli
14
10
 
15
- Or install it yourself as:
11
+ ## Dependencies
16
12
 
17
- $ gem install assemblyline-cli
13
+ * Ruby
14
+ * Docker
18
15
 
19
16
  ## Usage
20
17
 
21
- Include the services to start in the ASSEMBLYLINE_SERVICES environment var.
22
- Pass the test command to run in as args.
18
+ ```
19
+ Commands:
20
+ assemblyline build URL # Build an assemblyline project from a git url
21
+ assemblyline help [COMMAND] # Describe available commands or one specific command
22
+ ```
23
23
 
24
24
  ## Contributing
25
25
 
@@ -5,10 +5,10 @@ require 'assemblyline/cli/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "assemblyline-cli"
8
- spec.version = Assemblyline::Cli::VERSION
8
+ spec.version = Assemblyline::CLI_VERSION
9
9
  spec.authors = ["Ed Robinson"]
10
10
  spec.email = ["ed@reevoo.com"]
11
- spec.summary = %q{A wrapper to start services when running assemblyline tests}
11
+ spec.summary = %q{A super-lightweight wrapper to start assemblyline tasks}
12
12
  spec.homepage = "http://github.com/assemblyline"
13
13
  spec.license = "MIT"
14
14
 
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
+ spec.add_dependency "thor", "~> 0.19"
20
21
  spec.add_development_dependency "bundler", "~> 1.5"
21
22
  spec.add_development_dependency "rake"
22
23
  end
data/bin/assemblyline CHANGED
@@ -1,9 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- services = ENV['ASSEMBLYLINE_SERVICES'] || ""
4
- services.split.each do |service|
5
- system("service #{service} start")
6
- end
3
+ require 'assemblyline/cli'
7
4
 
8
- system("#{ARGV.join(' ')}")
9
- exit!($?.exitstatus)
5
+ Assemblyline::CLI.start
@@ -1,5 +1,3 @@
1
1
  module Assemblyline
2
- module Cli
3
- VERSION = "0.0.1"
4
- end
2
+ CLI_VERSION = "0.0.2"
5
3
  end
@@ -1,7 +1,29 @@
1
1
  require "assemblyline/cli/version"
2
+ require 'thor'
2
3
 
3
4
  module Assemblyline
4
- module Cli
5
- # Your code goes here...
5
+ class CLI < Thor
6
+ desc "build URL", "Build an assemblyline project from a git url"
7
+ def build(url)
8
+ exec "docker run --rm -ti -v /tmp:/tmp -v /var/run/docker.sock:/var/run/docker.sock -e SSH_KEY=#{ssh_key} -e DOCKERCFG=#{dockercfg} quay.io/assemblyline/builder:latest bin/build #{url}"
9
+ end
10
+
11
+ private
12
+
13
+ def ssh_key
14
+ File.read(key_path).dump
15
+ end
16
+
17
+ def dockercfg
18
+ File.read(File.join(ENV['HOME'], '.dockercfg')).dump
19
+ end
20
+
21
+ def key_path
22
+ %w(id_rsa id_dsa).map { |private_key| ssh_key_path(private_key) }.detect { |path| File.exist? path }
23
+ end
24
+
25
+ def ssh_key_path(key)
26
+ File.join(ENV['HOME'], ".ssh/#{key}")
27
+ end
6
28
  end
7
29
  end
metadata CHANGED
@@ -1,20 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assemblyline-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ version: 0.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ed Robinson
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-01-27 00:00:00.000000000 Z
11
+ date: 2015-03-18 00:00:00.000000000 Z
13
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '0.19'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '0.19'
14
27
  - !ruby/object:Gem::Dependency
15
28
  name: bundler
16
29
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
30
  requirements:
19
31
  - - ~>
20
32
  - !ruby/object:Gem::Version
@@ -22,7 +34,6 @@ dependencies:
22
34
  type: :development
23
35
  prerelease: false
24
36
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
37
  requirements:
27
38
  - - ~>
28
39
  - !ruby/object:Gem::Version
@@ -30,7 +41,6 @@ dependencies:
30
41
  - !ruby/object:Gem::Dependency
31
42
  name: rake
32
43
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
44
  requirements:
35
45
  - - ! '>='
36
46
  - !ruby/object:Gem::Version
@@ -38,7 +48,6 @@ dependencies:
38
48
  type: :development
39
49
  prerelease: false
40
50
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
51
  requirements:
43
52
  - - ! '>='
44
53
  - !ruby/object:Gem::Version
@@ -63,32 +72,25 @@ files:
63
72
  homepage: http://github.com/assemblyline
64
73
  licenses:
65
74
  - MIT
75
+ metadata: {}
66
76
  post_install_message:
67
77
  rdoc_options: []
68
78
  require_paths:
69
79
  - lib
70
80
  required_ruby_version: !ruby/object:Gem::Requirement
71
- none: false
72
81
  requirements:
73
82
  - - ! '>='
74
83
  - !ruby/object:Gem::Version
75
84
  version: '0'
76
- segments:
77
- - 0
78
- hash: -3964273064101100078
79
85
  required_rubygems_version: !ruby/object:Gem::Requirement
80
- none: false
81
86
  requirements:
82
87
  - - ! '>='
83
88
  - !ruby/object:Gem::Version
84
89
  version: '0'
85
- segments:
86
- - 0
87
- hash: -3964273064101100078
88
90
  requirements: []
89
91
  rubyforge_project:
90
- rubygems_version: 1.8.23
92
+ rubygems_version: 2.4.5
91
93
  signing_key:
92
- specification_version: 3
93
- summary: A wrapper to start services when running assemblyline tests
94
+ specification_version: 4
95
+ summary: A super-lightweight wrapper to start assemblyline tasks
94
96
  test_files: []