obs_deploy 0.3.1 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0f5719e3a953c7cabd13373bb9671b6f9ba030375eddcf6309d0eb4ecc197b8
4
- data.tar.gz: 726533caf0cc85fa5421d536944c5f7d768b657746f042797119129ecc62ae00
3
+ metadata.gz: f5b16b77225b642cdcc26e723e6c9d6b97615dbf23c898e24ce6ddb35c728761
4
+ data.tar.gz: 37ec0c9e13a348103d0049c619da0f774d39ff73f1d7daa69b29148b3500a36a
5
5
  SHA512:
6
- metadata.gz: 234fc276e10b4a7d85bb8ac4e8c27a58846651469c3bec4f40d0aa9c6c109ff7badefdf51bb4422e428a265ebe5671ce925c89ea8db53fb07aeda1cce67edb88
7
- data.tar.gz: fd1a3f6fd2bbdab8700cf9e50cac99c7d5ad63a185ea338c5793386f04a1c544b2328aa0e991e60d9cafe8accbdcd4c737b5223fb59ce242732c352fcad0029a
6
+ metadata.gz: 36bcb33b807e433fdb19f8a5cfaf73dc5e9b98dd5b8152e4e2aa8de0dffd2d1e4ee4001b99c1b97b2155f79e1e3cad0f3af71c7a28915d7719a63e052a1044ff
7
+ data.tar.gz: 8a463bf31c90f57034bbcb7599a378c3494f33543f4273077b565a0250949ba342578dfbc597ff41224c59d59af1baa22456e035eb6da30ae104224b6109ef5b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- obs_deploy (0.3.1)
4
+ obs_deploy (0.3.2)
5
5
  cheetah
6
6
  dry-cli
7
7
  nokogiri
@@ -2,10 +2,11 @@
2
2
 
3
3
  module ObsDeploy
4
4
  class CheckDiff
5
- def initialize(server: 'https://api.opensuse.org', product: 'SLE_12_SP4', project: 'OBS:Server:Unstable')
5
+ def initialize(server: 'https://api.opensuse.org', product: 'SLE_12_SP4', project: 'OBS:Server:Unstable', target_server: 'https://api.opensuse.org')
6
6
  @server = server
7
7
  @product = product
8
8
  @project = project
9
+ @target_server = target_server
9
10
  end
10
11
 
11
12
  def package_version
@@ -59,7 +60,7 @@ module ObsDeploy
59
60
  end
60
61
 
61
62
  def about_url
62
- URI("#{@server}/about")
63
+ URI("#{@target_server}/about")
63
64
  end
64
65
  end
65
66
  end
@@ -11,6 +11,7 @@ module ObsDeploy
11
11
  autoload :GetDeployedVersion, File.join(__dir__, 'commands/get_deployed_version.rb')
12
12
  autoload :Systemctl, File.join(__dir__, 'commands/systemctl.rb')
13
13
  autoload :GetPendingMigration, File.join(__dir__, 'commands/get_pending_migration.rb')
14
+ autoload :GetDiff, File.join(__dir__, 'commands/get_diff.rb')
14
15
 
15
16
  # register the commands and its command line
16
17
  register 'available-package', GetPackageVersion
@@ -20,6 +21,7 @@ module ObsDeploy
20
21
  register 'refresh-repositories', RefreshRepositories
21
22
  register 'systemctl', Systemctl
22
23
  register 'pending-migrations', GetPendingMigration
24
+ register 'check-diff', GetDiff
23
25
  end
24
26
  end
25
27
  end
@@ -2,7 +2,19 @@
2
2
 
3
3
  module ObsDeploy
4
4
  module CLI
5
- class GetDiff
5
+ module Commands
6
+ class GetDiff < Dry::CLI::Command
7
+ desc 'Get diff between deployed package and available package'
8
+ option :url, type: :string, default: 'https://api.opensuse.org', desc: 'API url'
9
+ option :package, type: :string, default: 'obs-api', desc: 'Package name'
10
+ option :project, type: :string, default: 'OBS:Server:Unstable', desc: 'Project name'
11
+ option :product, type: :string, default: 'SLE_12_SP4', desc: 'Product name'
12
+ option :architecture, type: :string, default: 'x86_64', desc: 'Architecture'
13
+
14
+ def call(url:, product:, project:, **)
15
+ puts "diff : #{ObsDeploy::CheckDiff.new(server: url, project: project, product: product).github_diff}"
16
+ end
17
+ end
6
18
  end
7
19
  end
8
20
  end
@@ -12,7 +12,7 @@ module ObsDeploy
12
12
 
13
13
  def call(user:, dry_run:, host:, port:, **)
14
14
  ssh_driver = ObsDeploy::SSH.new(user: user, server: host, port: port)
15
- zypper = ObsDeploy::Zypper.new
15
+ zypper = ObsDeploy::Zypper.new(dry_run: dry_run)
16
16
  ssh_driver.run(zypper.refresh)
17
17
  end
18
18
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ObsDeploy
4
- VERSION = '0.3.1'
4
+ VERSION = '0.3.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obs_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pereira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-04 00:00:00.000000000 Z
11
+ date: 2021-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler