obs_deploy 0.2.0 → 0.2.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/Gemfile.lock +1 -1
- data/lib/obs_deploy/check_diff.rb +6 -0
- data/lib/obs_deploy/cli/commands.rb +2 -0
- data/lib/obs_deploy/cli/commands/get_deployed_version.rb +3 -3
- data/lib/obs_deploy/cli/commands/get_package_version.rb +3 -3
- data/lib/obs_deploy/cli/commands/get_pending_migration.rb +20 -0
- data/lib/obs_deploy/ssh.rb +1 -1
- data/lib/obs_deploy/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41cc050c5b998c658f9e490356baecffde0c4d20c8f9856cb3f9d9365e47ff2d
|
4
|
+
data.tar.gz: 9c4bf4468558287c91bcce67af42af569020d4414d9676fd535bbb6ea503f81d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3935393353a5b72e06bccc8ae92c9dc53f1047fe20d8d7597c8ed80d081e4e1f17a6e816c9f61c5a1fd13c3b1293e51695e1aa2126a23c17d57957a3534124c3
|
7
|
+
data.tar.gz: acdfdcde737dd62fbdfde71225a4a71878118671f5a3b9c638090478c2ee8cea3cb0e56b35042caf009b8de4e682b169b8929a028dd9142666b28294e210b4cc
|
data/Gemfile.lock
CHANGED
@@ -31,6 +31,12 @@ module ObsDeploy
|
|
31
31
|
!!github_diff.match(%r{db/migrate})
|
32
32
|
end
|
33
33
|
|
34
|
+
def migrations
|
35
|
+
return [] unless has_migration?
|
36
|
+
|
37
|
+
github_diff.match(%r{db/migrate/.*\.rb}).to_a
|
38
|
+
end
|
39
|
+
|
34
40
|
def package_url
|
35
41
|
URI("#{@server}/public/build/OBS:Server:Unstable/#{@product}/x86_64/obs-server")
|
36
42
|
end
|
@@ -10,6 +10,7 @@ module ObsDeploy
|
|
10
10
|
autoload :GetPackageVersion, File.join(__dir__, 'commands/get_package_version.rb')
|
11
11
|
autoload :GetDeployedVersion, File.join(__dir__, 'commands/get_deployed_version.rb')
|
12
12
|
autoload :Systemctl, File.join(__dir__, 'commands/systemctl.rb')
|
13
|
+
autoload :GetPendingMigration, File.join(__dir__, 'commands/get_pending_migration.rb')
|
13
14
|
|
14
15
|
# register the commands and its command line
|
15
16
|
register 'available-package', GetPackageVersion
|
@@ -18,6 +19,7 @@ module ObsDeploy
|
|
18
19
|
register 'deploy', Deploy
|
19
20
|
register 'refresh-repositories', RefreshRepositories
|
20
21
|
register 'systemctl', Systemctl
|
22
|
+
register 'pending-migrations', GetPendingMigration
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
@@ -5,10 +5,10 @@ module ObsDeploy
|
|
5
5
|
module Commands
|
6
6
|
class GetDeployedVersion < Dry::CLI::Command
|
7
7
|
desc 'Get the deployed version of OBS'
|
8
|
-
option :
|
8
|
+
option :url, type: :string, default: 'https://api.opensuse.org', desc: 'API url'
|
9
9
|
|
10
|
-
def call(
|
11
|
-
puts "Deployed version: #{ObsDeploy::CheckDiff.new(server:
|
10
|
+
def call(url:, **)
|
11
|
+
puts "Deployed version: #{ObsDeploy::CheckDiff.new(server: url).obs_running_commit}"
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -5,13 +5,13 @@ module ObsDeploy
|
|
5
5
|
module Commands
|
6
6
|
class GetPackageVersion < Dry::CLI::Command
|
7
7
|
desc 'Get the available package version'
|
8
|
-
option :
|
8
|
+
option :url, type: :string, default: 'https://api.opensuse.org', desc: 'API url'
|
9
9
|
option :package, type: :string, default: 'obs-api', desc: 'Package name'
|
10
10
|
option :product, type: :string, default: 'SLE_12_SP4', desc: 'Product name'
|
11
11
|
option :architecture, type: :string, default: 'x86_64', desc: 'Architecture'
|
12
12
|
|
13
|
-
def call(
|
14
|
-
puts "Available package: #{ObsDeploy::CheckDiff.new(server:
|
13
|
+
def call(url:, product:, **)
|
14
|
+
puts "Available package: #{ObsDeploy::CheckDiff.new(server: url, product: product).package_version}"
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ObsDeploy
|
4
|
+
module CLI
|
5
|
+
module Commands
|
6
|
+
class GetPendingMigration < Dry::CLI::Command
|
7
|
+
option :url, type: :string, default: 'https://api.opensuse.org', desc: 'API url'
|
8
|
+
|
9
|
+
def call(url:, **)
|
10
|
+
migrations = ObsDeploy::CheckDiff.new(server: url).migrations
|
11
|
+
if migrations.empty?
|
12
|
+
puts 'No pending migrations'
|
13
|
+
else
|
14
|
+
puts migrations
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/obs_deploy/ssh.rb
CHANGED
data/lib/obs_deploy/version.rb
CHANGED
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.2.
|
4
|
+
version: 0.2.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: 2020-04-
|
11
|
+
date: 2020-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -168,6 +168,7 @@ files:
|
|
168
168
|
- lib/obs_deploy/cli/commands/deploy.rb
|
169
169
|
- lib/obs_deploy/cli/commands/get_deployed_version.rb
|
170
170
|
- lib/obs_deploy/cli/commands/get_package_version.rb
|
171
|
+
- lib/obs_deploy/cli/commands/get_pending_migration.rb
|
171
172
|
- lib/obs_deploy/cli/commands/refresh_repositories.rb
|
172
173
|
- lib/obs_deploy/cli/commands/systemctl.rb
|
173
174
|
- lib/obs_deploy/cli/commands/version.rb
|