baps 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/exe/baps +5 -1
- data/lib/baps/deb.rb +2 -1
- data/lib/baps/executor.rb +6 -1
- data/lib/baps/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94c52e714cc509d18e93218d1679bcf3f1e29744
|
4
|
+
data.tar.gz: 61e42cc50f06a79032b8a3fbf914c926249373ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccc8560d517bd18975c68c95bf2190dbded682d08e5485665e76eb34df428a1b04858cd2497c6693e0f8416fb5a166fd1969ec7b012f32bf7f2a8ef7b1590f9e
|
7
|
+
data.tar.gz: 6de47e1eb0d57c18acdc320d7074046f947362b73670bb2195309749035dbce5129a87ced868d54087ac5d4d6a4ca9eae0529f80a9007c8d6776f9c23defb557
|
data/exe/baps
CHANGED
@@ -16,9 +16,13 @@ OptionParser.new do |opts|
|
|
16
16
|
options[:path] = v
|
17
17
|
end
|
18
18
|
|
19
|
-
opts.on(
|
19
|
+
opts.on('--no-docker', 'If given, executes the definitions on the host machine') do
|
20
20
|
options[:use_docker] = false
|
21
21
|
end
|
22
|
+
|
23
|
+
opts.on('--no-publish', 'If given, does not push the resulting package to PackageCloud') do
|
24
|
+
options[:publish] = false
|
25
|
+
end
|
22
26
|
end.parse!
|
23
27
|
|
24
28
|
executor = Baps::Executor.new(options)
|
data/lib/baps/deb.rb
CHANGED
@@ -6,13 +6,14 @@ module Baps
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def already_exist?
|
9
|
+
return false unless Executor.publish?
|
9
10
|
Baps.packagecloud.package_exist?(name: name, version: version)
|
10
11
|
end
|
11
12
|
|
12
13
|
def create
|
13
14
|
build.start
|
14
15
|
package
|
15
|
-
publish
|
16
|
+
publish if Executor.publish?
|
16
17
|
end
|
17
18
|
|
18
19
|
private
|
data/lib/baps/executor.rb
CHANGED
@@ -2,14 +2,19 @@ module Baps
|
|
2
2
|
class Executor
|
3
3
|
DOCKER_IMAGE_ID = 'elvinefendi/baps'
|
4
4
|
|
5
|
-
def initialize(path:, use_docker: true)
|
5
|
+
def initialize(path:, use_docker: true, publish: true)
|
6
6
|
raise ArgumentError.new('Given path does not exist.') unless File.exist?(path)
|
7
7
|
@path = File.expand_path(path)
|
8
8
|
@use_docker = use_docker
|
9
|
+
# TODO refactor this!
|
10
|
+
@@publish = publish
|
9
11
|
@definitions = definitions_from_directory if File.directory?(@path)
|
10
12
|
@definitions = [Definition.new(@path)] if File.file?(@path)
|
11
13
|
end
|
12
14
|
|
15
|
+
def self.publish?
|
16
|
+
!!@@publish
|
17
|
+
end
|
13
18
|
|
14
19
|
def execute
|
15
20
|
if !@definitions || @definitions.empty?
|
data/lib/baps/version.rb
CHANGED