forked from adobe/aem-site-template-standard
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into develop-regression-external-img
- Loading branch information
Showing
132 changed files
with
6,717 additions
and
4,135 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
const fs = require("fs"); | ||
const startTime = Date.now(); | ||
const child_process = require("child_process"); | ||
const packageJSON = JSON.parse(fs.readFileSync("./package.json")); | ||
|
||
const AEM_URL = process.env.AEM_URL; | ||
const SITE_NAME = process.env.AEM_SITE; | ||
// Need to make a way for this to exist throughout the entire example content | ||
const TMPL_NAME = packageJSON.name; | ||
const CREDENTIALS = process.env.CREDENTIALS || "admin:admin"; | ||
let VERSION = packageJSON.version; | ||
let [major, minor, patch] = packageJSON.version.split("."); | ||
|
||
const deletePreviousZip = () => { | ||
if (fs.existsSync(`./${TMPL_NAME}-${VERSION}.zip`)) | ||
runCmd(`rm ${TMPL_NAME}-${VERSION}.zip`); | ||
else console.log(`Could not find or delete ${TMPL_NAME}-${VERSION}.zip`); | ||
}; | ||
|
||
const updatePackageJSON = () => { | ||
packageJSON.version = [major, minor, parseInt(patch) + 1] | ||
.join(".") | ||
.toString(); | ||
fs.writeFileSync("./package.json", JSON.stringify(packageJSON, null, 2)); | ||
console.log( | ||
`Package.json updated to v${packageJSON.version} from v${VERSION}` | ||
); | ||
VERSION = packageJSON.version; | ||
}; | ||
|
||
const runCmd = (cmd, log) => { | ||
const resp = child_process.execSync(cmd); | ||
const result = resp.toString("UTF8"); | ||
if (log) console.log(result); | ||
return result; | ||
}; | ||
|
||
const log = (msg) => { | ||
console.log(`\n\n${"~".repeat(120)}`); | ||
console.log(` ${msg}`); | ||
console.log("~".repeat(120)); | ||
}; | ||
|
||
log(`Removing Site Configurations - /conf/${SITE_NAME}`); | ||
runCmd( | ||
`curl -u ${CREDENTIALS} -F ':operation=delete' ${AEM_URL}/conf/${SITE_NAME}` | ||
); | ||
log(`Removing DAM Content - /content/dam/${SITE_NAME}`); | ||
runCmd( | ||
`curl -u ${CREDENTIALS} -F ':operation=delete' ${AEM_URL}/content/dam/${SITE_NAME}` | ||
); | ||
log( | ||
`Removing Experience Fragments - ${AEM_URL}/content/experience-fragments/${SITE_NAME}` | ||
); | ||
runCmd( | ||
`curl -u ${CREDENTIALS} -F ':operation=delete' ${AEM_URL}/content/experience-fragments/${SITE_NAME}` | ||
); | ||
log(`Removing Content - /content/${SITE_NAME}`); | ||
runCmd( | ||
`curl -u ${CREDENTIALS} -F ':operation=delete' ${AEM_URL}/content/${SITE_NAME}` | ||
); | ||
log( | ||
`Removing Site Template - /conf/global/site-templates/${TMPL_NAME}-${VERSION}` | ||
); | ||
runCmd( | ||
`curl -u ${CREDENTIALS} -F ':operation=delete' ${AEM_URL}/conf/global/site-templates/${TMPL_NAME}-${VERSION}` | ||
); | ||
log(`Removing Previous Zip File ${TMPL_NAME}-${VERSION}.zip`); | ||
deletePreviousZip(); | ||
log(`Updating package.json with new versioning`); | ||
updatePackageJSON(); | ||
log(`Building Site Template v${VERSION}`); | ||
runCmd(`npm run build`, true); | ||
log(`Deploying ${TMPL_NAME}-${VERSION}.zip to ${AEM_URL}`); | ||
runCmd( | ||
`curl -u ${CREDENTIALS} -F file=@${TMPL_NAME}-${VERSION}.zip ${AEM_URL}/bin/wcm/site-template/import` | ||
); | ||
log(`Re-generatinig '${SITE_NAME}' site from template`); | ||
runCmd( | ||
`curl -u ${CREDENTIALS} -F 'cmd=createSiteFromSiteTemplate' -F 'operation=asyncCreateSiteFromSiteTemplate' -F '_charset_=utf-8' -F 'siteTemplate=/conf/global/site-templates/${TMPL_NAME}-${VERSION}' -F 'siteTitle=${SITE_NAME}' ${AEM_URL}/bin/asynccommand` | ||
); | ||
log( | ||
`Successfully redeployed Site Template v${VERSION} in ${ | ||
(Date.now() - startTime) / 1000 | ||
}s` | ||
); | ||
// /bin/asynccommand | ||
// cmd: createSiteFromSiteTemplate | ||
// operation: asyncCreateSiteFromSiteTemplate | ||
// _charset_: utf-8 | ||
// siteTitle: aem-site-template-tailwind | ||
// siteName: | ||
// path: aem-site-template-tailwind | ||
// siteTemplatePath: /conf/global/site-templates/aem-site-template-tailwind-1.23.21 |
8 changes: 8 additions & 0 deletions
8
site/src/main/content/jcr_root/conf/aem-site-template-tailwind/settings/dam/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<jcr:root | ||
xmlns:cq="http://www.day.com/jcr/cq/1.0" | ||
xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
jcr:primaryType="cq:Page" | ||
> | ||
<cfm /> | ||
</jcr:root> |
8 changes: 8 additions & 0 deletions
8
site/src/main/content/jcr_root/conf/aem-site-template-tailwind/settings/dam/cfm/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<jcr:root | ||
xmlns:cq="http://www.day.com/jcr/cq/1.0" | ||
xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
jcr:primaryType="cq:Page" | ||
> | ||
<models /> | ||
</jcr:root> |
11 changes: 11 additions & 0 deletions
11
...ain/content/jcr_root/conf/aem-site-template-tailwind/settings/dam/cfm/models/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<jcr:root | ||
xmlns:cq="http://www.day.com/jcr/cq/1.0" | ||
xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
xmlns:nt="http://www.jcp.org/jcr/nt/1.0" | ||
jcr:primaryType="cq:Page" | ||
> | ||
<jcr:content jcr:primaryType="nt:unstructured" /> | ||
<blog-post /> | ||
<contributor /> | ||
</jcr:root> |
147 changes: 147 additions & 0 deletions
147
...t/jcr_root/conf/aem-site-template-tailwind/settings/dam/cfm/models/blog-post/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<jcr:root | ||
xmlns:sling="http://sling.apache.org/jcr/sling/1.0" | ||
xmlns:granite="http://www.adobe.com/jcr/granite/1.0" | ||
xmlns:cq="http://www.day.com/jcr/cq/1.0" | ||
xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
xmlns:nt="http://www.jcp.org/jcr/nt/1.0" | ||
jcr:primaryType="cq:Template" | ||
allowedPaths="[/content/entities(/.*)?]" | ||
ranking="{Long}100" | ||
> | ||
<jcr:content | ||
cq:scaffolding="/conf/aem-site-template-tailwind/settings/dam/cfm/models/blog-post/jcr:content/model" | ||
cq:templateType="/libs/settings/dam/cfm/model-types/fragment" | ||
jcr:primaryType="cq:PageContent" | ||
jcr:title="Blog Post" | ||
sling:resourceSuperType="dam/cfm/models/console/components/data/entity" | ||
sling:resourceType="dam/cfm/models/console/components/data/entity/default" | ||
status="enabled" | ||
> | ||
<metadata jcr:primaryType="nt:unstructured" /> | ||
<model | ||
cq:targetPath="/content/entities" | ||
jcr:primaryType="cq:PageContent" | ||
sling:resourceType="wcm/scaffolding/components/scaffolding" | ||
dataTypesConfig="/mnt/overlay/settings/dam/cfm/models/formbuilderconfig/datatypes" | ||
maxGeneratedOrder="20" | ||
> | ||
<cq:dialog | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="cq/gui/components/authoring/dialog" | ||
> | ||
<content | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns" | ||
> | ||
<items | ||
jcr:primaryType="nt:unstructured" | ||
maxGeneratedOrder="26" | ||
> | ||
<_x0031_646412355783 | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="granite/ui/components/coral/foundation/form/textfield" | ||
fieldLabel="Title" | ||
listOrder="21" | ||
maxlength="255" | ||
metaType="text-single" | ||
name="title" | ||
renderReadOnly="false" | ||
required="on" | ||
showEmptyInReadOnly="true" | ||
valueType="string" | ||
> | ||
<granite:data jcr:primaryType="nt:unstructured" /> | ||
</_x0031_646412355783> | ||
<_x0031_646412541876 | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="dam/cfm/models/editor/components/datatypes/datepicker" | ||
displayedFormat="YYYY-MM-DD HH:mm" | ||
emptyText="[YYYY-MM-DD HH:mm,YYYY-MM-DD HH:mm:ss]" | ||
fieldLabel="Publish Date" | ||
listOrder="25" | ||
metaType="date" | ||
name="publishDate" | ||
renderReadOnly="false" | ||
showEmptyInReadOnly="true" | ||
type="datetime" | ||
valueFormat="YYYY-MM-DD[T]HH:mm:ss.000Z" | ||
valueType="calendar/datetime" | ||
> | ||
<granite:data | ||
jcr:primaryType="nt:unstructured" | ||
typeHint="Date" | ||
/> | ||
</_x0031_646412541876> | ||
<_x0031_646412430864 | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="dam/cfm/admin/components/authoring/contenteditor/multieditor" | ||
cfm-element="Description" | ||
checked="false" | ||
default-mime-type="text/html" | ||
listOrder="24" | ||
metaType="text-multi" | ||
name="description" | ||
renderReadOnly="false" | ||
showEmptyInReadOnly="true" | ||
valueType="string/multiline" | ||
/> | ||
<_x0031_646412555746 | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="dam/cfm/models/editor/components/fragmentreference" | ||
allowNew="{Boolean}true" | ||
fieldLabel="Contributor" | ||
filter="hierarchy" | ||
fragmentmodelreference="/conf/aem-site-template-tailwind/settings/dam/cfm/models/contributor" | ||
listOrder="26" | ||
metaType="fragment-reference" | ||
name="contributor" | ||
nameSuffix="contentReference" | ||
renderReadOnly="false" | ||
showEmptyInReadOnly="true" | ||
valueType="string/content-fragment" | ||
> | ||
<field jcr:primaryType="nt:unstructured" /> | ||
<granite:data jcr:primaryType="nt:unstructured" /> | ||
</_x0031_646412555746> | ||
<_x0031_646412406301 | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="dam/cfm/models/editor/components/contentreference" | ||
fieldLabel="Featured Image" | ||
filter="hierarchy" | ||
listOrder="23" | ||
metaType="reference" | ||
name="featuredImage" | ||
nameSuffix="contentReference" | ||
renderReadOnly="false" | ||
showEmptyInReadOnly="true" | ||
showThumbnail="true" | ||
validation="[cfm.validation.contenttype.image,cfm.validation.contenttype.video]" | ||
valueType="string/reference" | ||
> | ||
<granite:data | ||
jcr:primaryType="nt:unstructured" | ||
showThumbnail="true" | ||
thumbnail-validation="cfm.validation.thumbnail.show" | ||
/> | ||
</_x0031_646412406301> | ||
<_x0031_646412377697 | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="dam/cfm/admin/components/authoring/contenteditor/multieditor" | ||
cfm-element="Blog Content" | ||
checked="false" | ||
default-mime-type="text/html" | ||
listOrder="22" | ||
metaType="text-multi" | ||
name="blogContent" | ||
renderReadOnly="false" | ||
required="on" | ||
showEmptyInReadOnly="true" | ||
valueType="string/multiline" | ||
/> | ||
</items> | ||
</content> | ||
</cq:dialog> | ||
</model> | ||
</jcr:content> | ||
</jcr:root> |
Oops, something went wrong.