capistrano-wordpress-permissions 1.0.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 +7 -0
- data/.gitignore +11 -0
- data/.travis.yml +7 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +36 -0
- data/LICENSE.txt +21 -0
- data/README.md +53 -0
- data/Rakefile +1 -0
- data/capistrano-wordpress.gemspec +22 -0
- data/lib/capistrano/wordpress.rb +7 -0
- data/lib/capistrano/wordpress/permissions.rb +35 -0
- data/lib/capistrano/wordpress/version.rb +5 -0
- metadata +84 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 03b437db9bd30526f6f114fc9d1221f83eab896eeed5b6ef05ba7840d6e32c63
|
4
|
+
data.tar.gz: f49e97b276f34372e31d2d997e41f365d4e49f6ff9df090234adaa60e88c1fe1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 902c853798c78b054e94cff8a9f9543fb98d06e8fbf5b3da2a3b216b1f2df34e1fbee9f2b3570e37146882bb50e87155f18ac3ecbc79aa2a15c77024de3dd07b
|
7
|
+
data.tar.gz: 791e3d09cc628c8e14e20ebd9a9eec31769a690be36b7528dd97ad497a13bcab10c5edc282cd6a027e5e7cc7bc590408e3cae4dbfc854d55a80a1c07f4c5d0dc
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
capistrano-wordpress-permissions (0.1.0)
|
5
|
+
capistrano (~> 3)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
airbrussh (1.3.1)
|
11
|
+
sshkit (>= 1.6.1, != 1.7.0)
|
12
|
+
capistrano (3.11.0)
|
13
|
+
airbrussh (>= 1.0.0)
|
14
|
+
i18n
|
15
|
+
rake (>= 10.0.0)
|
16
|
+
sshkit (>= 1.9.0)
|
17
|
+
concurrent-ruby (1.1.4)
|
18
|
+
i18n (1.5.3)
|
19
|
+
concurrent-ruby (~> 1.0)
|
20
|
+
net-scp (1.2.1)
|
21
|
+
net-ssh (>= 2.6.5)
|
22
|
+
net-ssh (5.1.0)
|
23
|
+
rake (12.3.0)
|
24
|
+
sshkit (1.18.2)
|
25
|
+
net-scp (>= 1.1.2)
|
26
|
+
net-ssh (>= 2.8.0)
|
27
|
+
|
28
|
+
PLATFORMS
|
29
|
+
ruby
|
30
|
+
|
31
|
+
DEPENDENCIES
|
32
|
+
bundler (~> 2.0)
|
33
|
+
capistrano-wordpress-permissions!
|
34
|
+
|
35
|
+
BUNDLED WITH
|
36
|
+
2.0.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 alexzicat
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# Capistrano::Wordpress
|
2
|
+
|
3
|
+
Changes the releases' owner to the Wordpress user, in order to be able to install and update plugins.
|
4
|
+
## Installation
|
5
|
+
|
6
|
+
Add this line to your application's Gemfile:
|
7
|
+
|
8
|
+
```ruby
|
9
|
+
gem 'capistrano-wordpress-permissions'
|
10
|
+
```
|
11
|
+
|
12
|
+
And then execute:
|
13
|
+
|
14
|
+
$ bundle
|
15
|
+
|
16
|
+
Or install it yourself as:
|
17
|
+
|
18
|
+
$ gem install capistrano-wordpress
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
Add the following lines inside your Capfile:
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
require 'capistrano/wordpress/permissions'
|
26
|
+
install_plugin Capistrano::Wordpress::Permissions
|
27
|
+
```
|
28
|
+
|
29
|
+
This plugin needs to fetch the deployment user.
|
30
|
+
It is thereby necessary to set it in your configuration file(s):
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
set :user, '[REPLACE_WITH_DEPLOYMENT_USER]'
|
34
|
+
```
|
35
|
+
|
36
|
+
By default, this plugin use the wordpress user "www-data".
|
37
|
+
It is possible to change this user in your configuration file(s):
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
set :wordpress_user, '[YOUR_WORDPRESS_USER]'
|
41
|
+
```
|
42
|
+
|
43
|
+
## Contributing
|
44
|
+
|
45
|
+
1. Fork the repository
|
46
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
47
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
48
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
49
|
+
5. Create a new Pull Request
|
50
|
+
|
51
|
+
## License
|
52
|
+
|
53
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'capistrano/wordpress/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.version = Capistrano::Wordpress::VERSION
|
7
|
+
spec.name = 'capistrano-wordpress-permissions'
|
8
|
+
spec.authors = ['Alexandre Zicat']
|
9
|
+
spec.email = ['alexzicat@teamhubble.com']
|
10
|
+
|
11
|
+
spec.summary = %q{Changes the releases' owner to the Wordpress user.}
|
12
|
+
spec.description = %q{Changes the releases' owner to the Wordpress user, in order to be able to install and update plugins.}
|
13
|
+
spec.homepage = 'https://github.com/teamhubble/capistrano-wordpress'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.require_paths = ['lib']
|
18
|
+
|
19
|
+
spec.add_dependency 'capistrano', '~> 3'
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
22
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Capistrano
|
2
|
+
module Wordpress
|
3
|
+
class Permissions < Capistrano::Plugin
|
4
|
+
|
5
|
+
def set_defaults
|
6
|
+
set_if_empty(:wordpress_user, :'www-data')
|
7
|
+
end
|
8
|
+
|
9
|
+
def define_tasks
|
10
|
+
namespace(:wordpress) do
|
11
|
+
desc('Changes the releases owner to the Wordpress user.')
|
12
|
+
task(:change_owner_to_wordpress) {change_owner(fetch(:wordpress_user))}
|
13
|
+
|
14
|
+
desc('Changes the releases owner to the deployment user.')
|
15
|
+
task(:change_owner_to_deploy) {change_owner(fetch(:user))}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def register_hooks
|
20
|
+
before(:'deploy:cleanup', :'wordpress:change_owner_to_deploy')
|
21
|
+
after(:'deploy:finished', :'wordpress:change_owner_to_wordpress')
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def change_owner(user)
|
27
|
+
on(roles(:all)) do |host|
|
28
|
+
within(deploy_path) do
|
29
|
+
sudo(:chown, '-R', "#{user}:#{user}", 'releases/*')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-wordpress-permissions
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Alexandre Zicat
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-02-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: capistrano
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.0'
|
41
|
+
description: Changes the releases' owner to the Wordpress user, in order to be able
|
42
|
+
to install and update plugins.
|
43
|
+
email:
|
44
|
+
- alexzicat@teamhubble.com
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- ".gitignore"
|
50
|
+
- ".travis.yml"
|
51
|
+
- Gemfile
|
52
|
+
- Gemfile.lock
|
53
|
+
- LICENSE.txt
|
54
|
+
- README.md
|
55
|
+
- Rakefile
|
56
|
+
- capistrano-wordpress.gemspec
|
57
|
+
- lib/capistrano/wordpress.rb
|
58
|
+
- lib/capistrano/wordpress/permissions.rb
|
59
|
+
- lib/capistrano/wordpress/version.rb
|
60
|
+
homepage: https://github.com/teamhubble/capistrano-wordpress
|
61
|
+
licenses:
|
62
|
+
- MIT
|
63
|
+
metadata: {}
|
64
|
+
post_install_message:
|
65
|
+
rdoc_options: []
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
73
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
requirements: []
|
79
|
+
rubyforge_project:
|
80
|
+
rubygems_version: 2.7.8
|
81
|
+
signing_key:
|
82
|
+
specification_version: 4
|
83
|
+
summary: Changes the releases' owner to the Wordpress user.
|
84
|
+
test_files: []
|