capistrano-typo3 0.2.4 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +8 -0
- data/CHANGELOG.md +7 -0
- data/README.md +11 -12
- data/capistrano-typo3.gemspec +3 -3
- data/docs/homestead_nl.md +164 -0
- data/docs/install_from_scratch.md +263 -0
- data/homestead_files/Vagrantfile +193 -0
- data/homestead_files/homestead.rb +35 -0
- data/homestead_files/vagrant.yml +62 -0
- data/lib/capistrano/tasks/git.cap +7 -0
- data/lib/capistrano/tasks/typo3.cap +303 -316
- data/lib/capistrano/typo3/dt3_div.rb +52 -0
- data/lib/capistrano/typo3/dt3_mysql.rb +179 -0
- data/lib/capistrano/typo3/typo3_helper.rb +481 -0
- data/lib/capistrano/typo3/version.rb +1 -1
- data/lib/capistrano/typo3.rb +7 -0
- metadata +16 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f5d21a82827f9fc925651b3d05f252e390431e8
|
4
|
+
data.tar.gz: fef24dac51b3398a7b39f595499a012b181086fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17fe9f0215d5bd82422ed5f92c718f1c83ad878295dd481c2d375c87dc0a824e7ee47393e288a4047e7f832f6b7a0d7df3c259b9d2fbff148600dbb7eb9b76ee
|
7
|
+
data.tar.gz: 113cfd2c2b54b8439c7bf6e32b82c3476797d7fd1cfaf31698bdc03519aa32d96e0ade1fda084a88ef3bb43753f916ed2a5c403d5f32f3dca085429973b8bd3e
|
data/.codeclimate.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## capistrano-typo3 0.3.2
|
4
|
+
- hotfix wrong additional path
|
5
|
+
|
6
|
+
## capistrano-typo3 0.3.1
|
7
|
+
- split mysql sync commands into sep. commands to prevent site locking
|
8
|
+
- add trusted hosts to homestead
|
9
|
+
|
3
10
|
## capistrano-typo3 0.2.4 2015-03-09
|
4
11
|
- add clear all cache task
|
5
12
|
|
data/README.md
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
# Capistrano::Typo3 [![Code Climate](https://codeclimate.com/github/
|
1
|
+
# Capistrano::Typo3 [![Code Climate](https://codeclimate.com/github/t3labcom/capistrano-typo3/badges/gpa.svg)](https://codeclimate.com/github/t3labcom/capistrano-typo3) [![Issue Count](https://codeclimate.com/github/t3labcom/capistrano-typo3/badges/issue_count.svg)](https://codeclimate.com/github/t3labcom/capistrano-typo3)
|
2
|
+
|
3
|
+
**Note: this plugin works only with Capistrano 3.** Please check the
|
4
|
+
capistrano gem version you're using before installing this gem:
|
2
5
|
|
3
|
-
**Note: this plugin works only with Capistrano 3.** Please check the capistrano
|
4
|
-
gem version you're using before installing this gem:
|
5
6
|
`$ bundle show | grep capistrano`
|
6
7
|
|
7
|
-
Capistrano deployment tasks for TYPO3 CMS
|
8
|
+
Capistrano deployment tasks for TYPO3 CMS
|
8
9
|
|
9
10
|
## Compatibility
|
10
11
|
|
11
12
|
The versions below have been tested with capistrano-typo3
|
12
13
|
|
13
|
-
* 4.5.x
|
14
|
-
* 4.6.x
|
15
|
-
* 4.7.x
|
16
14
|
* 6.2.x
|
15
|
+
* 7.x
|
16
|
+
* 8.x
|
17
17
|
|
18
18
|
## Configuration
|
19
19
|
|
@@ -32,13 +32,12 @@ And then execute:
|
|
32
32
|
|
33
33
|
$ bundle
|
34
34
|
|
35
|
-
Or install it yourself as:
|
36
|
-
|
37
|
-
$ gem install capistrano-typo3
|
38
|
-
|
39
35
|
## Usage
|
40
36
|
|
41
|
-
|
37
|
+
### TYPO3.Homestead
|
38
|
+
|
39
|
+
Capistrano-typo3 integrates TYPO3.Homestead. Here's the [Dutch documentation](docs/homestead_nl.md)
|
40
|
+
about this integrations. English version will follow soon.
|
42
41
|
|
43
42
|
## References / inspiration
|
44
43
|
* https://github.com/programmerqeu/capistrano-typo3-cms
|
data/capistrano-typo3.gemspec
CHANGED
@@ -8,9 +8,9 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Capistrano::Typo3::VERSION
|
9
9
|
spec.authors = ["Pim Snel"]
|
10
10
|
spec.email = ["pim@lingewoud.nl"]
|
11
|
-
spec.summary = %q{Capistrano 3 tasks for TYPO3
|
12
|
-
spec.description = %q{Capistrano 3
|
13
|
-
spec.homepage = "https://github.com/
|
11
|
+
spec.summary = %q{Capistrano 3 tasks and CI for TYPO3}
|
12
|
+
spec.description = %q{Capistrano 3 deployment and continious delivery tasks for TYPO3 versions 6.2+, 7.x, 8.x}
|
13
|
+
spec.homepage = "https://github.com/t3labcom/capistrano-typo3"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -0,0 +1,164 @@
|
|
1
|
+
# Capistrano-typo3 + Homestead
|
2
|
+
|
3
|
+
Als ontwikkelaar wil je in je eigen editor werken met de luxe dat je
|
4
|
+
wel de volledige TYPO3 Lamp stack tot je beschikking hebt.
|
5
|
+
|
6
|
+
Capistrano-typo3 integreert TYPO3.Homestead, een Vagrant machine van
|
7
|
+
@tuurlijk die ervoor zorgt dat een website die geschikt is voor CI met
|
8
|
+
Capistrano-typo3 ook heel makkelijk op een eigen machine geinstalleerd
|
9
|
+
kan worden.
|
10
|
+
|
11
|
+
TYPO3.Homestead bevat alle mogelijke hulpmiddelen voor TYPO3
|
12
|
+
en PHP ontwikkelaars, waaronder diverse php-versies en php-debugging
|
13
|
+
tools, maar ook o.a. MailHog, memcached, rabbitMQ, redis, elasticsearch.
|
14
|
+
Capistrano-typo3 installeert homestead en houdt de configuratie helemaal
|
15
|
+
vanilla. Lees alles over de mogelijkheden Homestead op de
|
16
|
+
[TYPO3.Homestead gitlab site](https://github.com/Tuurlijk/TYPO3.Homestead).
|
17
|
+
|
18
|
+
## Installatie
|
19
|
+
|
20
|
+
Als een site al geschikt is gemaakt voor Homestead moet je volgende
|
21
|
+
handelingen uitvoeren in Homestead op je eigen machine met de website te
|
22
|
+
installeren.
|
23
|
+
|
24
|
+
### 1. Clone de website en installeer de noodzakelijk gems
|
25
|
+
|
26
|
+
```
|
27
|
+
git clone -b developer git@gitlab.lingewoud.net:sites/site-t3.git
|
28
|
+
bundle install --path=vendor --binstubs
|
29
|
+
```
|
30
|
+
|
31
|
+
### 2. Draai het homestead setup script
|
32
|
+
|
33
|
+
```
|
34
|
+
./bin/cap homestead typo3:vagrant:setup_machine
|
35
|
+
```
|
36
|
+
|
37
|
+
Als er iets niet goed gaat kun je met het volgende commando de machine
|
38
|
+
verwijderen.
|
39
|
+
|
40
|
+
```
|
41
|
+
./bin/cap homestead typo3:vagrant:purge_machine
|
42
|
+
```
|
43
|
+
|
44
|
+
Je kunt vervolgens weer met een schone lei het commando
|
45
|
+
|
46
|
+
```
|
47
|
+
homestead:setup_machine
|
48
|
+
```
|
49
|
+
uitvoeren.
|
50
|
+
|
51
|
+
### 3. Installeer de site in homestead
|
52
|
+
|
53
|
+
```
|
54
|
+
./bin/cap homestead typo3:vagrant:setup_site
|
55
|
+
```
|
56
|
+
|
57
|
+
Als er iets niet goed gaat gebruik je het commando:
|
58
|
+
|
59
|
+
```
|
60
|
+
./bin/cap homestead typo3:vagrant:purge_site
|
61
|
+
```
|
62
|
+
|
63
|
+
Je kunt vervolgens weer met een schone lei het volgende commando
|
64
|
+
uitvoeren.
|
65
|
+
|
66
|
+
```
|
67
|
+
./bin/cap homestead typo3:vagrant:setup_site
|
68
|
+
```
|
69
|
+
|
70
|
+
### 4. Sychroniseer de live content bestanden
|
71
|
+
|
72
|
+
Houdt er rekening mee dat dit lang kan duren. Voer het onderstaande
|
73
|
+
commando uit om de bestanden vanuit de live installatie naar de vagrant
|
74
|
+
machine de synchroniseren:
|
75
|
+
|
76
|
+
```
|
77
|
+
./bin/cap homestead typo3:content:sync_files_from_production
|
78
|
+
```
|
79
|
+
|
80
|
+
## Gebruiken
|
81
|
+
|
82
|
+
### Vagrant machine starten/stoppen
|
83
|
+
|
84
|
+
Als Homestead geïnstalleerd is moet je de vagrant machine starten om met
|
85
|
+
de site te kunnen werken.
|
86
|
+
|
87
|
+
Open een terminal en cd naar de root directory van je TYPO3 project.
|
88
|
+
Vanuit hier type je ```vagrant up```. Wil je de vagrant weer stoppen
|
89
|
+
type dan ```vagrant halt```. Om te zien of vagrant draait type je
|
90
|
+
```vagrant status```.
|
91
|
+
|
92
|
+
Let op: in de huidige versie van Capistrano-typo3+homestead mag er maar
|
93
|
+
een vagrant machine tegelijk draaien.
|
94
|
+
|
95
|
+
### Site URL en broncode
|
96
|
+
|
97
|
+
Als vagrant draait kun je website openen via: http://local.typo3.org.
|
98
|
+
|
99
|
+
Als de website draait staat de TYPO3 code in de map
|
100
|
+
```[T3-project]/dummy```.
|
101
|
+
|
102
|
+
### Site database
|
103
|
+
|
104
|
+
De database is te benaderen via een ssh-tunnel. Aan de hand van Sequel
|
105
|
+
Pro leggen we uit hoe contact gemaakt kan worden met de database. Zie de
|
106
|
+
schermafbeelding hieronder:
|
107
|
+
|
108
|
+
![image](http://picdrop.t3lab.com/xZDfFGGnQL.png)
|
109
|
+
|
110
|
+
Maak een nieuwe profiel en vul de bestanden zoals hierboven. Het
|
111
|
+
password veld van de database moet gevuld worden met ```supersecret```.
|
112
|
+
De SSH Private is bij het maken van de machine gegenereerd. De ssh key
|
113
|
+
staat in de verborgen map
|
114
|
+
[T3-project]/.vagrant/machines/default/virtualbox/private_key
|
115
|
+
|
116
|
+
Kopieer het volledige pad van de private key en plak deze in Sequel Pro.
|
117
|
+
|
118
|
+
Als de vagrant machine draait geeft dit profiel toegang tot alle
|
119
|
+
databases.
|
120
|
+
|
121
|
+
|
122
|
+
### Datase en evt bestanden synchroniseren
|
123
|
+
|
124
|
+
Capistrano-typo3 gaat ervanuit dat database en de website content
|
125
|
+
bestanden van de live website altijd de laatste versie is.
|
126
|
+
Dit betekend dat op gezette momenten de ontwikkelaar de database en de
|
127
|
+
bestanden in z'n Homestead ontwikkelomgeving wil bijwerken met de
|
128
|
+
live versies. Dit kan met de volgende 2 losse commando's:
|
129
|
+
|
130
|
+
```
|
131
|
+
./bin/cap homestead typo3:content:sync_db_from_production
|
132
|
+
./bin/cap homestead typo3:content:sync_files_from_production
|
133
|
+
```
|
134
|
+
|
135
|
+
## Links
|
136
|
+
- [TYPO3.Homestead](https://github.com/Tuurlijk/TYPO3.Homestead)
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
@@ -0,0 +1,263 @@
|
|
1
|
+
# Nieuwe site
|
2
|
+
|
3
|
+
Dit is een verslag van een from scratch installatie, dat moet leiden tot
|
4
|
+
een complete handleiding.
|
5
|
+
|
6
|
+
verslag TYPO3 omgeving maken voor development en release
|
7
|
+
|
8
|
+
# TODO
|
9
|
+
|
10
|
+
- Gemfile
|
11
|
+
- Bundle install --bincaps
|
12
|
+
- Capfile
|
13
|
+
- Dir str.
|
14
|
+
- testing
|
15
|
+
- prelive
|
16
|
+
- homestead conf
|
17
|
+
- Dummy dir met typo3 vanilla
|
18
|
+
- TYPO3 installatie
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
### Stap 1 gitrepogemaakt en gecloned om in te werken
|
23
|
+
|
24
|
+
### Stap 2 prelive omgeving
|
25
|
+
|
26
|
+
Deze omgeving dient als content master zolang de website niet gereleased
|
27
|
+
is. Om die reden maken we deze omgeving als eerste aan zodat de test en
|
28
|
+
homestead omgeving gesynced kan worden met deze omgeving.
|
29
|
+
|
30
|
+
- omgeving prelive op webserver met webpad,
|
31
|
+
|
32
|
+
htdocroot =
|
33
|
+
|
34
|
+
```
|
35
|
+
/var/customers/webs/userdev/point-prelive/current/dummy
|
36
|
+
```
|
37
|
+
|
38
|
+
- database
|
39
|
+
|
40
|
+
### Stap 3
|
41
|
+
in repo working copy
|
42
|
+
|
43
|
+
vim Gemfile
|
44
|
+
|
45
|
+
```
|
46
|
+
source 'https://rubygems.org'
|
47
|
+
gem 'capistrano', '~> 3.5.0'
|
48
|
+
gem 'capistrano-typo3', :git =>'https://github.com/mipmip/capistrano-typo3.git'
|
49
|
+
```
|
50
|
+
|
51
|
+
```
|
52
|
+
bundle install --binstubs
|
53
|
+
```
|
54
|
+
|
55
|
+
```
|
56
|
+
cap install STAGES=homestead,test,prelive,live
|
57
|
+
```
|
58
|
+
|
59
|
+
Voeg toe aan Capfile
|
60
|
+
|
61
|
+
```
|
62
|
+
require 'capistrano/typo3'
|
63
|
+
```
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
### Stap 4
|
68
|
+
|
69
|
+
in repo working copy
|
70
|
+
|
71
|
+
```
|
72
|
+
mkdir -p config/deploy/
|
73
|
+
```
|
74
|
+
|
75
|
+
vim config/deploy/prelive.rb
|
76
|
+
|
77
|
+
pas aan met instellingen zoals:
|
78
|
+
|
79
|
+
```
|
80
|
+
server 'xxxxx.xxxxxx.net', roles: %w{web}, port: 22
|
81
|
+
|
82
|
+
set :user, 'userxxx'
|
83
|
+
|
84
|
+
set :deploy_to, "/var/www/#{fetch(:user)}/point-prelive"
|
85
|
+
set :tmp_dir, "/var/www/#{fetch(:user)}/tmp"
|
86
|
+
set :ssh_options, { user: fetch(:user) }
|
87
|
+
|
88
|
+
set :stage, :prelive
|
89
|
+
set :http_protocol, 'http'
|
90
|
+
set :branch, "master"
|
91
|
+
set :t3_dont_upgrade_source, 1
|
92
|
+
|
93
|
+
set :main_domain_name, 'xxxxx.net'
|
94
|
+
|
95
|
+
set :dbname, 'dbxxx'
|
96
|
+
set :dbuser, 'userxxx'
|
97
|
+
set :dbpass, 'xxxxxx'
|
98
|
+
set :dbhost, 'localhost'
|
99
|
+
```
|
100
|
+
|
101
|
+
and config/deploy.rb
|
102
|
+
|
103
|
+
```
|
104
|
+
set :application, 'point-env001-t3'
|
105
|
+
|
106
|
+
set :repo_url, 'git@gitlab.lingewoud.net:HS-TYPO3/point-env001-t3.git'
|
107
|
+
|
108
|
+
set :scm, :git
|
109
|
+
set :log_level, :debug
|
110
|
+
set :keep_releases, 5
|
111
|
+
|
112
|
+
set :domain_org, 'point-prelive.dev2.lingewoud.net'
|
113
|
+
|
114
|
+
set :t3_main_version, '7.6'
|
115
|
+
```
|
116
|
+
|
117
|
+
### Stap 5, download typo3
|
118
|
+
|
119
|
+
```
|
120
|
+
mkdir dummy
|
121
|
+
cd dummy
|
122
|
+
cd tar xzvf ~/Downloads/typo3_src-7.6.11.tar.gz
|
123
|
+
ln -s typo3_src/index.php
|
124
|
+
ln -s typo3_src/typo3
|
125
|
+
cp typo3_src/_.htaccess .htaccess
|
126
|
+
```
|
127
|
+
|
128
|
+
commit and push
|
129
|
+
|
130
|
+
|
131
|
+
### Stap 6, remote setup
|
132
|
+
|
133
|
+
```
|
134
|
+
typo3:helper:rm_deploy_to
|
135
|
+
deploy
|
136
|
+
typo3:helper:setup_shared_typo3_dirs
|
137
|
+
typo3:helper:current_relative_symlink
|
138
|
+
first_install
|
139
|
+
```
|
140
|
+
|
141
|
+
|
142
|
+
### Stap 7, maak in de browser de installatie van prelive af
|
143
|
+
|
144
|
+
Haal daarna dummy/typo3conf/ naar local for import in git
|
145
|
+
```
|
146
|
+
rsync -av userdev@volkert.node.lingewoud.net:/var/customers/webs/userdev/point-prelive/current/dummy/typo3conf/ dummy/typo3conf/
|
147
|
+
git add dummy
|
148
|
+
git commit dummy
|
149
|
+
git push
|
150
|
+
```
|
151
|
+
|
152
|
+
### Stap 8, maak test-env klaar
|
153
|
+
|
154
|
+
|
155
|
+
maak configuratie van test in orde
|
156
|
+
|
157
|
+
```
|
158
|
+
|
159
|
+
```
|
160
|
+
|
161
|
+
commit en push alles weg
|
162
|
+
|
163
|
+
```
|
164
|
+
git checkout -b developer
|
165
|
+
git push --set-upstream origin developer
|
166
|
+
```
|
167
|
+
|
168
|
+
maak in deploy.rb de sync in orde
|
169
|
+
|
170
|
+
```
|
171
|
+
set :t3_live_sync, -> do
|
172
|
+
{
|
173
|
+
'filesync' => {
|
174
|
+
'fileadmin' => 'rsync -av xxxx@xxxx.net:/var/www/xxxx-prelive/shared/fileadmin/ shared/fileadmin/',
|
175
|
+
'uploads' => 'rsync -av xxxx@xxxx.net:/var/www/xxxx-prelive/shared/uploads/ shared/uploads/',
|
176
|
+
},
|
177
|
+
'dbsync' => {
|
178
|
+
'ssh_server' => 'xxxx.net',
|
179
|
+
'ssh_user' => 'userdev',
|
180
|
+
'dbname' => 'xxxx',
|
181
|
+
'dbuser' => 'xxxx',
|
182
|
+
'dbpass' => 'xxxx',
|
183
|
+
'dbhost' => 'xxxx',
|
184
|
+
},
|
185
|
+
}
|
186
|
+
end
|
187
|
+
|
188
|
+
set :t3_sql_updates, -> do
|
189
|
+
[
|
190
|
+
# "UPDATE sys_template SET constants = REPLACE(constants, 'http://www.#{fetch(:domain_org)}/','http://#{fetch(:main_domain_name)}/') where uid=1",
|
191
|
+
# "UPDATE sys_domain SET domainName = '#{fetch(:main_domain_name)}' WHERE uid = 1",
|
192
|
+
# "DELETE FROM sys_domain WHERE uid = 1",
|
193
|
+
]
|
194
|
+
end
|
195
|
+
```
|
196
|
+
|
197
|
+
|
198
|
+
### Stap 9 vagrant machine
|
199
|
+
|
200
|
+
maak homestead conf.
|
201
|
+
|
202
|
+
```
|
203
|
+
server 'localhost', roles: %w{web allow_syncfiles allow_syncdatabase}, port: 2222
|
204
|
+
set :user, 'vagrant'
|
205
|
+
set :stage, :homestead
|
206
|
+
set :deploy_to, '/var'
|
207
|
+
set :ssh_options, { user: 'vagrant', port: 2222, keys: ['.vagrant/machines/default/virtualbox/private_key'] }
|
208
|
+
set :tmp_dir, "/tmp"
|
209
|
+
set :bundle_executable, "/usr/local/bin/bundle"
|
210
|
+
set :restart_webserver, "sudo service nginx restart"
|
211
|
+
|
212
|
+
set :branch, "developer"
|
213
|
+
|
214
|
+
set :git_no_cache, 1
|
215
|
+
|
216
|
+
set :t3_store_db_credentials_in_addionalconf, 1
|
217
|
+
set :t3_add_unsafe_trusted_host_pattern, 1
|
218
|
+
set :t3_dont_upgrade_source, 1
|
219
|
+
|
220
|
+
set :hs_default_upstream_php_engine, 'php56'
|
221
|
+
|
222
|
+
set :main_domain_name, 'local.typo3.org'
|
223
|
+
set :dbname, 'captypo3homestead'
|
224
|
+
set :dbuser, 'root'
|
225
|
+
set :dbpass, 'supersecret'
|
226
|
+
set :dbhost, 'localhost'
|
227
|
+
|
228
|
+
sync_ignore_items = [
|
229
|
+
# '*.pdf'
|
230
|
+
]
|
231
|
+
sync_ignore = ''
|
232
|
+
sync_ignore_items.each do | ignore_item |
|
233
|
+
sync_ignore << "--exclude '#{ignore_item}' "
|
234
|
+
end
|
235
|
+
|
236
|
+
set :t3_rsync_ignore, sync_ignore
|
237
|
+
set :t3_protocol, "http"
|
238
|
+
```
|
239
|
+
|
240
|
+
|
241
|
+
### Stap 10 Setup machine
|
242
|
+
|
243
|
+
|
244
|
+
installeer de juiste vagrant.yml en Vagrantfile
|
245
|
+
|
246
|
+
|
247
|
+
```
|
248
|
+
./bin/cap homestead typo3:vagrant:setup_machine
|
249
|
+
```
|
250
|
+
|
251
|
+
|
252
|
+
### Stap 20 Setup gitlab-ci.yml
|
253
|
+
|
254
|
+
set key in variablen van gitlab
|
255
|
+
|
256
|
+
keynaam: SSH_PRIVATE_KEY
|
257
|
+
kay waarde: een key die met test en prelive ssh mag connecten
|
258
|
+
|
259
|
+
### Stap xxx Maak backend test gebruiker met nieuwe ww:
|
260
|
+
|
261
|
+
automated_test web->page
|
262
|
+
|
263
|
+
### voeg minitest en watir toe
|