wp-capistrano3 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5179e44e2c944df4a90551c7360aa71be3e96aa137322496ee9407b5951086d4
4
+ data.tar.gz: 853646832db6c551396c822c8f2a02c38345b4e1f9494fc8ecab89e7081b57de
5
+ SHA512:
6
+ metadata.gz: 9bf50a931e3fc2bee91a4d1fe08da852cf8698918cddc7ad50910d5da23fb5331816aa493215ed01a126a54d62884d1dc72ed1fe5163e37eba6566f76b23b81a
7
+ data.tar.gz: 910752b6842817f2fe3b6af869654eb30e88dee84f46c7b6ca882533facddc8fed3a1f079ee5ff99f71b8e031b06d92087d71bec29c7d888e6bf19f79d149173
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/LICENCE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Troopers
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ 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, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # wp-capistrano
2
+
3
+ Capistrano tasks used to deploy wordpress project.
4
+
5
+ ## Install
6
+
7
+ ```ruby
8
+ #add this line in your Gemfile
9
+ gem 'wp-capistrano3'
10
+ ```
11
+
12
+ ```ruby
13
+ #add this line in your Capfile
14
+ require 'capistrano/wp-capistrano'
15
+ ```
16
+ Then run
17
+ ```shell
18
+ bundle install
19
+ #or bundle update
20
+ ```
21
+
22
+ ## Workflow
23
+
24
+ The default capistrano workflow is used with the addition of theses tasks.
25
+
26
+ ```ruby
27
+ before 'deploy:check:linked_files', 'wp-capistrano:create_wp_config'
28
+ before 'deploy:updating', 'wp-capistrano:download_wordpress'
29
+ after 'wp-capistrano:download_wordpress', 'wp-capistrano:install_wordpress'
30
+ after 'wp-capistrano:download_wordpress', 'wp-capistrano:update_wordpress'
31
+ ```
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
data/gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-bundler.gemspec
4
+ gemspec
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,8 @@
1
+ namespace "wp-capistrano" do
2
+ desc 'create empty wp-config.php'
3
+ task :create_wp_config do
4
+ on roles(:app) do
5
+ execute "touch #{shared_path}/wp-config.php"
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,15 @@
1
+ namespace "wp-capistrano" do
2
+ desc 'upload theme compiled files'
3
+ task :deploy-theme do
4
+ run_locally do
5
+ role_properties(:app) do |server|
6
+ ssh_options = server.ssh_options
7
+ fetch(:themes_to_deploy).each do |theme|
8
+ themesParentDir = theme.split("/")
9
+ themesParentDir.pop()
10
+ execute "scp -r -P #{server.ssh_options[:port]} #{ENV['SOURCE_PATH']}/#{theme} #{server.user}@#{server.hostname}:#{release_path}/#{themesParentDir.join("/")}"
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,10 @@
1
+ namespace "wp-capistrano" do
2
+ desc 'Download wordpress'
3
+ task :download_wordpress do
4
+ on roles(:app) do
5
+ execute "wget http://wordpress.org/latest.tar.gz -P /tmp/"
6
+ execute "tar xzf /tmp/latest.tar.gz -C #{release_path} wordpress --strip-components=1"
7
+ execute "wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -P /tmp/"
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ namespace "wp-capistrano" do
2
+ desc 'Download wordpress'
3
+ task :install_wordpress do
4
+ on roles(:app), filter: :no_release do
5
+ execute "rm #{shared_path}/wp-config.php"
6
+ execute "php /tmp/wp-cli.phar config create --dbname=#{fetch(:wp_db_name)} --dbuser=#{fetch(:wp_db_user)} --dbpass=#{fetch(:wp_db_password)} --dbhost='#{fetch(:wp_db_host)}' --locale=#{fetch(:wp_locale)} --path=#{release_path}"
7
+ execute "cp #{release_path}/wp-config.php #{shared_path}/"
8
+ execute "php /tmp/wp-cli.phar core install --url='#{fetch(:wp_url)}' --title='#{fetch(:wp_title)}' --admin_user='#{fetch(:wp_admin_user)}' --admin_password='#{fetch(:wp_admin_password)}' --admin_email='#{fetch(:wp_admin_email)}' --skip-email --path=#{release_path}"
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,8 @@
1
+ namespace "wp-capistrano" do
2
+ desc 'Download wordpress'
3
+ task :update_wordpress do
4
+ on roles(:app) do
5
+ execute "php /tmp/wp-cli.phar core update --path=#{release_path}"
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,12 @@
1
+ #load File.expand_path("../tasks/deploy-theme.rake", __FILE__)
2
+ load File.expand_path("../tasks/create_wp_config.rake", __FILE__)
3
+ load File.expand_path("../tasks/download_wordpress.rake", __FILE__)
4
+ load File.expand_path("../tasks/install_wordpress.rake", __FILE__)
5
+ load File.expand_path("../tasks/update_wordpress.rake", __FILE__)
6
+
7
+
8
+ namespace :load do
9
+ task :defaults do
10
+ load "capistrano/wp-capistrano/defaults.rb"
11
+ end
12
+ end
@@ -0,0 +1,6 @@
1
+ # Default Flow
2
+ before 'deploy:check:linked_files', 'wp-capistrano:create_wp_config'
3
+ before 'deploy:updating', 'wp-capistrano:download_wordpress'
4
+ after 'wp-capistrano:download_wordpress', 'wp-capistrano:install_wordpress'
5
+ after 'wp-capistrano:download_wordpress', 'wp-capistrano:update_wordpress'
6
+ #before 'deploy:updated', 'wp-capistrano:deploy-theme'
File without changes
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'wp-capistrano3'
7
+ spec.version = '0.0.4'
8
+ spec.authors = ['Nicolas RENAULT']
9
+ spec.email = ['nrenault@tangkoko.com']
10
+ spec.description = %q{Wordpress tasks for Capistrano 3.x}
11
+ spec.summary = %q{Wordpress tasks for Capistrano 3.x}
12
+ spec.homepage = 'https://github.com/nicoren-tangkoko/wp-capistrano'
13
+ spec.license = 'MIT'
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ['lib']
19
+
20
+ spec.add_dependency 'capistrano', '>= 3.0.0.pre'
21
+
22
+ spec.add_development_dependency 'bundler', '~> 2.1'
23
+ spec.add_development_dependency 'rake', '~> 13.0'
24
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: wp-capistrano3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
5
+ platform: ruby
6
+ authors:
7
+ - Nicolas RENAULT
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-03-29 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.0.0.pre
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.0.0.pre
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.1'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '13.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '13.0'
55
+ description: Wordpress tasks for Capistrano 3.x
56
+ email:
57
+ - nrenault@tangkoko.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - LICENCE
64
+ - README.md
65
+ - Rakefile
66
+ - gemfile
67
+ - lib/capistrano/Rakefile
68
+ - lib/capistrano/tasks/create_wp_config.rake
69
+ - lib/capistrano/tasks/deploy-theme.rake
70
+ - lib/capistrano/tasks/download_wordpress.rake
71
+ - lib/capistrano/tasks/install_wordpress.rake
72
+ - lib/capistrano/tasks/update_wordpress.rake
73
+ - lib/capistrano/wp-capistrano.rb
74
+ - lib/capistrano/wp-capistrano/defaults.rb
75
+ - lib/wp-capistrano.rb
76
+ - wp-capistrano.gemspec
77
+ homepage: https://github.com/nicoren-tangkoko/wp-capistrano
78
+ licenses:
79
+ - MIT
80
+ metadata: {}
81
+ post_install_message:
82
+ rdoc_options: []
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ requirements: []
96
+ rubygems_version: 3.1.2
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: Wordpress tasks for Capistrano 3.x
100
+ test_files: []