obs_deploy 0.2.5 → 0.3.0

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
  SHA256:
3
- metadata.gz: 56e0cc88321f0bc33598a1e3ea3ded2ed35b4d9bead0dc610283f8763c2dd535
4
- data.tar.gz: 95753db3ab45df12657cd1732e5eb99a90f297a5fe4bfc755faeaface8768e67
3
+ metadata.gz: 7ebc8a1643cc4ad84ad5d480e44e6c98c8bbb008aaee87cd450f59ff85219083
4
+ data.tar.gz: 219d68cf9a244dd94f011bfe8126b7c667c2477059dd5d5132da81b99a25018f
5
5
  SHA512:
6
- metadata.gz: 358cdbc116947e6f1a4138cf3a1bb547758b362f5d46cb6bf0bca2324010ad2ed5c526a16551c0aa35d6fa6d8ab2e2e00dbf27ee7e8da07e290aeea54c18733a
7
- data.tar.gz: 0a9dfb324d28c6629ddb598e7081c22561d63721f595dd455528b7c83bae324903f6f25985c6fc963dafca3a4bc26b8bdbec2e9a00585762a0ff795ad6b607a2
6
+ metadata.gz: 50e93f6d5392498366eb0da55273ac5fab0cb594b836a526147e081f85ba8e7e8dcda66246755c14905dbe4daa6108a8a3fc4c930f3b0ac119c9e02fb903248e
7
+ data.tar.gz: b93b82add9aea39fcb322f005bf9a739a9b1ab4f2dca241c405ea151855146a2c5217f1f324fbc324723ea1d70cf6da8e0d4e0faeb45cc27ce0d6582587521cb
@@ -0,0 +1,8 @@
1
+ FROM opensuse/tumbleweed
2
+
3
+ RUN zypper --gpg-auto-import-keys refresh
4
+ RUN zypper install -y openssh vim iputils
5
+
6
+ COPY entrypoint.sh /entrypoint.sh
7
+ RUN chmod +x /entrypoint.sh
8
+ ENTRYPOINT ["/entrypoint.sh"]
File without changes
@@ -0,0 +1,9 @@
1
+ docker-dev:
2
+ docker build -f Dockerfile.dev -t $(USER)/obs_deploy_dev .
3
+ docker run --rm -it -v "$(HOME)/.ssh:/tmp/.ssh:ro" -v "$(PWD):/obs_deploy" $(USER)/obs_deploy_dev bash
4
+
5
+ docker-rpm:
6
+ docker build -f Dockerfile.rpm -t $(USER)/obs_deploy_dev .
7
+ docker run --rm -it -v "$(HOME)/.ssh:/tmp/.ssh:ro" -v "$(PWD):/obs_deploy" $(USER)/obs_deploy_dev bash
8
+
9
+
data/README.md CHANGED
@@ -5,6 +5,9 @@ Simple tool to deploy OBS via zypper to our reference server
5
5
  ## Build Status
6
6
  [![CircleCI](https://circleci.com/gh/vpereira/obs_deploy.svg?style=svg)](https://app.circleci.com/pipelines/github/vpereira/obs_deploy)
7
7
 
8
+ ## Codebeat
9
+ [![codebeat badge](https://codebeat.co/badges/767d7e65-0364-4386-a26e-99ad228dfe31)](https://codebeat.co/projects/github-com-vpereira-obs_deploy-master)
10
+
8
11
 
9
12
  ## Installation
10
13
 
@@ -84,7 +87,7 @@ if you want to run it against the OBS appliance running on VirtualBox:
84
87
  - then run the container as:
85
88
 
86
89
  ```
87
- docker run --rm -it -v "$HOME/.ssh:/tmp/.ssh:ro" $USER/obs_deploy bash
90
+ make docker-dev
88
91
  ```
89
92
  Now you are inside the container and should be able to ping the obs appliance.
90
93
 
@@ -101,6 +104,15 @@ If you want to add new command to the cli, please read the `dry-cli` documentati
101
104
 
102
105
  The commands are being sent via ssh and ssh is being called via `cheetah` https://github.com/openSUSE/cheetah. Please Read the `ssh.rb` file, specially the `SSH#run` method
103
106
 
107
+ ## RPM Building
108
+
109
+ Under dist/ we have the necessary files to use to build the gem as rpm. The
110
+ `_service` still not used. Mainly because we need either to build the rubygem
111
+ dependencies or use https://github.com/openSUSE/obs-service-bundle_gems
112
+
113
+ Today as it is, you have to push the gem to rubygems and then generate the spec
114
+ and push it to build service
115
+
104
116
  ## Contributing
105
117
 
106
118
  Bug reports and pull requests are welcome on GitHub at https://github.com/vpereira/obs_deploy.
@@ -1,4 +1,12 @@
1
1
  <services>
2
- <service name="download_files">
2
+ <service name="tar_scm">
3
+ <param name="scm">git</param>
4
+ <param name="url">git://github.com/vpereira/obs_deploy.git</param>
5
+ <param name="revision">master</param>
6
+ <param name="version">0.2.0</param>
3
7
  </service>
8
+ <service name="recompress">
9
+ <param name="file">*.tar</param>
10
+ <param name="compression">xz</param>
11
+ </service>
4
12
  </services>
@@ -1,54 +1,104 @@
1
- #
2
- # spec file for package rubygem-obs_deploy
3
- #
4
- # Copyright (c) 2020 SUSE LLC
5
- #
6
- # All modifications and additions to the file contributed by third parties
7
- # remain the property of their copyright owners, unless otherwise agreed
8
- # upon. The license for this file, and modifications and additions to the
9
- # file, is the same license as for the pristine package itself (unless the
10
- # license for the pristine package is not an Open Source License, in which
11
- # case the license is the MIT License). An "Open Source License" is a
12
- # license that conforms to the Open Source Definition (Version 1.9)
13
- # published by the Open Source Initiative.
14
-
15
- # Please submit bugfixes or comments via https://bugs.opensuse.org/
16
- #
17
-
18
-
19
- %define mod_name obs_deploy
20
- %define mod_full_name %{mod_name}-%{version}
21
- %define rb_suffix ruby2.6
22
- Name: rubygem-obs_deploy
23
- Version: 0.2.0
24
- Release: 0
25
- Summary: OBS Deployment tool
26
- License: MIT
27
- Group: Development/Languages/Ruby
28
- URL: https://openbuildservice.org
29
- Source: https://rubygems.org/gems/%{mod_full_name}.gem
30
- BuildRequires: %{rubygem gem2rpm}
31
- BuildRequires: %{ruby}
32
- BuildRequires: ruby-macros >= 5
33
- BuildRequires: ruby-common-rails
34
- # FIXME: use proper Requires(pre/post/preun/...)
35
- PreReq: update-alternatives
1
+ # Generated from obs_deploy-0.2.5.gem by gem2rpm -*- rpm-spec -*-
2
+ %define rbname obs_deploy
3
+ %define version 0.2.5
4
+ %define release 1
36
5
 
6
+ Summary: OBS Deployment tool
7
+ Name: ruby-gems-%{rbname}
8
+
9
+ Version: %{version}
10
+ Release: %{release}
11
+ Group: Development/Ruby
12
+ License: Distributable
13
+ URL: https://openbuildservice.org
14
+ Source0: %{rbname}-%{version}.gem
15
+ # Make sure the spec template is included in the SRPM
16
+ Source1: ruby-gems-%{rbname}.spec.in
17
+ BuildRoot: %{_tmppath}/%{name}-%{version}-root
18
+ Requires: ruby [""]
19
+ Requires: ruby-gems >= 3.0.6
20
+ Requires: ruby-gems-bundler >= 2.0
21
+ Requires: ruby-gems-bundler < 3
22
+ Requires: ruby-gems-pry
23
+ Requires: ruby-gems-rake >= 13.0
24
+ Requires: ruby-gems-rake < 14
25
+ Requires: ruby-gems-rspec >= 3.0
26
+ Requires: ruby-gems-rspec < 4
27
+ Requires: ruby-gems-rubocop
28
+ Requires: ruby-gems-webmock
29
+ Requires: ruby-gems-cheetah
30
+ Requires: ruby-gems-dry-cli
31
+ Requires: ruby-gems-nokogiri
32
+ BuildRequires: ruby [""]
33
+ BuildRequires: ruby-gems >= 3.0.6
34
+ BuildArch: noarch
35
+ Provides: ruby(Obs_deploy) = %{version}
36
+
37
+ %define gemdir /home/vpereira/.rvm/gems/ruby-2.5.0
38
+ %define gembuilddir %{buildroot}%{gemdir}
37
39
 
38
40
  %description
39
41
  OBS Deployment tool.
40
42
 
43
+
41
44
  %prep
45
+ %setup -T -c
42
46
 
43
47
  %build
44
48
 
45
49
  %install
46
- %rails_fix_ruby_shebang bin/
47
- %gem_install \
48
- --symlink-binaries \
49
- --doc-files="README.md" \
50
- -f
50
+ %{__rm} -rf %{buildroot}
51
+ mkdir -p %{gembuilddir}
52
+ gem install --local --install-dir %{gembuilddir} --force %{SOURCE0}
53
+ mkdir -p %{buildroot}/%{_bindir}
54
+ mv %{gembuilddir}/bin/* %{buildroot}/%{_bindir}
55
+ rmdir %{gembuilddir}/bin
56
+
57
+ %clean
58
+ %{__rm} -rf %{buildroot}
59
+
60
+ %files
61
+ %defattr(-, root, root)
62
+ %{_bindir}/console
63
+ %{_bindir}/obs_deploy
64
+ %{_bindir}/setup
65
+ %{gemdir}/gems/obs_deploy-0.2.5/
66
+ %{gemdir}/gems/obs_deploy-0.2.5/
67
+ %{gemdir}/gems/obs_deploy-0.2.5/
68
+ %{gemdir}/gems/obs_deploy-0.2.5/
69
+ %{gemdir}/gems/obs_deploy-0.2.5/
70
+ %{gemdir}/gems/obs_deploy-0.2.5/
71
+ %{gemdir}/gems/obs_deploy-0.2.5/
72
+ %{gemdir}/gems/obs_deploy-0.2.5/
73
+ %{gemdir}/gems/obs_deploy-0.2.5/
74
+ %{gemdir}/gems/obs_deploy-0.2.5/
75
+ %{gemdir}/gems/obs_deploy-0.2.5/
76
+ %{gemdir}/gems/obs_deploy-0.2.5/
77
+ %{gemdir}/gems/obs_deploy-0.2.5/
78
+ %{gemdir}/gems/obs_deploy-0.2.5/
79
+ %{gemdir}/gems/obs_deploy-0.2.5/
80
+ %{gemdir}/gems/obs_deploy-0.2.5/
81
+ %{gemdir}/gems/obs_deploy-0.2.5/
82
+ %{gemdir}/gems/obs_deploy-0.2.5/
83
+ %{gemdir}/gems/obs_deploy-0.2.5/
84
+ %{gemdir}/gems/obs_deploy-0.2.5/
85
+ %{gemdir}/gems/obs_deploy-0.2.5/
86
+ %{gemdir}/gems/obs_deploy-0.2.5/
87
+ %{gemdir}/gems/obs_deploy-0.2.5/
88
+ %{gemdir}/gems/obs_deploy-0.2.5/
89
+ %{gemdir}/gems/obs_deploy-0.2.5/
90
+ %{gemdir}/gems/obs_deploy-0.2.5/
91
+ %{gemdir}/gems/obs_deploy-0.2.5/
92
+ %{gemdir}/gems/obs_deploy-0.2.5/
93
+ %{gemdir}/gems/obs_deploy-0.2.5/
94
+ %{gemdir}/gems/obs_deploy-0.2.5/
95
+ %{gemdir}/gems/obs_deploy-0.2.5/
96
+ %{gemdir}/gems/obs_deploy-0.2.5/
97
+ %{gemdir}/gems/obs_deploy-0.2.5/
98
+
51
99
 
52
- %gem_packages
100
+ %doc %{gemdir}/doc/obs_deploy-0.2.5
101
+ %{gemdir}/cache/obs_deploy-0.2.5.gem
102
+ %{gemdir}/specifications/obs_deploy-0.2.5.gemspec
53
103
 
54
104
  %changelog
@@ -12,6 +12,7 @@ require 'obs_deploy/ssh'
12
12
  require 'obs_deploy/zypper'
13
13
  require 'obs_deploy/systemctl'
14
14
  require 'obs_deploy/apache_sysconfig'
15
+ require 'tempfile'
15
16
 
16
17
  module ObsDeploy
17
18
  class Error < StandardError; end
@@ -51,7 +51,16 @@ module ObsDeploy
51
51
  end
52
52
 
53
53
  def write_apache_sysconfig(content)
54
- File.open(path, 'wb') { |file| file.write(content) }
54
+ f = Tempfile.new
55
+ f.write(content)
56
+ begin
57
+ File.rename(f.path, path)
58
+ rescue SystemCallError => e
59
+ puts e.inspect
60
+ ensure
61
+ f.unlink
62
+ f.close
63
+ end
55
64
  end
56
65
  end
57
66
  end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ObsDeploy
4
+ module CLI
5
+ class GetDiff
6
+ end
7
+ end
8
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ObsDeploy
4
- VERSION = '0.2.5'
4
+ VERSION = '0.3.0'
5
5
  end
@@ -10,11 +10,26 @@ module ObsDeploy
10
10
  end
11
11
 
12
12
  def update
13
- run ['zypper'] + update_string + package_name
13
+ run %w[zypper] + update_string + package_name
14
14
  end
15
15
 
16
16
  def refresh
17
- run ['zypper', '--non-interactive', '--gpg-auto-import-keys', 'refresh']
17
+ run %w[zypper --non-interactive --gpg-auto-import-keys refresh]
18
+ end
19
+
20
+ # TODO
21
+ # check if we want to lock from specific repositories
22
+ def add_lock
23
+ run %w[zypper addlock] + package_name
24
+ end
25
+
26
+ def remove_lock
27
+ run %w[zypper removelock] + package_name
28
+ end
29
+
30
+ def locked?
31
+ # check the return value
32
+ run %w[zypper locks] + package_name
18
33
  end
19
34
 
20
35
  private
@@ -36,11 +51,11 @@ module ObsDeploy
36
51
  end
37
52
 
38
53
  def update_params
39
- ['--non-interactive', 'update', '--best-effort', '--details']
54
+ %w[--non-interactive update --best-effort --details]
40
55
  end
41
56
 
42
57
  def dry_run_params
43
- ['--dry-run --download-only']
58
+ %w[--dry-run --download-only]
44
59
  end
45
60
  end
46
61
  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.2.5
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pereira
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-04 00:00:00.000000000 Z
11
+ date: 2020-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -136,7 +136,7 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
- description:
139
+ description:
140
140
  email:
141
141
  - vpereira@suse.de
142
142
  executables:
@@ -151,9 +151,11 @@ files:
151
151
  - ".rspec"
152
152
  - ".rubocop.yml"
153
153
  - ".travis.yml"
154
- - Dockerfile
154
+ - Dockerfile.dev
155
+ - Dockerfile.rpm
155
156
  - Gemfile
156
157
  - Gemfile.lock
158
+ - Makefile
157
159
  - README.md
158
160
  - Rakefile
159
161
  - bin/console
@@ -169,6 +171,7 @@ files:
169
171
  - lib/obs_deploy/cli/commands.rb
170
172
  - lib/obs_deploy/cli/commands/deploy.rb
171
173
  - lib/obs_deploy/cli/commands/get_deployed_version.rb
174
+ - lib/obs_deploy/cli/commands/get_diff.rb
172
175
  - lib/obs_deploy/cli/commands/get_package_version.rb
173
176
  - lib/obs_deploy/cli/commands/get_pending_migration.rb
174
177
  - lib/obs_deploy/cli/commands/refresh_repositories.rb
@@ -185,7 +188,7 @@ metadata:
185
188
  allowed_push_host: https://rubygems.org
186
189
  homepage_uri: https://openbuildservice.org
187
190
  source_code_uri: https://github.com/vpereira/obs_deploy.git
188
- post_install_message:
191
+ post_install_message:
189
192
  rdoc_options: []
190
193
  require_paths:
191
194
  - lib
@@ -201,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
204
  version: '0'
202
205
  requirements: []
203
206
  rubygems_version: 3.0.6
204
- signing_key:
207
+ signing_key:
205
208
  specification_version: 4
206
209
  summary: OBS Deployment tool
207
210
  test_files: []