-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
executable file
·259 lines (217 loc) · 7.74 KB
/
Taskfile.yml
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
# Task tool documentation:
# 1) Basics: https://taskfile.dev/usage
# 2) Naming conventions: https://taskfile.dev/styleguide
version: '3'
env:
AEM_ENV: '{{.AEM_ENV | default "local"}}'
AEM_INSTANCE_PROCESSING_MODE: auto
AEM_OUTPUT_VALUE: NONE
JAVA_HOME:
sh: sh aemw vendor list --output-value javaHome
dotenv:
- '.env' # VCS-ignored, user-specific
- '.env.{{.AEM_ENV}}' # VCS-ignored, env-specific
- '{{.AEM_ENV}}.env' # VCS-tracked, env-specific
tasks:
init:
desc: initialize project
cmds:
- sh aemw project init
setup:
desc: start and provision AEM instances
cmds:
- task: start
- task: provision
- task: check
resetup:
desc: destroy then setup again AEM instances
cmds:
- task: destroy
- task: setup
start:
desc: start AEM instances
aliases: [ up ]
cmd: sh aemw instance launch
stop:
desc: stop AEM instances
aliases: [ down ]
cmd: sh aemw instance stop
restart:
desc: restart AEM instances
cmds:
- task: stop
- task: start
destroy:
desc: destroy AEM instances
prompt: This will permanently delete all configured AEM instances and their data. Continue?
deps: [ stop ]
cmd: sh aemw instance destroy
status:
desc: check status of AEM instances
env:
AEM_OUTPUT_VALUE: ALL
cmd: sh aemw instance status
tail:
desc: tail logs of AEM instances
cmd: tail -f aem/home/var/instance/*/crx-quickstart/logs/{stdout,error}.log
tail:author:
desc: tail logs of AEM author instance
cmd: tail -f aem/home/var/instance/author/crx-quickstart/logs/{stdout,error}.log
tail:publish:
desc: tail logs of AEM publish instance
cmd: tail -f aem/home/var/instance/publish/crx-quickstart/logs/{stdout,error}.log
provision:
desc: provision AEM instances by installing packages and applying configurations
aliases: [ configure ]
cmds:
- task: provision:repl-agent-publish
- task: provision:crx
provision:repl-agent-publish:
desc: configure replication agent on AEM author instance
cmd: 'sh aemw repl agent setup -A --location "author" --name "publish" --input-string "{ enabled: true, transportUri: \"{{.AEM_PUBLISH_HTTP_URL}}/bin/receive?sling:authRequestLogin=1\", transportUser: \"{{.AEM_PUBLISH_USER}}\", transportPassword: \"{{.AEM_PUBLISH_PASSWORD}}\", userId: \"admin\" }"'
provision:crx:
desc: enable CRX/DE on AEM instances
cmd: 'sh aemw osgi config save --pid "org.apache.sling.jcr.davex.impl.servlets.SlingDavExServlet" --input-string "alias: /crx/server"'
check:
deps: [ author:check, publish:check ]
author:check:
desc: check health of AEM author instance
cmds:
- curl -s -u "{{.AEM_AUTHOR_USER}}:{{.AEM_AUTHOR_PASSWORD}}" "{{.AEM_AUTHOR_HTTP_URL}}/libs/granite/core/content/login.html" | grep -q "QUICKSTART_HOMEPAGE"
- curl -s -u "{{.AEM_AUTHOR_USER}}:{{.AEM_AUTHOR_PASSWORD}}" "{{.AEM_AUTHOR_HTTP_URL}}/etc/replication/agents.author/publish.test.html" | grep -q "Replication (TEST) of /content successful"
publish:check:
desc: check health of AEM publish instance
cmd: curl -s -u "{{.AEM_PUBLISH_USER}}:{{.AEM_PUBLISH_PASSWORD}}" "{{.AEM_PUBLISH_HTTP_URL}}/libs/granite/core/content/login.html" | grep -q "QUICKSTART_HOMEPAGE"
build:std:
desc: build AEM package
cmd: sh mvnw clean package $AEM_BUILD_ARGS
build:version:
desc: check build tool versions
cmds:
- echo "JAVA_HOME='${JAVA_HOME}'"
- sh mvnw -version
build:root:
desc: build AEM root project
cmd: sh mvnw clean install -N $AEM_BUILD_ARGS && mkdir -p target && touch target/done.txt
generates: [ target/done.txt ]
sources: [ pom.xml ]
build:core:
desc: build AEM core bundle
dir: core
cmd: sh ../mvnw clean install verify $AEM_BUILD_ARGS
generates: [ target/*.jar ]
sources: [ ../pom.xml, pom.xml, src/**/*, lib/**/*, ../lint/**/* ]
build:frontend:
dir: ui.frontend
desc: build AEM Frontend
cmd: sh ../mvnw clean install $AEM_BUILD_ARGS
generates:
- ../ui.apps/src/main/content/jcr_root/apps/puratos/clientlibs/**/*
sources:
- pom.xml
- package.json
- '*.json'
- '*.js'
- src/**/*
build:apps:
dir: ui.apps
desc: build AEM Apps package
cmd: sh ../mvnw clean install $AEM_BUILD_ARGS
generates: [ target/*.ui.apps-*.zip ]
sources:
- ../pom.xml
- pom.xml
- src/**/*
- ../core/target/*.jar
build:config:
dir: ui.config
desc: build AEM config package
cmd: sh ../mvnw clean install $AEM_BUILD_ARGS
sources: [ pom.xml, src/**/* ]
generates: [ target/*.ui.config-*.zip ]
build:content:
dir: ui.content
desc: build AEM base content package
cmd: sh ../mvnw clean install $AEM_BUILD_ARGS
sources: [ pom.xml, src/**/* ]
generates: [ target/*.ui.content-*.zip ]
build:content:index:
dir: ui.content.index
desc: build AEM Index content package
cmd: sh ../mvnw clean install $AEM_BUILD_ARGS
sources: [ pom.xml, src/**/* ]
generates: [ target/*.ui.content.index-*.zip ]
build:all:
dir: all
desc: build AEM all package
cmd: sh ../mvnw clean install $AEM_BUILD_ARGS
sources:
- pom.xml
- src/**/*
- ../ui.apps/target/*.ui.apps-*.zip
- ../ui.content/target/*.ui.content-*.zip
- ../ui.content.migration/target/*.ui.content.migration-*.zip
- ../ui.content.permissions/target/*.ui.content.permissions-*.zip
generates: [ target/*.all-*.zip ]
build:inc:
desc: build AEM application incrementally (only changed modules are rebuilt)
cmds:
- task: build:root
- task: build:core
- task: build:frontend
- task: build:apps
- task: build:config
- task: build:content
- task: build:content:index
- task: build:all
build:clean:
desc: clean built AEM application
cmd: sh mvnw clean
deploy:all:
desc: deploy all AEM package to AEM instances
cmd: sh aemw package deploy --file "all/target/acm.all-*.zip"
deploy:min:
desc: deploy minimal AEM package to AEM instances
cmd: sh aemw package deploy --file "min/target/acm.min-*.zip"
develop:all:
desc: build & deploy all AEM package to instances
deps: [ build:inc ]
cmds:
- task: deploy:all
# develop:min:
# desc: build & deploy minimal AEM package to instances
# deps: [ build ]
# cmds:
# #- sh aemw package deploy --url 'https://github.com/orbinson/aem-groovy-console/releases/download/19.0.5/aem-groovy-console-all-19.0.5.zip'
# - task: deploy:min
# - sh aemw package deploy --file 'ui.content/target/acm.ui.content-*.zip'
develop:core:
desc: build & deploy core OSGi bundle to instances
cmds:
- (cd core && sh ../mvnw clean package)
- sh aemw osgi bundle install --file 'core/target/acm.core-*.jar'
develop:content:
desc: build & deploy content AEM package to instances
cmds:
- (cd ui.content && sh ../mvnw clean package)
- sh aemw package deploy --file 'ui.content/target/acm.ui.content-*.zip'
develop:content:example:
desc: build & deploy example content AEM package to instances
cmds:
- (cd ui.content.example && sh ../mvnw clean package)
- sh aemw package deploy --file 'ui.content.example/target/acm.ui.content.example-*.zip'
develop:frontend:
desc: build & deploy frontend to instances
cmds:
- (cd ui.frontend && npm install && npm run build)
- sh aemw content push --dir 'ui.apps/src/main/content/jcr_root/apps/acm/spa'
develop:frontend:dev:
desc: build & deploy frontend to instances in development mode
dir: ui.frontend
cmds:
- sh npmw install
- sh npmw run dev
develop:frontend:format:
desc: format frontend code
dir: ui.frontend
cmd: sh npmw run format