obs_deploy 0.2.2 → 0.2.3

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: 41cc050c5b998c658f9e490356baecffde0c4d20c8f9856cb3f9d9365e47ff2d
4
- data.tar.gz: 9c4bf4468558287c91bcce67af42af569020d4414d9676fd535bbb6ea503f81d
3
+ metadata.gz: 0c30ef3de78c4686ec7f27a73e2824653a845b86156c5c35d0d3458896195116
4
+ data.tar.gz: 93d7393cb93c865a4a87e11cfa24eb4df35cfff12f5b3921da639adbee14b29d
5
5
  SHA512:
6
- metadata.gz: 3935393353a5b72e06bccc8ae92c9dc53f1047fe20d8d7597c8ed80d081e4e1f17a6e816c9f61c5a1fd13c3b1293e51695e1aa2126a23c17d57957a3534124c3
7
- data.tar.gz: acdfdcde737dd62fbdfde71225a4a71878118671f5a3b9c638090478c2ee8cea3cb0e56b35042caf009b8de4e682b169b8929a028dd9142666b28294e210b4cc
6
+ metadata.gz: f4b1b7da0b1112e5ac195f8fdcb5a373db76c2fa79fe10ba76753fbd0933ae834d23c4a2575f88e3ca52540c2ca9cc81464be0eb954c3a6ffd46b5f43895ce87
7
+ data.tar.gz: 01dd7034cb873265620005cc2a6cd00e616ffa2c364397aa4a8be3358998831b5e7c8e4e354e17db165165b02e80a742e74227cb58050471f6b1b9e19c4c120d
data/.rubocop.yml ADDED
@@ -0,0 +1,26 @@
1
+ # The behavior of RuboCop can be controlled via the .rubocop.yml
2
+ # configuration file. It makes it possible to enable/disable
3
+ # certain cops (checks) and to alter their behavior if they accept
4
+ # any parameters. The file can be placed either in your home
5
+ # directory or in some project directory.
6
+ #
7
+ # RuboCop will start looking for the configuration file in the directory
8
+ # where the inspected file is and continue its way up to the root directory.
9
+ #
10
+ # See https://github.com/rubocop-hq/rubocop/blob/master/manual/configuration.md
11
+
12
+ AllCops:
13
+ Exclude:
14
+ - 'dist/rubygem-obs_deploy.spec'
15
+
16
+ Metrics/BlockLength:
17
+ Enabled: false
18
+
19
+ Layout/LineLength:
20
+ Enabled: false
21
+
22
+ Layout/LineLength:
23
+ Enabled: false
24
+
25
+ Style/Documentation:
26
+ Enabled: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- obs_deploy (0.2.2)
4
+ obs_deploy (0.2.3)
5
5
  cheetah
6
6
  dry-cli
7
7
  nokogiri
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ObsDeploy
4
+ class ApacheSysconfig
5
+ attr_reader :apache_sysconfig
6
+
7
+ def initialize
8
+ @apache_sysconfig = '/etc/sysconfig/apache2'
9
+ end
10
+
11
+ def enable_maintenance_mode
12
+ write_apache_sysconfig('APACHE_SERVER_FLAGS="STATUS MAINTENANCE"')
13
+ end
14
+
15
+ def disable_maintenance_mode
16
+ write_apache_sysconfig('APACHE_SERVER_FLAGS="STATUS"')
17
+ end
18
+
19
+ def maintenance_mode?
20
+ File.open(apache_sysconfig).read.include?('MAINTENANCE')
21
+ end
22
+
23
+ private
24
+
25
+ def write_apache_sysconfig(line)
26
+ File.open(apache_sysconfig, 'w') do |file|
27
+ file.write(line)
28
+ end
29
+ end
30
+ end
31
+ end
@@ -10,6 +10,14 @@ module ObsDeploy
10
10
  run ['systemctl'] + ['list-dependencies'] + target
11
11
  end
12
12
 
13
+ def restart_apache
14
+ run ['systemctl'] + ['restart'] + ['apache2']
15
+ end
16
+
17
+ def status_apache
18
+ run ['systemctl'] + ['status'] + ['apache2']
19
+ end
20
+
13
21
  private
14
22
 
15
23
  def target
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ObsDeploy
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.3'
5
5
  end
data/lib/obs_deploy.rb CHANGED
@@ -11,6 +11,7 @@ require 'obs_deploy/check_diff'
11
11
  require 'obs_deploy/ssh'
12
12
  require 'obs_deploy/zypper'
13
13
  require 'obs_deploy/systemctl'
14
+ require 'obs_deploy/apache_sysconfig'
14
15
 
15
16
  module ObsDeploy
16
17
  class Error < StandardError; 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.2
4
+ version: 0.2.3
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-17 00:00:00.000000000 Z
11
+ date: 2020-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -149,6 +149,7 @@ files:
149
149
  - ".circleci/config.yml"
150
150
  - ".gitignore"
151
151
  - ".rspec"
152
+ - ".rubocop.yml"
152
153
  - ".travis.yml"
153
154
  - Dockerfile
154
155
  - Gemfile
@@ -163,6 +164,7 @@ files:
163
164
  - dist/rubygem-obs_deploy.spec
164
165
  - entrypoint.sh
165
166
  - lib/obs_deploy.rb
167
+ - lib/obs_deploy/apache_sysconfig.rb
166
168
  - lib/obs_deploy/check_diff.rb
167
169
  - lib/obs_deploy/cli/commands.rb
168
170
  - lib/obs_deploy/cli/commands/deploy.rb