This repository has been archived by the owner on Aug 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NeosBase.yaml
304 lines (270 loc) · 7.07 KB
/
NeosBase.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
########################
# Init runtime data
########################
'Set project data':
class: \Butler\Task\InputTask
task: question
options:
projectname: 'What is the name of your Project?'
########################
# Init project with composer
########################
'Composer create':
class: \Butler\Task\ComposerTask
task: create
options:
distribution: neos/neos-base-distribution
tempPath: temp
params:
- '--no-dev'
'Neos kickstart site':
class: \Butler\Task\NeosTask
task: kickstartSite
options:
context: Development
#package-key: '{projectvendor}.Site'
site-name: '{projectname}'
'Composer remove packages':
class: \Butler\Task\ComposerTask
task: remove
options:
packages: neos/demo neos/site-kickstarter neos/setup flowpack/neos-frontendlogin neos/redirecthandler-neosadapter neos/redirecthandler-databasestorage neos/nodetypes neos/seo
'Composer.json update':
class: \Butler\Task\JsonTask
task: update
options:
filename: composer.json
data:
repositories:
- type: "path"
url: "./DistributionPackages/*"
config:
platform:
php: "7.0"
scripts:
neosguidelines: "./flow guidelines:validateDistribution && ./flow guidelines:validatePackages"
'lint:editorconfig': "editorconfig-checker -e 'Public|Resources|Sites.xml' ./DistributionPackages/*"
'lint:psr2': "./bin/phpcs ./DistributionPackages/ --standard=PSR2 --standard=PSR2 --extensions=php"
lint: "composer lint:editorconfig && composer lint:psr2 && composer neosguidelines"
test:
- "bin/phpunit -c Build/BuildEssentials/PhpUnit/UnitTests.xml DistributionPackages/{neos.site-package.key}/Tests/Unit/"
'Move Sitepackage':
class: \Butler\Task\FilesystemTask
task: move
options:
originDir: './Packages/Sites/{neos.site-package.key}'
targetDir: './DistributionPackages/{neos.site-package.key}'
'Composer update':
class: \Butler\Task\ComposerTask
task: update
'Composer require':
class: \Butler\Task\ComposerTask
task: add
options:
package: '{neos.site-package.composer-name}:dev-master sitegeist/monocle'
'Composer require-dev':
class: \Butler\Task\ComposerTask
task: add
options:
package: 'sitegeist/magicwand sitegeist/neosguidelines editorconfig-checker/editorconfig-checker squizlabs/php_codesniffer'
params:
- '--dev'
###################
# Create settings
###################
'Neos dev settings':
class: \Butler\Task\NeosTask
task: settings
options:
filename: Configuration/Development/Settings.yaml
settings:
Neos:
Flow:
persistence:
backendOptions:
dbname: application
user: toor
password: toor
host: 0.0.0.0
port: 8086
'Neos global settings':
class: \Butler\Task\FilesystemTask
task: copy
options:
originFile: Configuration/Settings.yaml.example
targetFile: Configuration/Settings.yaml
######################
# Docker setup and run
######################
# ToDo: use yaml task instead of the neos settings task.
'Docker create docker-compose.yml':
class: \Butler\Task\NeosTask
task: settings
options:
filename: docker-compose.yml
settings:
version: '2'
services:
db:
image: 'mysql:5.7'
volumes:
- './Data/Docker/Database:/var/lib/mysql'
restart: always
ports:
- '8086:3306'
command:
- '--character-set-server=utf8'
- '--collation-server=utf8_unicode_ci'
environment:
MYSQL_ROOT_PASSWORD: toor
MYSQL_DATABASE: application
MYSQL_USER: toor
MYSQL_PASSWORD: toor
phpmyadmin:
image: phpmyadmin/phpmyadmin
environment:
- PMA_HOST=db
- PMA_PORT=3306
- PMA_USER=toor
- PMA_PASSWORD=toor
restart: always
ports:
- '8082:80'
volumes:
- /sessions
'Docker docker-compose up':
class: \Butler\Task\CommandTask
task: command
options:
command: 'docker-compose up -d'
'Docker waiting for database':
class: \Butler\Task\CommandTask
task: command
options:
command: 'while ! mysqladmin ping -h0.0.0.0 --port=8086 --silent; do sleep 1 ;done'
#########################
# Neos Setup
#########################
'Neos migrate database':
class: \Butler\Task\NeosTask
task: doctrineMigrate
options:
context: Development
# user just for local development
'Neos create admin':
class: \Butler\Task\NeosTask
task: createUser
options:
context: Development
#user: admin
#password: admin
username: 'Admin Admin'
roles:
- 'Neos.Neos:Administrator'
#'Neos import demo':
# class: \Butler\Task\NeosTask
# task: siteImport
# options:
# context: Development
# package: Neos.Demo
'Neos create site':
class: \Butler\Task\NeosTask
task: siteCreate
options:
context: Development
package-key: '{neos.site-package.key}'
site-name: '{neos.site-package.name}'
'Docker compose down':
class: \Butler\Task\CommandTask
task: command
options:
command: 'docker-compose down'
#####################
# Create common files
#####################
'Create README':
class: \Butler\Task\FilesystemTask
task: dumpFile
options:
file: README.md
content:
- '# {projectname}'
- ''
- '## Installation'
- ''
- '## Versioning'
- ''
- '## Deployment'
######################
# init Git
######################
'Git init':
class: \Butler\Task\GitTask
task: init
options: { }
'Git ignoreEdit':
class: \Butler\Task\GitTask
task: ignoreEdit
options:
replaces:
/Configuration/: '/Configuration/*'
'Git ignore':
class: \Butler\Task\GitTask
task: ignore
options:
files:
- 'Build/*'
- 'Readme.rst'
- 'Upgrading.rst'
- '.idea'
- '.vscode'
- '.build'
- 'DistributionPackages/*.Site/Resources/Public/Styles/*.css*'
'Git add':
class: \Butler\Task\GitTask
task: add
options:
files:
- '.'
- .gitignore
- .editorconfig
'Git commit':
class: \Butler\Task\GitTask
task: commit
options:
message: 'initial commit'
'Git add remote':
class: \Butler\Task\GitTask
task: remoteAdd
options:
origin: origin
#url: '[email protected]:vendor/projectname.git'
'Git ask push':
class: \Butler\Task\InputTask
task: confirmation
options:
gitpush: 'Execute git push now?'
'Git push':
class: \Butler\Task\GitTask
task: push
options:
params:
- '-u'
origin: origin
branch: master
condition: 'gitpush == 1'
#######################
# Finished
#######################
'The End :)':
class: \Butler\Task\InputTask
task: writelines
options:
header: Finished
text: 'Your new project "{projectname}" is now ready for development'
hodor: ''
0: 'To start local development run:'
1: 'docker-compose up -d && ./flow server:run'
2: '-----------------------------------------'
3: 'Linting: composer run lint'
4: 'Testing: composer run test'