capistrano-ops 1.0.11 → 1.1.0
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/.github/dependabot.yml +18 -0
- data/.github/workflows/ci.yml +44 -0
- data/.github/workflows/release.yml +1 -1
- data/.gitignore +1 -0
- data/.rspec +3 -0
- data/.rubocop.yml +5 -5
- data/.rubocop_todo.yml +55 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +37 -1
- data/README.md +14 -5
- data/Rakefile +5 -1
- data/bin/console +1 -1
- data/capistrano-ops.gemspec +10 -8
- data/lib/capistrano/ops/backup/helper.rb +4 -4
- data/lib/capistrano/ops/backup/tasks/database/create.rake +1 -0
- data/lib/capistrano/ops/backup/tasks/database/pull.rake +1 -0
- data/lib/capistrano/ops/backup/tasks/storage/create.rake +1 -0
- data/lib/capistrano/ops/backup/tasks/storage/pull.rake +1 -0
- data/lib/capistrano/ops/figaro_yml/helpers.rb +3 -6
- data/lib/capistrano/ops/figaro_yml/tasks/check.rake +1 -0
- data/lib/capistrano/ops/figaro_yml/tasks/check_config_present.rake +1 -0
- data/lib/capistrano/ops/figaro_yml/tasks/check_figaro_file_exists.rake +1 -0
- data/lib/capistrano/ops/figaro_yml/tasks/check_git_tracking.rake +1 -0
- data/lib/capistrano/ops/figaro_yml/tasks/create_local.rake +1 -0
- data/lib/capistrano/ops/figaro_yml/tasks/figaro_yml_symlink.rake +1 -0
- data/lib/capistrano/ops/figaro_yml/tasks/get.rake +4 -3
- data/lib/capistrano/ops/figaro_yml/tasks/get_stage.rake +1 -0
- data/lib/capistrano/ops/figaro_yml/tasks/sort_local.rake +1 -0
- data/lib/capistrano/ops/figaro_yml.rb +2 -1
- data/lib/capistrano/ops/invoke/tasks/invoke.rake +1 -1
- data/lib/capistrano/ops/logrotate/paths.rb +2 -0
- data/lib/capistrano/ops/logrotate/tasks/disable.rake +1 -0
- data/lib/capistrano/ops/logrotate.rb +2 -1
- data/lib/capistrano/ops/rails/lib/backup/api.rb +1 -1
- data/lib/capistrano/ops/rails/lib/backup/s3.rb +9 -8
- data/lib/capistrano/ops/rails/lib/backup.rb +2 -0
- data/lib/capistrano/ops/rails/lib/notification/api.rb +1 -1
- data/lib/capistrano/ops/rails/lib/notification/slack.rb +4 -4
- data/lib/capistrano/ops/rails/lib/notification/webhook.rb +4 -4
- data/lib/capistrano/ops/rails/lib/tasks/pg/dump.rake +3 -3
- data/lib/capistrano/ops/rails/lib/tasks/pg/postgres_helper.rb +3 -3
- data/lib/capistrano/ops/rails/lib/tasks/pg/remove_old_dumps.rake +1 -1
- data/lib/capistrano/ops/rails/lib/tasks/storage/backup.rake +1 -1
- data/lib/capistrano/ops/rails/lib/tasks/storage/remove_old_backups.rake +2 -2
- data/lib/capistrano/ops/rails/lib/tasks/storage/storage_helper.rb +5 -5
- data/lib/capistrano/ops/version.rb +1 -1
- data/lib/capistrano/ops/whenever.rb +2 -1
- data/lib/capistrano/ops/wkhtmltopdf/tasks/setup.rake +1 -0
- data/spec/capistrano/ops/version_spec.rb +9 -0
- data/spec/spec_helper.rb +20 -0
- metadata +58 -27
- data/.travis.yml +0 -13
- data/lib/capistrano/ops/capistrano/v3/tasks/backup.rake +0 -25
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 708599bef12f8e7ce1b96a36fb09c1bc9acc4d50d871f2d1d5a3790240455096
|
|
4
|
+
data.tar.gz: 8c13bfc221324e6303f474453185f868d9984dba83da63de7715b747d9113594
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3bd6ada29edf5e6a3c077c35a83908d1b40e235b0f33497a33b309e7902ea4fe16910a078e41b5bd5feb58246d4903e31b31d32567d88341ec5847c89a435aa9
|
|
7
|
+
data.tar.gz: 2d987eaaab73c8c5a6f595226371c8979d816656e3014fa744b1725bb27dff4e82cdd66d79e92dcc89fd2963dc03f5c3e6f5ede7a85c0fc33f639c7ff9e0dcfa
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: bundler
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: weekly
|
|
7
|
+
open-pull-requests-limit: 5
|
|
8
|
+
labels:
|
|
9
|
+
- dependencies
|
|
10
|
+
- ruby
|
|
11
|
+
|
|
12
|
+
- package-ecosystem: github-actions
|
|
13
|
+
directory: "/"
|
|
14
|
+
schedule:
|
|
15
|
+
interval: weekly
|
|
16
|
+
labels:
|
|
17
|
+
- dependencies
|
|
18
|
+
- ci
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
lint:
|
|
10
|
+
name: RuboCop
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- uses: ruby/setup-ruby@v1
|
|
15
|
+
with:
|
|
16
|
+
ruby-version-file: .ruby-version
|
|
17
|
+
bundler-cache: true
|
|
18
|
+
- run: bundle exec rubocop --parallel
|
|
19
|
+
|
|
20
|
+
audit:
|
|
21
|
+
name: bundler-audit
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
- uses: ruby/setup-ruby@v1
|
|
26
|
+
with:
|
|
27
|
+
ruby-version-file: .ruby-version
|
|
28
|
+
bundler-cache: true
|
|
29
|
+
- run: bundle exec bundle-audit check --update
|
|
30
|
+
|
|
31
|
+
test:
|
|
32
|
+
name: RSpec (Ruby ${{ matrix.ruby }})
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
strategy:
|
|
35
|
+
fail-fast: false
|
|
36
|
+
matrix:
|
|
37
|
+
ruby: ['3.2', '3.3', '3.4']
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v4
|
|
40
|
+
- uses: ruby/setup-ruby@v1
|
|
41
|
+
with:
|
|
42
|
+
ruby-version: ${{ matrix.ruby }}
|
|
43
|
+
bundler-cache: true
|
|
44
|
+
- run: bundle exec rspec
|
data/.gitignore
CHANGED
data/.rspec
ADDED
data/.rubocop.yml
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
|
2
|
+
|
|
3
|
+
# RuboCop configuration for capistrano-ops gem
|
|
2
4
|
|
|
3
5
|
AllCops:
|
|
4
6
|
NewCops: enable
|
|
5
|
-
TargetRubyVersion: 3.
|
|
7
|
+
TargetRubyVersion: 3.2
|
|
6
8
|
SuggestExtensions: false
|
|
7
9
|
Exclude:
|
|
8
10
|
- 'vendor/**/*'
|
|
9
11
|
- 'tmp/**/*'
|
|
10
12
|
- 'bin/**/*'
|
|
13
|
+
- 'lib/capistrano/ops/local/**/*'
|
|
11
14
|
|
|
12
15
|
# Metrics
|
|
13
16
|
|
|
@@ -78,9 +81,6 @@ Layout/SpaceAroundMethodCallOperator:
|
|
|
78
81
|
Gemspec/DevelopmentDependencies:
|
|
79
82
|
Enabled: false
|
|
80
83
|
|
|
81
|
-
Gemspec/RequireMFA:
|
|
82
|
-
Enabled: false
|
|
83
|
-
|
|
84
84
|
Lint/RaiseException:
|
|
85
85
|
Enabled: true
|
|
86
86
|
|
data/.rubocop_todo.yml
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# This configuration was generated by
|
|
2
|
+
# `rubocop --auto-gen-config --auto-gen-only-exclude --no-auto-gen-timestamp`
|
|
3
|
+
# using RuboCop version 1.91.0.
|
|
4
|
+
# The point is for the user to remove these configuration records
|
|
5
|
+
# one by one as the offenses are removed from the code base.
|
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
|
8
|
+
|
|
9
|
+
# Offense count: 3
|
|
10
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
11
|
+
# Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
|
|
12
|
+
# URISchemes: http, https
|
|
13
|
+
Layout/LineLength:
|
|
14
|
+
Exclude:
|
|
15
|
+
- 'lib/capistrano/ops/rails/lib/tasks/pg/dump.rake'
|
|
16
|
+
- 'lib/capistrano/ops/rails/lib/tasks/storage/storage_helper.rb'
|
|
17
|
+
|
|
18
|
+
# Offense count: 1
|
|
19
|
+
# Configuration parameters: CountComments, Max, CountAsOne.
|
|
20
|
+
Metrics/ClassLength:
|
|
21
|
+
Exclude:
|
|
22
|
+
- 'lib/capistrano/ops/rails/lib/backup/s3.rb'
|
|
23
|
+
|
|
24
|
+
# Offense count: 1
|
|
25
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
|
26
|
+
Metrics/CyclomaticComplexity:
|
|
27
|
+
Exclude:
|
|
28
|
+
- 'lib/capistrano/ops/rails/lib/backup/s3.rb'
|
|
29
|
+
|
|
30
|
+
# Offense count: 1
|
|
31
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
|
32
|
+
Metrics/PerceivedComplexity:
|
|
33
|
+
Exclude:
|
|
34
|
+
- 'lib/capistrano/ops/rails/lib/backup/s3.rb'
|
|
35
|
+
|
|
36
|
+
# Offense count: 2
|
|
37
|
+
# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
|
|
38
|
+
# AllowedMethods: call
|
|
39
|
+
# WaywardPredicates: infinite?, nonzero?
|
|
40
|
+
Naming/PredicateMethod:
|
|
41
|
+
Exclude:
|
|
42
|
+
- 'lib/capistrano/ops/figaro_yml/helpers.rb'
|
|
43
|
+
- 'lib/capistrano/ops/logrotate/helpers.rb'
|
|
44
|
+
|
|
45
|
+
# Offense count: 1
|
|
46
|
+
Style/MultilineBlockChain:
|
|
47
|
+
Exclude:
|
|
48
|
+
- 'lib/capistrano/ops/figaro_yml/helpers.rb'
|
|
49
|
+
|
|
50
|
+
# Offense count: 1
|
|
51
|
+
# Configuration parameters: AllowedMethods.
|
|
52
|
+
# AllowedMethods: respond_to_missing?
|
|
53
|
+
Style/OptionalBooleanParameter:
|
|
54
|
+
Exclude:
|
|
55
|
+
- 'lib/capistrano/ops/rails/lib/tasks/storage/storage_helper.rb'
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.4.10
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.1.0] - 2026-09-18
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Add CI workflow (`.github/workflows/ci.yml`) with a Ruby matrix (3.2, 3.3, 3.4) running RSpec, plus separate RuboCop and bundler-audit jobs
|
|
15
|
+
- Add Dependabot config for weekly `bundler` and `github-actions` updates
|
|
16
|
+
- Add `bundler-audit` dev-dependency and Rake task
|
|
17
|
+
- Add minimal spec harness (`spec/spec_helper.rb`, `.rspec`, version smoke spec)
|
|
18
|
+
- Add `.rubocop_todo.yml` baseline for new cops that would require API-shape changes (metrics, predicate naming, keyword args)
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- Widen `required_ruby_version` to `>= 3.2` (previously `>= 3.1.4, < 3.4.0` — blocked Ruby 3.4/3.5)
|
|
23
|
+
- Add version bounds for `rails` (`>= 7.2, < 9`), `faraday` (`>= 2.0, < 3.0`) and `nokogiri` (`>= 1.15`)
|
|
24
|
+
- Bump `.ruby-version` to `3.4.10`; release workflow now reads it via `ruby-version-file`
|
|
25
|
+
- Bump `.rubocop.yml` `TargetRubyVersion` to `3.2` and enable `Gemspec/RequireMFA`
|
|
26
|
+
- Bump dev-dependencies: `bundler >= 2.4, < 5`, `rubocop ~> 1.80`, `rubocop-rake ~> 0.7`, `rubocop-rspec ~> 3.0`
|
|
27
|
+
- `rake` default now runs `spec` + `rubocop`
|
|
28
|
+
|
|
29
|
+
### Removed
|
|
30
|
+
|
|
31
|
+
- Remove obsolete `.travis.yml` (Travis CI is end-of-life)
|
|
32
|
+
- Remove stray `release.gem` build artifact from repo root
|
|
33
|
+
- Remove dead `lib/capistrano/ops/capistrano/v3/tasks/backup.rake`: never wired into `TaskLoader`, required a non-existent `backup_helper` file, and its deprecated tasks (`backup:create` / `backup:pull`) had been superseded by `backup:database:*`
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- Fix `NameError` in `Notification::Webhook#backup_notification` when notification level was `error` on a successful backup (`_notification_level` param was referenced without the underscore)
|
|
38
|
+
- Fix `bin/console`: required non-existent `capistrano/rake`; now requires `capistrano/ops`
|
|
39
|
+
- Correct copy-paste header in `.rubocop.yml` (was labeled for `ms-graph-mailer`)
|
|
40
|
+
|
|
41
|
+
### Docs
|
|
42
|
+
|
|
43
|
+
- Clarify optional runtime dependencies (`whenever`, `figaro`, `wicked_pdf`) in README; state Ruby and Rails floors explicitly
|
|
44
|
+
|
|
10
45
|
## [1.0.11] - 2025-12-22
|
|
11
46
|
|
|
12
47
|
### Added
|
|
@@ -276,7 +311,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
276
311
|
- Figaro YAML management
|
|
277
312
|
- Basic Capistrano integration
|
|
278
313
|
|
|
279
|
-
[Unreleased]: https://github.com/zauberware/capistrano-ops/compare/v1.0
|
|
314
|
+
[Unreleased]: https://github.com/zauberware/capistrano-ops/compare/v1.1.0...HEAD
|
|
315
|
+
[1.1.0]: https://github.com/zauberware/capistrano-ops/releases/tag/v1.1.0
|
|
280
316
|
[1.0.11]: https://github.com/zauberware/capistrano-ops/releases/tag/v1.0.11
|
|
281
317
|
[v1.0.10]: https://github.com/zauberware/capistrano-ops/compare/v1.0.9...v1.0.10
|
|
282
318
|
[v1.0.9]: https://github.com/zauberware/capistrano-ops/compare/v1.0.8...v1.0.9
|
data/README.md
CHANGED
|
@@ -78,14 +78,23 @@ The capistrano-ops gem is a valuable library, tailor-made for Rails DevOps profe
|
|
|
78
78
|
|
|
79
79
|
## Requirements
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
Runtime requirements pulled in by the gem itself:
|
|
82
|
+
|
|
83
|
+
- Ruby `>= 3.2`
|
|
84
|
+
- Rails `>= 7.2, < 9`
|
|
85
|
+
- `capistrano ~> 3.0` (in your app)
|
|
86
|
+
|
|
87
|
+
Optional runtime dependencies — the corresponding task groups are only
|
|
88
|
+
loaded when the gem is present in your `Gemfile`:
|
|
85
89
|
|
|
86
|
-
|
|
90
|
+
```ruby
|
|
91
|
+
gem 'whenever' # enables whenever:show_crontab
|
|
92
|
+
gem 'figaro' # enables figaro_yml:* tasks
|
|
93
|
+
gem 'wicked_pdf' # enables wkhtmltopdf:setup (with wkhtmltopdf-binary)
|
|
87
94
|
```
|
|
88
95
|
|
|
96
|
+
> hint: if you use other aws-sdk gems, it's possible that you have to update them too
|
|
97
|
+
|
|
89
98
|
[↑](#)
|
|
90
99
|
|
|
91
100
|
## Installation
|
data/Rakefile
CHANGED
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
require 'bundler/gem_tasks'
|
|
4
4
|
require 'rspec/core/rake_task'
|
|
5
|
+
require 'rubocop/rake_task'
|
|
6
|
+
require 'bundler/audit/task'
|
|
5
7
|
|
|
6
8
|
RSpec::Core::RakeTask.new(:spec)
|
|
9
|
+
RuboCop::RakeTask.new
|
|
10
|
+
Bundler::Audit::Task.new
|
|
7
11
|
|
|
8
|
-
task default:
|
|
12
|
+
task default: %i[spec rubocop]
|
|
9
13
|
|
|
10
14
|
namespace :version do
|
|
11
15
|
desc 'Bump patch version (0.1.0 -> 0.1.1)'
|
data/bin/console
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
require 'bundler/setup'
|
|
5
|
-
require 'capistrano/
|
|
5
|
+
require 'capistrano/ops'
|
|
6
6
|
|
|
7
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
|
8
8
|
# with your gem easier. You can also use a different console, if you like.
|
data/capistrano-ops.gemspec
CHANGED
|
@@ -18,15 +18,17 @@ Gem::Specification.new do |s|
|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
|
19
19
|
s.require_paths = ['lib']
|
|
20
20
|
|
|
21
|
-
s.required_ruby_version = '>= 3.
|
|
21
|
+
s.required_ruby_version = '>= 3.2'
|
|
22
22
|
s.add_dependency 'aws-sdk-s3', '~> 1.208'
|
|
23
|
-
s.add_dependency 'faraday'
|
|
24
|
-
s.add_dependency 'nokogiri'
|
|
25
|
-
s.add_dependency 'rails'
|
|
26
|
-
s.add_development_dependency 'bundler', '
|
|
23
|
+
s.add_dependency 'faraday', '>= 2.0', '< 3.0'
|
|
24
|
+
s.add_dependency 'nokogiri', '>= 1.15'
|
|
25
|
+
s.add_dependency 'rails', '>= 7.2', '< 9'
|
|
26
|
+
s.add_development_dependency 'bundler', '>= 2.4', '< 5'
|
|
27
|
+
s.add_development_dependency 'bundler-audit', '~> 0.9'
|
|
27
28
|
s.add_development_dependency 'rake', '~> 13.0'
|
|
28
29
|
s.add_development_dependency 'rspec', '~> 3.0'
|
|
29
|
-
s.add_development_dependency 'rubocop', '~> 1.
|
|
30
|
-
s.add_development_dependency 'rubocop-rake', '~> 0.
|
|
31
|
-
s.add_development_dependency 'rubocop-rspec', '~>
|
|
30
|
+
s.add_development_dependency 'rubocop', '~> 1.80'
|
|
31
|
+
s.add_development_dependency 'rubocop-rake', '~> 0.7'
|
|
32
|
+
s.add_development_dependency 'rubocop-rspec', '~> 3.0'
|
|
33
|
+
s.metadata['rubygems_mfa_required'] = 'true'
|
|
32
34
|
end
|
|
@@ -5,7 +5,7 @@ module Capistrano
|
|
|
5
5
|
module Backup
|
|
6
6
|
module Helper
|
|
7
7
|
def backup_file_name(type)
|
|
8
|
-
regex = type == 'storage' ? "'.{0,}
|
|
8
|
+
regex = type == 'storage' ? "'.{0,}.tar.gz'" : "'.{0,}.dump'"
|
|
9
9
|
@backup_file_name ||= capture "cd #{shared_path}/backups && ls -lt | grep -E -i #{regex} | head -n 1 | awk '{print $9}'"
|
|
10
10
|
end
|
|
11
11
|
|
|
@@ -26,7 +26,7 @@ module Capistrano
|
|
|
26
26
|
puts 'Temporary backup deleted'
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
def question(question, default = 'n', &
|
|
29
|
+
def question(question, default = 'n', &)
|
|
30
30
|
print "#{question} #{default.downcase == 'n' ? '(y/N)' : '(Y/n)'}: "
|
|
31
31
|
input = $stdin.gets.strip.downcase
|
|
32
32
|
answer = (input.empty? ? default : input).downcase.to_s
|
|
@@ -34,7 +34,7 @@ module Capistrano
|
|
|
34
34
|
if %w[y n].include?(answer)
|
|
35
35
|
yield(answer == 'y')
|
|
36
36
|
else
|
|
37
|
-
question(question, default, &
|
|
37
|
+
question(question, default, &)
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
|
|
@@ -47,7 +47,7 @@ module Capistrano
|
|
|
47
47
|
def size_str(size)
|
|
48
48
|
units = %w[B KB MB GB TB]
|
|
49
49
|
e = (Math.log(size) / Math.log(1024)).floor
|
|
50
|
-
s = format('%.2f', size.to_f / 1024**e)
|
|
50
|
+
s = format('%.2f', size.to_f / (1024**e))
|
|
51
51
|
s.sub(/\.?0*$/, units[e])
|
|
52
52
|
end
|
|
53
53
|
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require 'yaml'
|
|
4
4
|
|
|
5
|
-
# rubocop:disable Metrics/ModuleLength
|
|
5
|
+
# rubocop:disable-next Metrics/ModuleLength
|
|
6
6
|
module Capistrano
|
|
7
7
|
module Ops
|
|
8
8
|
module FigaroYml
|
|
@@ -63,7 +63,7 @@ module Capistrano
|
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def local_yaml
|
|
66
|
-
YAML.
|
|
66
|
+
YAML.safe_load_file(figaro_yml_local_path) || {}
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
def figaro_yml_env
|
|
@@ -162,9 +162,7 @@ module Capistrano
|
|
|
162
162
|
|
|
163
163
|
# file helpers
|
|
164
164
|
def write_to_file(file, content)
|
|
165
|
-
File.
|
|
166
|
-
f.write(content)
|
|
167
|
-
end
|
|
165
|
+
File.write(file, content)
|
|
168
166
|
end
|
|
169
167
|
|
|
170
168
|
def write_combined_yaml(yamls_combined)
|
|
@@ -180,4 +178,3 @@ module Capistrano
|
|
|
180
178
|
end
|
|
181
179
|
end
|
|
182
180
|
end
|
|
183
|
-
# rubocop:enable Metrics/ModuleLength
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
namespace :figaro_yml do
|
|
4
4
|
include Capistrano::Ops::FigaroYml::Paths
|
|
5
5
|
include Capistrano::Ops::FigaroYml::Helpers
|
|
6
|
+
|
|
6
7
|
task :get do
|
|
7
|
-
if
|
|
8
|
-
invoke 'figaro_yml:create_local'
|
|
9
|
-
else
|
|
8
|
+
if File.exist?(figaro_yml_local_path)
|
|
10
9
|
local_yml = local_figaro_yml(figaro_yml_env)
|
|
11
10
|
local_global, local_stage, local_rest = configs(local_yml, figaro_yml_env)
|
|
12
11
|
on release_roles :all do
|
|
@@ -40,6 +39,8 @@ namespace :figaro_yml do
|
|
|
40
39
|
# write to new file
|
|
41
40
|
write_combined_yaml(composed_yml.sort.to_h)
|
|
42
41
|
end
|
|
42
|
+
else
|
|
43
|
+
invoke 'figaro_yml:create_local'
|
|
43
44
|
end
|
|
44
45
|
end
|
|
45
46
|
end
|
|
@@ -4,4 +4,5 @@ require 'capistrano/ops/task_loader'
|
|
|
4
4
|
require 'capistrano/ops/figaro_yml/paths'
|
|
5
5
|
require 'capistrano/ops/figaro_yml/helpers'
|
|
6
6
|
|
|
7
|
-
TaskLoader.load_tasks_if_gem_present('figaro', 'figaro_yml/tasks',
|
|
7
|
+
TaskLoader.load_tasks_if_gem_present('figaro', 'figaro_yml/tasks',
|
|
8
|
+
'WARNING: Gemfile does not include figaro gem which is required for figaro_yml tasks')
|
|
@@ -6,7 +6,7 @@ namespace :invoke do
|
|
|
6
6
|
|
|
7
7
|
desc 'Execute a rake task on a remote server (cap invoke:rake TASK=db:migrate)'
|
|
8
8
|
task :rake do
|
|
9
|
-
task_name = ENV
|
|
9
|
+
task_name = ENV.fetch('TASK', nil)
|
|
10
10
|
unless task_name
|
|
11
11
|
puts "\n\nFailed! You need to specify the 'TASK' parameter!",
|
|
12
12
|
'Usage: cap <stage> invoke:rake TASK=your:task',
|
|
@@ -4,4 +4,5 @@ require 'capistrano/ops/task_loader'
|
|
|
4
4
|
require 'capistrano/ops/logrotate/helpers'
|
|
5
5
|
require 'capistrano/ops/logrotate/paths'
|
|
6
6
|
|
|
7
|
-
TaskLoader.load_tasks_if_gem_present('whenever', 'logrotate/tasks',
|
|
7
|
+
TaskLoader.load_tasks_if_gem_present('whenever', 'logrotate/tasks',
|
|
8
|
+
'WARNING: Gemfile does not include whenever gem which is required for logrotate tasks')
|
|
@@ -4,7 +4,7 @@ module Backup
|
|
|
4
4
|
class Api
|
|
5
5
|
attr_accessor :backup_provider, :provider_config
|
|
6
6
|
|
|
7
|
-
def initialize(provider: ENV
|
|
7
|
+
def initialize(provider: ENV.fetch('BACKUP_PROVIDER', nil), provider_config: {})
|
|
8
8
|
self.backup_provider = provider
|
|
9
9
|
self.provider_config = provider_config
|
|
10
10
|
end
|
|
@@ -12,8 +12,9 @@ module Backup
|
|
|
12
12
|
|
|
13
13
|
attr_accessor :endpoint, :region, :access_key_id, :secret_access_key, :s3_resource, :s3_client
|
|
14
14
|
|
|
15
|
-
def initialize(endpoint: ENV
|
|
16
|
-
|
|
15
|
+
def initialize(endpoint: ENV.fetch('S3_BACKUP_ENDPOINT',
|
|
16
|
+
nil), region: ENV.fetch('S3_BACKUP_REGION', nil), access_key_id: ENV.fetch('S3_BACKUP_KEY', nil),
|
|
17
|
+
secret_access_key: ENV.fetch('S3_BACKUP_SECRET', nil))
|
|
17
18
|
self.endpoint = endpoint
|
|
18
19
|
self.region = region
|
|
19
20
|
self.access_key_id = access_key_id
|
|
@@ -31,7 +32,7 @@ module Backup
|
|
|
31
32
|
|
|
32
33
|
def upload(backup_file, key)
|
|
33
34
|
begin
|
|
34
|
-
s3_resource.bucket(ENV
|
|
35
|
+
s3_resource.bucket(ENV.fetch('S3_BACKUP_BUCKET', nil)).object(key).upload_file(backup_file)
|
|
35
36
|
rescue Backup::Error => e
|
|
36
37
|
puts "Upload failed: #{e.message}"
|
|
37
38
|
raise e
|
|
@@ -49,7 +50,7 @@ module Backup
|
|
|
49
50
|
|
|
50
51
|
# rubocop:disable Metrics/MethodLength
|
|
51
52
|
def upload_file_as_stream(file_path, key)
|
|
52
|
-
bucket = ENV
|
|
53
|
+
bucket = ENV.fetch('S3_BACKUP_BUCKET', nil)
|
|
53
54
|
# Calculate total size of the file to be uploaded
|
|
54
55
|
total_size = File.size(file_path)
|
|
55
56
|
chunk_size = calculate_chunk_size(total_size)
|
|
@@ -130,7 +131,7 @@ module Backup
|
|
|
130
131
|
end
|
|
131
132
|
|
|
132
133
|
def upload_folder_as_tar_gz_stream(folder_path, key)
|
|
133
|
-
bucket = ENV
|
|
134
|
+
bucket = ENV.fetch('S3_BACKUP_BUCKET', nil)
|
|
134
135
|
|
|
135
136
|
# Calculate total size of the files to be uploaded
|
|
136
137
|
total_size = calculate_total_size(folder_path)
|
|
@@ -256,7 +257,7 @@ module Backup
|
|
|
256
257
|
end
|
|
257
258
|
|
|
258
259
|
def remove_old_backups(basename, keep: 5)
|
|
259
|
-
all_items = s3_resource.bucket(ENV
|
|
260
|
+
all_items = s3_resource.bucket(ENV.fetch('S3_BACKUP_BUCKET', nil)).objects(prefix: basename).map do |item|
|
|
260
261
|
{ key: item.key, last_modified: item.last_modified }
|
|
261
262
|
end
|
|
262
263
|
|
|
@@ -272,7 +273,7 @@ module Backup
|
|
|
272
273
|
puts "Removing #{month} from S3"
|
|
273
274
|
delete_items.each do |item_obj|
|
|
274
275
|
puts "Removing #{item_obj[:key]} from S3"
|
|
275
|
-
s3_resource.bucket(ENV
|
|
276
|
+
s3_resource.bucket(ENV.fetch('S3_BACKUP_BUCKET', nil)).object(item_obj[:key]).delete
|
|
276
277
|
end
|
|
277
278
|
end
|
|
278
279
|
puts 'Old months removed from S3'
|
|
@@ -286,7 +287,7 @@ module Backup
|
|
|
286
287
|
|
|
287
288
|
current_month_delete_items.each do |item_obj|
|
|
288
289
|
puts "Removing #{item_obj[:key]} from S3"
|
|
289
|
-
s3_resource.bucket(ENV
|
|
290
|
+
s3_resource.bucket(ENV.fetch('S3_BACKUP_BUCKET', nil)).object(item_obj[:key]).delete
|
|
290
291
|
end
|
|
291
292
|
puts 'Old backups removed from S3'
|
|
292
293
|
rescue Backup::Error => e
|
|
@@ -4,7 +4,7 @@ module Notification
|
|
|
4
4
|
class Api
|
|
5
5
|
attr_accessor :notification_type, :notification_level
|
|
6
6
|
|
|
7
|
-
def initialize(notification_type: ENV
|
|
7
|
+
def initialize(notification_type: ENV.fetch('NOTIFICATION_TYPE', nil), notification_level: ENV.fetch('NOTIFICATION_LEVEL', nil))
|
|
8
8
|
self.notification_type = notification_type
|
|
9
9
|
self.notification_level = notification_level || 'error'
|
|
10
10
|
end
|
|
@@ -6,8 +6,8 @@ require 'json'
|
|
|
6
6
|
module Notification
|
|
7
7
|
class Slack
|
|
8
8
|
def initialize
|
|
9
|
-
@slack_secret = ENV
|
|
10
|
-
@slack_channel = ENV
|
|
9
|
+
@slack_secret = ENV.fetch('SLACK_SECRET', nil)
|
|
10
|
+
@slack_channel = ENV.fetch('SLACK_CHANNEL', nil)
|
|
11
11
|
@conn = Faraday.new(url: 'https://slack.com/api/') do |faraday|
|
|
12
12
|
faraday.headers['Content-Type'] = 'application/json'
|
|
13
13
|
faraday.headers['Authorization'] = "Bearer #{@slack_secret}"
|
|
@@ -20,8 +20,8 @@ module Notification
|
|
|
20
20
|
begin
|
|
21
21
|
res = @conn.post('chat.postMessage') do |req|
|
|
22
22
|
req.body = {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
channel: @slack_channel,
|
|
24
|
+
text: message
|
|
25
25
|
}.to_json
|
|
26
26
|
end
|
|
27
27
|
response = JSON.parse(res.body)
|
|
@@ -7,18 +7,18 @@ module Notification
|
|
|
7
7
|
require 'json'
|
|
8
8
|
|
|
9
9
|
def initialize
|
|
10
|
-
@webhook_url = ENV
|
|
11
|
-
@secret = ENV
|
|
10
|
+
@webhook_url = ENV.fetch('WEBHOOK_URL', nil)
|
|
11
|
+
@secret = ENV.fetch('WEBHOOK_SECRET', nil)
|
|
12
12
|
@conn = Faraday.new(url: @webhook_url) do |faraday|
|
|
13
13
|
faraday.headers['Content-Type'] = 'application/json'
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def generate_signature(payload_body)
|
|
18
|
-
"md5=#{OpenSSL::HMAC.hexdigest('md5', ENV
|
|
18
|
+
"md5=#{OpenSSL::HMAC.hexdigest('md5', ENV.fetch('WEBHOOK_SECRET', nil), payload_body)}"
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
def backup_notification(result, webhook_data,
|
|
21
|
+
def backup_notification(result, webhook_data, notification_level)
|
|
22
22
|
return if @webhook_url.nil? || @secret.nil?
|
|
23
23
|
return if result && notification_level == 'error'
|
|
24
24
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative '
|
|
3
|
+
require_relative 'postgres_helper'
|
|
4
4
|
namespace :pg do
|
|
5
5
|
include PostgresHelper
|
|
6
6
|
|
|
@@ -25,11 +25,11 @@ namespace :pg do
|
|
|
25
25
|
result = system(commandlist)
|
|
26
26
|
|
|
27
27
|
if ENV['BACKUP_PROVIDER'].present? && external_backup && result
|
|
28
|
-
puts "Uploading #{filename} to #{ENV
|
|
28
|
+
puts "Uploading #{filename} to #{ENV.fetch('BACKUP_PROVIDER', nil)}..."
|
|
29
29
|
provider = Backup::Api.new
|
|
30
30
|
begin
|
|
31
31
|
provider.upload("#{backup_path}/#{filename}", filename.to_s, 'file')
|
|
32
|
-
puts "#{filename} uploaded to #{ENV
|
|
32
|
+
puts "#{filename} uploaded to #{ENV.fetch('BACKUP_PROVIDER', nil)}"
|
|
33
33
|
rescue StandardError => e
|
|
34
34
|
puts "#{filename} upload failed: #{e.message}"
|
|
35
35
|
end
|
|
@@ -27,7 +27,7 @@ module PostgresHelper
|
|
|
27
27
|
messages = []
|
|
28
28
|
if result
|
|
29
29
|
messages << "Backup of #{database} successfully finished at #{Time.now}"
|
|
30
|
-
messages << "Backup path
|
|
30
|
+
messages << "Backup path:`#{backup_path}/#{filename}`"
|
|
31
31
|
else
|
|
32
32
|
messages << "Backup of #{database} failed at #{Time.now}"
|
|
33
33
|
end
|
|
@@ -54,14 +54,14 @@ module PostgresHelper
|
|
|
54
54
|
commandlist = []
|
|
55
55
|
commandlist << "export PGPASSWORD='#{password}'"
|
|
56
56
|
commandlist << "cd #{backup_path}"
|
|
57
|
-
commandlist << "pg_dump --no-acl --no-owner #{options.join
|
|
57
|
+
commandlist << "pg_dump --no-acl --no-owner #{options.join} > #{filename}"
|
|
58
58
|
commandlist.join(' && ')
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
def size_str(size)
|
|
62
62
|
units = %w[B KB MB GB TB]
|
|
63
63
|
e = (Math.log(size) / Math.log(1024)).floor
|
|
64
|
-
s = format('%.2f', size.to_f / 1024**e)
|
|
64
|
+
s = format('%.2f', size.to_f / (1024**e))
|
|
65
65
|
s.sub(/\.?0*$/, units[e])
|
|
66
66
|
end
|
|
67
67
|
end
|
|
@@ -12,7 +12,7 @@ namespace :pg do
|
|
|
12
12
|
external_backup = Rails.env.production? || ENV['EXTERNAL_BACKUP_ENABLED'] == 'true'
|
|
13
13
|
|
|
14
14
|
task :remove_old_dumps do
|
|
15
|
-
bash_regex = "'#{@database}.{0,}
|
|
15
|
+
bash_regex = "'#{@database}.{0,}.dump'"
|
|
16
16
|
|
|
17
17
|
unless backups_enabled
|
|
18
18
|
puts 'remove_old_dumps: Backups are disabled'
|
|
@@ -14,7 +14,7 @@ namespace :storage do
|
|
|
14
14
|
@total_external_backups_no = (@env_external_no || ENV['NUMBER_OF_BACKUPS'] || 7).to_i
|
|
15
15
|
desc 'remove old storage backups'
|
|
16
16
|
task :remove_old_backups do
|
|
17
|
-
bash_regex = "'storage_.{0,}
|
|
17
|
+
bash_regex = "'storage_.{0,}.tar.gz'"
|
|
18
18
|
|
|
19
19
|
unless backups_enabled
|
|
20
20
|
puts 'remove_old_backups: Backups are disabled'
|
|
@@ -37,7 +37,7 @@ namespace :storage do
|
|
|
37
37
|
'xargs rm -rf'
|
|
38
38
|
]
|
|
39
39
|
|
|
40
|
-
result = system(commandlist.join(' | ')) if @total_local_backups_no.positive? && local_backup || !local_backup && external_backup
|
|
40
|
+
result = system(commandlist.join(' | ')) if (@total_local_backups_no.positive? && local_backup) || (!local_backup && external_backup)
|
|
41
41
|
puts 'remove_old_backups: local cleanup finished' if result
|
|
42
42
|
|
|
43
43
|
if ENV['BACKUP_PROVIDER'].present? && external_backup
|
|
@@ -9,7 +9,7 @@ module StorageHelper
|
|
|
9
9
|
backups_enabled: env_or_production('BACKUPS_ENABLED'),
|
|
10
10
|
external_backup: env_or_production('EXTERNAL_BACKUP_ENABLED'),
|
|
11
11
|
keep_local_backups: env_or_production('KEEP_LOCAL_STORAGE_BACKUPS'),
|
|
12
|
-
backup_provider: ENV
|
|
12
|
+
backup_provider: ENV.fetch('BACKUP_PROVIDER', nil)
|
|
13
13
|
}
|
|
14
14
|
end
|
|
15
15
|
|
|
@@ -23,7 +23,7 @@ module StorageHelper
|
|
|
23
23
|
messages = []
|
|
24
24
|
if result
|
|
25
25
|
messages << "Backup of storage folder successfully finished at #{Time.now}"
|
|
26
|
-
messages << "Backup path
|
|
26
|
+
messages << "Backup path:`#{@backup_path}/#{@filename}`"
|
|
27
27
|
else
|
|
28
28
|
messages << "Backup of storage folder failed at #{Time.now}"
|
|
29
29
|
end
|
|
@@ -34,19 +34,19 @@ module StorageHelper
|
|
|
34
34
|
@backup_path = settings[:backup_path]
|
|
35
35
|
@date = Time.now.to_i
|
|
36
36
|
@filename = "storage_#{@date}.tar.gz"
|
|
37
|
-
FileUtils.mkdir_p(@backup_path)
|
|
37
|
+
FileUtils.mkdir_p(@backup_path)
|
|
38
38
|
"tar -zcf #{@backup_path}/#{@filename} -C #{settings[:storage_path]} ."
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def size_str(size)
|
|
42
42
|
units = %w[B KB MB GB TB]
|
|
43
43
|
e = (Math.log(size) / Math.log(1024)).floor
|
|
44
|
-
s = format('%.2f', size.to_f / 1024**e)
|
|
44
|
+
s = format('%.2f', size.to_f / (1024**e))
|
|
45
45
|
s.sub(/\.?0*$/, units[e])
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
def create_local_backup(filename, storage_path, backup_path)
|
|
49
|
-
FileUtils.mkdir_p(backup_path)
|
|
49
|
+
FileUtils.mkdir_p(backup_path)
|
|
50
50
|
response = system(backup_cmd(backup_path: backup_path, storage_path: storage_path))
|
|
51
51
|
FileUtils.rm_rf("#{@backup_path}/#{filename}") unless response
|
|
52
52
|
puts response ? "Backup created: #{backup_path}/#{@filename} (#{size_str(File.size("#{@backup_path}/#{@filename}"))})" : 'Backup failed removing dump file'
|
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
require 'capistrano/ops/task_loader'
|
|
4
4
|
|
|
5
|
-
TaskLoader.load_tasks_if_gem_present('whenever', 'whenever/tasks',
|
|
5
|
+
TaskLoader.load_tasks_if_gem_present('whenever', 'whenever/tasks',
|
|
6
|
+
'WARNING: Gemfile does not include whenever gem which is required for whenever tasks')
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'capistrano/ops/version'
|
|
4
|
+
|
|
5
|
+
RSpec.configure do |config|
|
|
6
|
+
config.expect_with :rspec do |expectations|
|
|
7
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
config.mock_with :rspec do |mocks|
|
|
11
|
+
mocks.verify_partial_doubles = true
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
|
15
|
+
config.disable_monkey_patching!
|
|
16
|
+
config.warnings = false
|
|
17
|
+
config.default_formatter = 'doc' if config.files_to_run.one?
|
|
18
|
+
config.order = :random
|
|
19
|
+
Kernel.srand config.seed
|
|
20
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: capistrano-ops
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Florian Crusius
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: aws-sdk-s3
|
|
@@ -30,56 +29,88 @@ dependencies:
|
|
|
30
29
|
requirements:
|
|
31
30
|
- - ">="
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0'
|
|
32
|
+
version: '2.0'
|
|
33
|
+
- - "<"
|
|
34
|
+
- !ruby/object:Gem::Version
|
|
35
|
+
version: '3.0'
|
|
34
36
|
type: :runtime
|
|
35
37
|
prerelease: false
|
|
36
38
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
39
|
requirements:
|
|
38
40
|
- - ">="
|
|
39
41
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '0'
|
|
42
|
+
version: '2.0'
|
|
43
|
+
- - "<"
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '3.0'
|
|
41
46
|
- !ruby/object:Gem::Dependency
|
|
42
47
|
name: nokogiri
|
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
|
44
49
|
requirements:
|
|
45
50
|
- - ">="
|
|
46
51
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
52
|
+
version: '1.15'
|
|
48
53
|
type: :runtime
|
|
49
54
|
prerelease: false
|
|
50
55
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
56
|
requirements:
|
|
52
57
|
- - ">="
|
|
53
58
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
59
|
+
version: '1.15'
|
|
55
60
|
- !ruby/object:Gem::Dependency
|
|
56
61
|
name: rails
|
|
57
62
|
requirement: !ruby/object:Gem::Requirement
|
|
58
63
|
requirements:
|
|
59
64
|
- - ">="
|
|
60
65
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '
|
|
66
|
+
version: '7.2'
|
|
67
|
+
- - "<"
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: '9'
|
|
62
70
|
type: :runtime
|
|
63
71
|
prerelease: false
|
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
73
|
requirements:
|
|
66
74
|
- - ">="
|
|
67
75
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '
|
|
76
|
+
version: '7.2'
|
|
77
|
+
- - "<"
|
|
78
|
+
- !ruby/object:Gem::Version
|
|
79
|
+
version: '9'
|
|
69
80
|
- !ruby/object:Gem::Dependency
|
|
70
81
|
name: bundler
|
|
82
|
+
requirement: !ruby/object:Gem::Requirement
|
|
83
|
+
requirements:
|
|
84
|
+
- - ">="
|
|
85
|
+
- !ruby/object:Gem::Version
|
|
86
|
+
version: '2.4'
|
|
87
|
+
- - "<"
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '5'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '2.4'
|
|
97
|
+
- - "<"
|
|
98
|
+
- !ruby/object:Gem::Version
|
|
99
|
+
version: '5'
|
|
100
|
+
- !ruby/object:Gem::Dependency
|
|
101
|
+
name: bundler-audit
|
|
71
102
|
requirement: !ruby/object:Gem::Requirement
|
|
72
103
|
requirements:
|
|
73
104
|
- - "~>"
|
|
74
105
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '
|
|
106
|
+
version: '0.9'
|
|
76
107
|
type: :development
|
|
77
108
|
prerelease: false
|
|
78
109
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
110
|
requirements:
|
|
80
111
|
- - "~>"
|
|
81
112
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: '
|
|
113
|
+
version: '0.9'
|
|
83
114
|
- !ruby/object:Gem::Dependency
|
|
84
115
|
name: rake
|
|
85
116
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -114,42 +145,42 @@ dependencies:
|
|
|
114
145
|
requirements:
|
|
115
146
|
- - "~>"
|
|
116
147
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: '1.
|
|
148
|
+
version: '1.80'
|
|
118
149
|
type: :development
|
|
119
150
|
prerelease: false
|
|
120
151
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
152
|
requirements:
|
|
122
153
|
- - "~>"
|
|
123
154
|
- !ruby/object:Gem::Version
|
|
124
|
-
version: '1.
|
|
155
|
+
version: '1.80'
|
|
125
156
|
- !ruby/object:Gem::Dependency
|
|
126
157
|
name: rubocop-rake
|
|
127
158
|
requirement: !ruby/object:Gem::Requirement
|
|
128
159
|
requirements:
|
|
129
160
|
- - "~>"
|
|
130
161
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: '0.
|
|
162
|
+
version: '0.7'
|
|
132
163
|
type: :development
|
|
133
164
|
prerelease: false
|
|
134
165
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
166
|
requirements:
|
|
136
167
|
- - "~>"
|
|
137
168
|
- !ruby/object:Gem::Version
|
|
138
|
-
version: '0.
|
|
169
|
+
version: '0.7'
|
|
139
170
|
- !ruby/object:Gem::Dependency
|
|
140
171
|
name: rubocop-rspec
|
|
141
172
|
requirement: !ruby/object:Gem::Requirement
|
|
142
173
|
requirements:
|
|
143
174
|
- - "~>"
|
|
144
175
|
- !ruby/object:Gem::Version
|
|
145
|
-
version: '
|
|
176
|
+
version: '3.0'
|
|
146
177
|
type: :development
|
|
147
178
|
prerelease: false
|
|
148
179
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
180
|
requirements:
|
|
150
181
|
- - "~>"
|
|
151
182
|
- !ruby/object:Gem::Version
|
|
152
|
-
version: '
|
|
183
|
+
version: '3.0'
|
|
153
184
|
description: A collection of devops tasks for rails applications
|
|
154
185
|
email:
|
|
155
186
|
- florian@zauberware.com
|
|
@@ -159,11 +190,14 @@ executables:
|
|
|
159
190
|
extensions: []
|
|
160
191
|
extra_rdoc_files: []
|
|
161
192
|
files:
|
|
193
|
+
- ".github/dependabot.yml"
|
|
194
|
+
- ".github/workflows/ci.yml"
|
|
162
195
|
- ".github/workflows/release.yml"
|
|
163
196
|
- ".gitignore"
|
|
197
|
+
- ".rspec"
|
|
164
198
|
- ".rubocop.yml"
|
|
199
|
+
- ".rubocop_todo.yml"
|
|
165
200
|
- ".ruby-version"
|
|
166
|
-
- ".travis.yml"
|
|
167
201
|
- CHANGELOG.md
|
|
168
202
|
- Gemfile
|
|
169
203
|
- LICENSE.txt
|
|
@@ -180,7 +214,6 @@ files:
|
|
|
180
214
|
- lib/capistrano/ops/backup/tasks/storage/create.rake
|
|
181
215
|
- lib/capistrano/ops/backup/tasks/storage/pull.rake
|
|
182
216
|
- lib/capistrano/ops/capistrano.rb
|
|
183
|
-
- lib/capistrano/ops/capistrano/v3/tasks/backup.rake
|
|
184
217
|
- lib/capistrano/ops/figaro_yml.rb
|
|
185
218
|
- lib/capistrano/ops/figaro_yml/helpers.rb
|
|
186
219
|
- lib/capistrano/ops/figaro_yml/paths.rb
|
|
@@ -239,11 +272,13 @@ files:
|
|
|
239
272
|
- lib/capistrano/ops/wkhtmltopdf/helpers.rb
|
|
240
273
|
- lib/capistrano/ops/wkhtmltopdf/tasks/setup.rake
|
|
241
274
|
- scripts/bump_version.rb
|
|
275
|
+
- spec/capistrano/ops/version_spec.rb
|
|
276
|
+
- spec/spec_helper.rb
|
|
242
277
|
homepage: https://github.com/zauberware/capistrano-ops
|
|
243
278
|
licenses:
|
|
244
279
|
- MIT
|
|
245
|
-
metadata:
|
|
246
|
-
|
|
280
|
+
metadata:
|
|
281
|
+
rubygems_mfa_required: 'true'
|
|
247
282
|
rdoc_options: []
|
|
248
283
|
require_paths:
|
|
249
284
|
- lib
|
|
@@ -251,18 +286,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
251
286
|
requirements:
|
|
252
287
|
- - ">="
|
|
253
288
|
- !ruby/object:Gem::Version
|
|
254
|
-
version: 3.
|
|
255
|
-
- - "<"
|
|
256
|
-
- !ruby/object:Gem::Version
|
|
257
|
-
version: 3.4.0
|
|
289
|
+
version: '3.2'
|
|
258
290
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
259
291
|
requirements:
|
|
260
292
|
- - ">="
|
|
261
293
|
- !ruby/object:Gem::Version
|
|
262
294
|
version: '0'
|
|
263
295
|
requirements: []
|
|
264
|
-
rubygems_version: 3.
|
|
265
|
-
signing_key:
|
|
296
|
+
rubygems_version: 3.6.9
|
|
266
297
|
specification_version: 4
|
|
267
298
|
summary: devops tasks for rails applications
|
|
268
299
|
test_files: []
|
data/.travis.yml
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative 'backup/backup_helper'
|
|
4
|
-
|
|
5
|
-
namespace :backup do
|
|
6
|
-
include BackupHelper
|
|
7
|
-
# Default to :app role
|
|
8
|
-
rake_roles = fetch(:rake_roles, :app)
|
|
9
|
-
|
|
10
|
-
desc 'create a backup of the server database (deprecated, use backup:database:create instead)'
|
|
11
|
-
task :create do
|
|
12
|
-
on roles(rake_roles) do
|
|
13
|
-
warn "deprecated: use 'backup:database:create' instead, in future versions this task will be removed"
|
|
14
|
-
execute "#{prepare_env} BACKUPS_ENABLED=true EXTERNAL_BACKUP_ENABLED=false bundle exec rake pg:dump"
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
desc 'pull latest database backups from server to local (deprecated, use backup:database:pull instead)'
|
|
18
|
-
task :pull do
|
|
19
|
-
on roles(rake_roles) do
|
|
20
|
-
warn "deprecated: use 'backup:database:pull' instead, in future versions this task will be removed"
|
|
21
|
-
backup_file = backup_file_name('database')
|
|
22
|
-
download! "#{shared_path}/backups/#{backup_file}", backup_file
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|