baps 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26742e6633e6fd17a446096d5205ea9d845fa4f0
4
- data.tar.gz: 89c927289e60d5e8d017dfa929431a03d4b24088
3
+ metadata.gz: 94c52e714cc509d18e93218d1679bcf3f1e29744
4
+ data.tar.gz: 61e42cc50f06a79032b8a3fbf914c926249373ea
5
5
  SHA512:
6
- metadata.gz: 63acc006bf8feec859a0edc6d407e59556daefc73446d655d45fe7f39afeb2be96337378fc16a0e2f0aecc4352d6198512450fdbd5286cc9474ec8a8e6a53c93
7
- data.tar.gz: 08977962a992b220517cba693876ae2b0847d97d18a5aa2f16bdeef27bb9c3476c6911ec32aa3d2b54975c42efbece0a32e79df3386c5c8f14ac947aec69e4a5
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("--no-docker", "Path to a definition file") do
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)
@@ -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
@@ -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?
@@ -1,3 +1,3 @@
1
1
  module Baps
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elvin Efendi