capistrano-pimcore5 0.1.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4166cc549eb6d6325b8cbdc70d0b5628a0ee3e82
4
+ data.tar.gz: 36fd9201e7429c4ea4aea04487d0eaef7349eab1
5
+ SHA512:
6
+ metadata.gz: a91f498f7e2f2dc3949e18b6df5565bd7284f32db7eec3a96fd9a7724c1e8ae0d0adceb33c849111ebc25c1ead476480294144515fbd9843cd24a74ac32d00e0
7
+ data.tar.gz: 3cb7cfdac5b0a181bb3d983a1b0bfb7501d7cd77fe740fd9bdef178fe78c5fe631825b9b648e95c4a2708ae95155d65fbedce37eeb51be62e06eb7cc48b2dcf9
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ capistrano-pimcore-*.gem
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.rubocop.yml ADDED
@@ -0,0 +1,5 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.1
3
+
4
+ Metrics/LineLength:
5
+ Max: 120
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.1.4
5
+ before_install:
6
+ - gem install bundler -v 1.13.6
7
+ - bundler install
8
+ script:
9
+ - bundle exec rubocop
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-pimcore.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Divante Ltd.
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 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,
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 THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,68 @@
1
+ # Capistrano::Pimcore5
2
+
3
+ Pimcore 5 plugin for capistrano
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'capistrano-pimcore5'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install capistrano-pimcore5
20
+
21
+ ## Usage
22
+
23
+ Install and configure capistrano in your project. More information is on Capistrano [Home Page](http://capistranorb.com/) and Capistrano [GitHub](https://github.com/capistrano/capistrano)
24
+
25
+ Require capistrano-pimcore in your cap file
26
+
27
+ ```
28
+ # Capfile
29
+ require 'capistrano-pimcore5'
30
+ ```
31
+
32
+ ### Pimcore Specific Tasks
33
+
34
+ You can see this list by running `cap -T` from your shell.
35
+
36
+ | cap command | what it does |
37
+ | ------------------------------------------ | ---------------------------------------------------- |
38
+ | pimcore:cache:clear | Flush Pimcore cache storage |
39
+ | pimcore:classmap-generator | Generate class maps to improve performance |
40
+ | pimcore:definition:import:class | Import Class definition from a JSON export |
41
+ | pimcore:definition:import:fieldcollection | Import FieldCollection definition from a JSON export |
42
+ | pimcore:definition:import:objectbrick | Import ObjectBrick definition from a JSON export |
43
+ | pimcore:deployment:classes-rebuild | Rebuild Pimcore classes |
44
+ | pimcore:mysql-tools | Optimize and warmup mysql database |
45
+ | pimcore:reset-password | Reset Pimcore user password |
46
+ | pimcore:search-backend-reindex | Re-indexes the backend search of pimcore |
47
+ | pimcore:thumbnails:image | Generate Pimcore image thumbnails |
48
+ | pimcore:thumbnails:optimize-images | Optimize Pimcore filesize of all images |
49
+ | pimcore:thumbnails:video | Generate Pimcore video thumbnails |
50
+ | pimcore:update | Update pimcore to the desired version/build |
51
+
52
+ ### How work with Pimcore environments
53
+
54
+ Default environment is `development`. If you want to change Pimcore environment add param env as a param in CLI command, exapmle:
55
+
56
+ ```bash
57
+ bundle exec cap test pimcore:cache:clear env=production
58
+ ```
59
+
60
+ For each environment param env can be setted in config file, example:
61
+ ```ruby
62
+ # /config/deploy/staging.rb
63
+ set :env, 'development'
64
+ ```
65
+
66
+ ## Contributing
67
+
68
+ Bug reports and pull requests are welcome on GitHub at https://github.com/DivanteLtd/capistrano-pimcore.
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'capistrano/pimcore5'
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require 'irb'
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,32 @@
1
+ # coding: utf-8
2
+
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+
6
+ require 'capistrano/pimcore5/version'
7
+
8
+ Gem::Specification.new do |spec|
9
+ spec.name = 'capistrano-pimcore5'
10
+ spec.version = Capistrano::Pimcore5::VERSION
11
+ spec.authors = ['Mateusz Koszutowski']
12
+ spec.email = ['mkoszutowski@divante.pl']
13
+
14
+ spec.summary = 'Pimcore5 plugin for capistrano'
15
+ spec.description = 'Pimcore5 plugin for capistrano'
16
+ spec.homepage = 'https://github.com/DivanteLtd/capistrano-pimcore5'
17
+
18
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
19
+ f.match(%r{^(test|spec|features)/})
20
+ end
21
+
22
+ spec.bindir = 'exe'
23
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
+ spec.require_paths = ['lib']
25
+
26
+ spec.add_runtime_dependency 'capistrano-composer', '~> 0.0', '>= 0.0.6'
27
+
28
+ spec.add_development_dependency 'bundler', '~> 1.13'
29
+ spec.add_development_dependency 'rake', '~> 10.0'
30
+ spec.add_development_dependency 'rspec', '~> 3.0'
31
+ spec.add_development_dependency 'rubocop', '~> 0.48'
32
+ end
@@ -0,0 +1,18 @@
1
+ set :env, 'development'
2
+
3
+ set :linked_files, fetch(:linked_files, []).push
4
+
5
+ set :linked_dirs, fetch(:linked_dirs, []).push(
6
+ 'vendor',
7
+ 'website/var/areas',
8
+ 'website/var/assets',
9
+ 'website/var/backup',
10
+ 'website/var/classes',
11
+ 'website/var/config',
12
+ 'website/var/log',
13
+ 'website/var/plugins',
14
+ 'website/var/recyclebin',
15
+ 'website/var/system',
16
+ 'website/var/versions',
17
+ 'website/var/webdav'
18
+ )
@@ -0,0 +1,4 @@
1
+ require 'capistrano/deploy'
2
+ require 'capistrano/pimcore5'
3
+
4
+ load File.expand_path('../../tasks/deploy.rake', __FILE__)
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module Pimcore5
3
+ VERSION = '0.1.1'.freeze
4
+ end
5
+ end
@@ -0,0 +1,25 @@
1
+ require 'capistrano/composer'
2
+
3
+ SSHKit.config.command_map[:pimcore] = '/usr/bin/env php -f bin/console.php --'
4
+
5
+ module Capistrano
6
+ module Pimcore5
7
+ # Pimcore Helpers
8
+ module Helpers
9
+ def pimcore_environment
10
+ ENV['env'] || fetch(:env)
11
+ end
12
+ end
13
+ end
14
+ end
15
+
16
+ load File.expand_path('../tasks/pimcore5.rake', __FILE__)
17
+
18
+ # Core tasks for deploying pimcore
19
+ load File.expand_path('../tasks/deploy.rake', __FILE__)
20
+
21
+ namespace :load do
22
+ task :defaults do
23
+ load 'capistrano/pimcore5/defaults.rb'
24
+ end
25
+ end
@@ -0,0 +1,7 @@
1
+ include Capistrano::Pimcore::Helpers
2
+
3
+ namespace :deploy do
4
+ task :updated do
5
+ invoke 'pimcore:deployment:classes-rebuild'
6
+ end
7
+ end
@@ -0,0 +1,147 @@
1
+ include Capistrano::Pimcore5::Helpers
2
+
3
+ namespace :pimcore do # rubocop:disable Metrics/BlockLength
4
+ desc 'Reset Pimcore user password'
5
+ task :'reset-password' do
6
+ on release_roles :all do
7
+ within release_path do
8
+ raise 'Pleas set user name or id' unless ENV['user']
9
+ raise 'Pleas set password' unless ENV['pass']
10
+
11
+ user = ENV['user']
12
+ pass = ENV['pass']
13
+
14
+ execute :pimcore, "--environment=#{pimcore_environment}", 'reset-password', "-u#{user}", "-p#{pass}"
15
+ end
16
+ end
17
+ end
18
+
19
+ desc 'Generate class maps to improve performance'
20
+ task :'classmap-generator' do
21
+ on release_roles :all do
22
+ within release_path do
23
+ execute :pimcore, "--environment=#{pimcore_environment}", 'classmap-generator'
24
+ end
25
+ end
26
+ end
27
+
28
+ desc 'Optimize and warmup mysql database'
29
+ task :'mysql-tools' do
30
+ on release_roles :all do
31
+ within release_path do
32
+ execute :pimcore, "--environment=#{pimcore_environment}", 'mysql-tools'
33
+ end
34
+ end
35
+ end
36
+
37
+ desc 'Update pimcore to the desired version/build'
38
+ task :update do
39
+ on release_roles :all do
40
+ within release_path do
41
+ execute :pimcore, "--environment=#{pimcore_environment}", 'update'
42
+ end
43
+ end
44
+ end
45
+
46
+ desc 'Re-indexes the backend search of pimcore'
47
+ task :'search-backend-reindex' do
48
+ on release_roles :all do
49
+ within release_path do
50
+ execute :pimcore, "--environment=#{pimcore_environment}", 'search-backend-reindex'
51
+ end
52
+ end
53
+ end
54
+
55
+ namespace :cache do
56
+ desc 'Flush Pimcore cache storage'
57
+ task :clear do
58
+ on release_roles :all do
59
+ within release_path do
60
+ execute :pimcore, "--environment=#{pimcore_environment}", 'cache:clear'
61
+ end
62
+ end
63
+ end
64
+
65
+ task :warming do
66
+ desc 'Warmup Pimcore cache storage'
67
+ on release_roles :all do
68
+ within release_path do
69
+ execute :pimcore, "--environment=#{pimcore_environment}", 'cache:warming'
70
+ end
71
+ end
72
+ end
73
+ end
74
+
75
+ namespace :deployment do
76
+ desc 'Rebuild Pimcore classes'
77
+ task :'classes-rebuild' do
78
+ on release_roles :all do
79
+ within release_path do
80
+ execute :pimcore, "--environment=#{pimcore_environment}", 'deployment:classes-rebuild --create-classes'
81
+ end
82
+ end
83
+ end
84
+ end
85
+
86
+ namespace :thumbnails do
87
+ desc 'Generate Pimcore image thumbnails'
88
+ task :image do
89
+ on release_roles :all do
90
+ within release_path do
91
+ execute :pimcore, "--environment=#{pimcore_environment}", 'thumbnails:image'
92
+ end
93
+ end
94
+ end
95
+
96
+ desc 'Optimize Pimcore filesize of all images'
97
+ task :'optimize-images' do
98
+ on release_roles :all do
99
+ within release_path do
100
+ execute :pimcore, "--environment=#{pimcore_environment}", 'thumbnails:optimize-images'
101
+ end
102
+ end
103
+ end
104
+
105
+ desc 'Generate Pimcore video thumbnails'
106
+ task :video do
107
+ on release_roles :all do
108
+ within release_path do
109
+ execute :pimcore, "--environment=#{pimcore_environment}", 'thumbnails:video'
110
+ end
111
+ end
112
+ end
113
+ end
114
+
115
+ # rubocop:disable Metrics/BlockLength
116
+ namespace :definition do
117
+ namespace :import do
118
+ desc 'Import Class definition from a JSON export'
119
+ task :class do
120
+ on release_roles :all do
121
+ within release_path do
122
+ execute :pimcore, "--environment=#{pimcore_environment}", 'definition:import:class'
123
+ end
124
+ end
125
+ end
126
+
127
+ desc 'Import FieldCollection definition from a JSON export'
128
+ task :fieldcollection do
129
+ on release_roles :all do
130
+ within release_path do
131
+ execute :pimcore, "--environment=#{pimcore_environment}", 'definition:import:fieldcollection'
132
+ end
133
+ end
134
+ end
135
+
136
+ desc 'Import ObjectBrick definition from a JSON export'
137
+ task :objectbrick do
138
+ on release_roles :all do
139
+ within release_path do
140
+ execute :pimcore, "--environment=#{pimcore_environment}", 'definition:import:objectbrick'
141
+ end
142
+ end
143
+ end
144
+ end
145
+ end
146
+ end
147
+ # rubocop:enable Metrics/BlockLength
metadata ADDED
@@ -0,0 +1,136 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-pimcore5
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Mateusz Koszutowski
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-07-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano-composer
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.0'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.0.6
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '0.0'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 0.0.6
33
+ - !ruby/object:Gem::Dependency
34
+ name: bundler
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.13'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.13'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '10.0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '10.0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rspec
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '3.0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '3.0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rubocop
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '0.48'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '0.48'
89
+ description: Pimcore5 plugin for capistrano
90
+ email:
91
+ - mkoszutowski@divante.pl
92
+ executables: []
93
+ extensions: []
94
+ extra_rdoc_files: []
95
+ files:
96
+ - ".gitignore"
97
+ - ".rspec"
98
+ - ".rubocop.yml"
99
+ - ".travis.yml"
100
+ - Gemfile
101
+ - LICENSE
102
+ - README.md
103
+ - Rakefile
104
+ - bin/console
105
+ - bin/setup
106
+ - capistrano-pimcore5.gemspec
107
+ - lib/capistrano/pimcore5.rb
108
+ - lib/capistrano/pimcore5/defaults.rb
109
+ - lib/capistrano/pimcore5/deploy.rb
110
+ - lib/capistrano/pimcore5/version.rb
111
+ - lib/capistrano/tasks/deploy.rake
112
+ - lib/capistrano/tasks/pimcore5.rake
113
+ homepage: https://github.com/DivanteLtd/capistrano-pimcore5
114
+ licenses: []
115
+ metadata: {}
116
+ post_install_message:
117
+ rdoc_options: []
118
+ require_paths:
119
+ - lib
120
+ required_ruby_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ required_rubygems_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ requirements: []
131
+ rubyforge_project:
132
+ rubygems_version: 2.4.6
133
+ signing_key:
134
+ specification_version: 4
135
+ summary: Pimcore5 plugin for capistrano
136
+ test_files: []