obs_deploy 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +26 -0
- data/Gemfile.lock +1 -1
- data/lib/obs_deploy/apache_sysconfig.rb +31 -0
- data/lib/obs_deploy/systemctl.rb +8 -0
- data/lib/obs_deploy/version.rb +1 -1
- data/lib/obs_deploy.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c30ef3de78c4686ec7f27a73e2824653a845b86156c5c35d0d3458896195116
|
4
|
+
data.tar.gz: 93d7393cb93c865a4a87e11cfa24eb4df35cfff12f5b3921da639adbee14b29d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
@@ -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
|
data/lib/obs_deploy/systemctl.rb
CHANGED
@@ -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
|
data/lib/obs_deploy/version.rb
CHANGED
data/lib/obs_deploy.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.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-
|
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
|