Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite for 6.0 #624

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
42ac505
Rewrite pt.1
alessandro-fazzi Apr 5, 2020
0fc74a1
Backport #595
alessandro-fazzi Nov 13, 2021
94cba67
This, if it will born, will be version 6
alessandro-fazzi Nov 13, 2021
754c0d0
Merge branch 'master' into rewrite_for_6.0
alessandro-fazzi Dec 26, 2021
99f977b
Update CI
alessandro-fazzi Dec 26, 2021
64e3a8e
Fix: after hooks must run even if db is skipped
alessandro-fazzi Dec 27, 2021
f4a42cd
Fix rspec warning
alessandro-fazzi Dec 27, 2021
0019aa2
Every inner standalone action's result must be verified
alessandro-fazzi Dec 27, 2021
20f4cd6
Improve handling of file deletion results
alessandro-fazzi Dec 27, 2021
59fc25b
Bump alpha version
alessandro-fazzi Dec 27, 2021
2475cae
Please the rubocop
alessandro-fazzi Dec 27, 2021
155fffd
Add --allow-root to all wpcli commands + fix a test
alessandro-fazzi Dec 27, 2021
f88ff20
Bump alpha version
alessandro-fazzi Dec 27, 2021
68bb8ac
Update hook spec making it more affordable
alessandro-fazzi Dec 30, 2021
ffbf302
Refactor: DB related tasks less context-conscious
alessandro-fazzi Dec 30, 2021
b9748b5
Fix Wpcli class.
alessandro-fazzi Dec 30, 2021
dc14a27
Please the rubocop
alessandro-fazzi Dec 30, 2021
d1b277e
Bump alpha version
alessandro-fazzi Dec 30, 2021
eb1a41b
Fix #616
alessandro-fazzi Dec 30, 2021
023784b
Bump alpha version
alessandro-fazzi Dec 30, 2021
c3346c6
Wordmove does not require anymore various local config
alessandro-fazzi Jan 4, 2022
e21da41
Remove some unwanted stdout prints
alessandro-fazzi Jan 3, 2022
7f5df0e
Better message when NoAdapterFound is raised
alessandro-fazzi Jan 4, 2022
46e9ce9
Merge pull request #625 from welaika/wpcli_all_the_way
alessandro-fazzi Jan 4, 2022
f4eb848
Ruby 3.1.0, update deps
alessandro-fazzi Jan 4, 2022
cad0b2b
Bump alpha version
alessandro-fazzi Jan 4, 2022
5dfcde2
Use alpha docker image on github actions
alessandro-fazzi Jan 4, 2022
24736e5
Useless to skip SetupContextForDb when simulate and it brings bugs
alessandro-fazzi Jan 4, 2022
87ec1a1
Bump alpha version
alessandro-fazzi Jan 4, 2022
ab39a4a
Fix: vhost must be populated with `home` wp option, not `siteurl`
alessandro-fazzi Jan 4, 2022
a1b1d83
Bump alpha version
alessandro-fazzi Jan 4, 2022
f273f94
Move from rdebug-ide/byebug to debugger.gem
alessandro-fazzi Jan 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,23 @@ on:

jobs:
test:

runs-on: ubuntu-latest
container:
image: welaika/wordmove:php7-wordmove6

steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
- name: Cache gems
uses: actions/cache@v2
with:
ruby-version: 2.6
path: .vendor/bundle
key: wordmove-${{ hashFiles('wordmove.gemspec') }}
- name: Install bundler
run: |
echo $(pwd)
bundle config set path .vendor/bundle
gem install bundler:2.3.3
- name: Install dependencies
run: bundle install
run : bundle install
- name: Run tests
run: bundle exec rake
7 changes: 2 additions & 5 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
AllCops:
TargetRubyVersion: 2.6
TargetRubyVersion: 3.1.0
DisplayCopNames: true
DisplayStyleGuide: true
NewCops: enable

Exclude:
- 'bin/*'
Expand All @@ -27,10 +28,6 @@ Metrics/CyclomaticComplexity:
Metrics/PerceivedComplexity:
Max: 10

Style/StringLiterals:
Enabled: false
EnforcedStyle: double_quotes

Style/Documentation:
Enabled: false

Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.5
3.1.0
69 changes: 25 additions & 44 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,53 @@
"version": "0.2.0",
"configurations": [
{
"name": "Debug Local File",
"type": "Ruby",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/main.rb"
"type": "rdbg",
"name": "Attach to remote rdbg",
"request": "attach"
},
{
"name": "Listen for rdebug-ide",
"type": "Ruby",
"request": "attach",
"cwd": "${workspaceRoot}",
"remoteHost": "127.0.0.1",
"remotePort": "1234",
"remoteWorkspaceRoot": "${workspaceRoot}"
"type": "rdbg",
"name": "Debug current file",
"request": "launch",
"script": "${file}",
"askParameters": true
},
{
"name": "Rails server",
"name": "Debug Local File",
"type": "Ruby",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/bin/rails",
"args": [
"server"
]
"program": "${workspaceRoot}/main.rb"
},
{
"name": "RSpec - all",
"type": "Ruby",
"type": "rdbg",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/bin/rspec",
"args": [
"-I",
"${workspaceRoot}"
]
"command": "bundle exec",
"script": "rspec",
"askParameters": false,
"args": []
},
{
"name": "RSpec - active spec file only",
"type": "Ruby",
"type": "rdbg",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/bin/rspec",
"args": [
"-I",
"${workspaceRoot}",
"${file}"
]
"command": "bundle exec rspec",
"script": "${file}",
"askParameters": false,
"args": []
},
{
"name": "RSpec - active test only",
"type": "Ruby",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/bin/rspec",
"args": [
"-I",
"${workspaceRoot}",
"${file}:${lineNumber}"
]
},
{
"name": "Cucumber",
"type": "Ruby",
"type": "rdbg",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/bin/cucumber"
"command": "bundle exec rspec",
"script": "${file}:${lineNumber}",
"askParameters": false,
"args": []
}
]
}
1 change: 1 addition & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--plugin activesupport-concern
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,21 @@ or run the executable directly
bin/wordmove --version
```

#### Documenting

A large part of the code is documented using https://yardoc.org/.

Please, stick with this practice when you're implementing new code. If you want to preview yard
documentation locally

```
yard server -r
```

then visit the served HTML at http://localhost:8808.

YARD documentation is automatically published by rubygems site at each release.

### Maintainer tasks

ToDo:
Expand Down
7 changes: 4 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'

RSpec::Core::RakeTask.new(:spec)
task default: :spec
RuboCop::RakeTask.new(:rubocop)

task default: :rubocop
task default: :spec
3 changes: 2 additions & 1 deletion exe/wordmove
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)

require 'wordmove'
Wordmove::CLI.start

Dry::CLI.new(Wordmove::CLI::Commands).call
46 changes: 34 additions & 12 deletions lib/wordmove.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@
require 'active_support/core_ext'
require 'colorize'
require 'dotenv'
require 'dry/cli'
require 'dry-configurable'
require 'dry/files'
require 'erb'
require 'kwalify'
require 'light-service'
require 'logger'
require 'open-uri'
require 'ostruct'
require 'thor'
require 'thor/group'
require 'yaml'

require 'photocopier'

require 'wordmove/wpcli'

require 'wordmove/cli'
require 'wordmove/doctor'
require 'wordmove/doctor/movefile'
Expand All @@ -27,20 +31,38 @@
require 'wordmove/hook'
require 'wordmove/logger'
require 'wordmove/movefile'
require 'wordmove/sql_adapter/default'
require 'wordmove/sql_adapter/wpcli'
require 'wordmove/wordpress_directory'
require "wordmove/version"
require "wordmove/environments_list"
require 'wordmove/version'
require 'wordmove/environments_list'

require 'wordmove/generators/movefile_adapter'
require 'wordmove/generators/movefile'

require 'wordmove/deployer/base'
require 'wordmove/deployer/ftp'
require 'wordmove/deployer/ssh'
require 'wordmove/deployer/ssh/default_sql_adapter'
require 'wordmove/deployer/ssh/wpcli_sql_adapter'
require 'wordmove/db_paths_config'

require 'wordmove/actions/helpers'
require 'wordmove/actions/ssh/helpers'
require 'wordmove/actions/ftp/helpers'
Dir[File.join(__dir__, 'wordmove/actions/**/*.rb')].each { |file| require file }
Dir[File.join(__dir__, 'wordmove/organizers/**/*.rb')].each { |file| require file }

module Wordmove
# Interactors' namespce. Interactors are called "Actions", following the LightService convention.
# In this namespace there are two kinds of "Actions":
# * local environment actions
# * protocol agnostic remote environment actions
# @see https://github.com/adomokos/light-service/blob/master/README.md LightService README
module Actions
# Ssh actions' namespace. Here are SSH protocol specific actions and organizers
# for remote environments
module Ssh
end
end

# Organizers are responsible of running organizer procedures putting together Actions
# following business logic requirements.
module Organizers
# Organizers for the Ssh protocol
module Ssh
end
end
end
Loading