Skip to content

Commit

Permalink
Merge pull request #3 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
avoinea authored Aug 11, 2022
2 parents 6c1ea18 + b9b85d2 commit d9386c2
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 51 deletions.
100 changes: 50 additions & 50 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,56 +79,56 @@ pipeline {
}
}

stage('Tests') {
steps {
parallel(
"Plone 5": {
node(label: 'docker') {
sh '''docker run -i --rm --name="$BUILD_TAG-plone5" -e GIT_BRANCH="$BRANCH_NAME" -e ADDONS="$GIT_NAME" -e DEVELOP="src/$GIT_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plone-test:5-python3 -v -vv -s $GIT_NAME'''
}
},

// "Plone 6": {
// node(label: 'docker') {
// script {
// checkout scm
// sh '''docker run -i --rm --name="$BUILD_TAG-plone6" -v $(pwd):/app/src/$GIT_NAME -e ADDONS="/app/src/$GIT_NAME[test]" -e DEVELOP="/app/src/$GIT_NAME" eeacms/eea-website-backend bin/zope-testrunner --auto-color --auto-progress --test-path /app/src/$GIT_NAME'''
// }
// }
// }
)
}
}

stage('Report to SonarQube') {
when {
allOf {
environment name: 'CHANGE_ID', value: ''
}
}
steps {
node(label: 'swarm') {
script{
checkout scm
// dir("xunit-reports") {
// unstash "xunit-reports"
// }
// unstash "coverage.xml"
// dir('xunit-functional') {
// unstash "xunit-functional"
// }
def scannerHome = tool 'SonarQubeScanner';
def nodeJS = tool 'NodeJS11';
withSonarQubeEnv('Sonarqube') {
// sh '''sed -i "s|/plone/instance/src/$GIT_NAME|$(pwd)|g" coverage.xml'''
// sh '''find xunit-functional -type f -exec mv {} xunit-reports/ ";"'''
sh "export PATH=$PATH:${scannerHome}/bin:${nodeJS}/bin; sonar-scanner -Dsonar.python.xunit.skipDetails=true -Dsonar.python.xunit.reportPath=xunit-reports/*.xml -Dsonar.python.coverage.reportPath=coverage.xml -Dsonar.sources=./eea -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done'''
}
}
}
}
}
// stage('Tests') {
// steps {
// parallel(
// "Plone 5": {
// node(label: 'docker') {
// sh '''docker run -i --rm --name="$BUILD_TAG-plone5" -e GIT_BRANCH="$BRANCH_NAME" -e ADDONS="$GIT_NAME" -e DEVELOP="src/$GIT_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plone-test:5-python3 -v -vv -s $GIT_NAME'''
// }
// },

// // "Plone 6": {
// // node(label: 'docker') {
// // script {
// // checkout scm
// // sh '''docker run -i --rm --name="$BUILD_TAG-plone6" -v $(pwd):/app/src/$GIT_NAME -e ADDONS="/app/src/$GIT_NAME[test]" -e DEVELOP="/app/src/$GIT_NAME" eeacms/eea-website-backend bin/zope-testrunner --auto-color --auto-progress --test-path /app/src/$GIT_NAME'''
// // }
// // }
// // }
// )
// }
// }

// stage('Report to SonarQube') {
// when {
// allOf {
// environment name: 'CHANGE_ID', value: ''
// }
// }
// steps {
// node(label: 'swarm') {
// script{
// checkout scm
// // dir("xunit-reports") {
// // unstash "xunit-reports"
// // }
// // unstash "coverage.xml"
// // dir('xunit-functional') {
// // unstash "xunit-functional"
// // }
// def scannerHome = tool 'SonarQubeScanner';
// def nodeJS = tool 'NodeJS11';
// withSonarQubeEnv('Sonarqube') {
// // sh '''sed -i "s|/plone/instance/src/$GIT_NAME|$(pwd)|g" coverage.xml'''
// // sh '''find xunit-functional -type f -exec mv {} xunit-reports/ ";"'''
// sh "export PATH=$PATH:${scannerHome}/bin:${nodeJS}/bin; sonar-scanner -Dsonar.python.xunit.skipDetails=true -Dsonar.python.xunit.reportPath=xunit-reports/*.xml -Dsonar.python.coverage.reportPath=coverage.xml -Dsonar.sources=./eea -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
// sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done'''
// }
// }
// }
// }
// }

stage('Pull Request') {
when {
Expand Down
5 changes: 5 additions & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

1.2 - (2022-08-11)
---------------------------
* Feature: Add blocks layout to Folder ctype [avoinea]
* Feature: Add homepage_inverse_view and homepage_view to LRF ctype [avoinea]

1.1 - (2022-08-05)
---------------------------
* Feature: Persist demo-www profile and auto-install dependency profiles [avoinea]
Expand Down
14 changes: 14 additions & 0 deletions eea/website/policy/browser/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,18 @@
xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="eea">

<browser:page
name="homepage_inverse_view"
for="zope.interface.Interface"
template="view.pt"
permission="zope2.View"
/>

<browser:page
name="homepage_view"
for="zope.interface.Interface"
template="view.pt"
permission="zope2.View"
/>

</configure>
17 changes: 17 additions & 0 deletions eea/website/policy/browser/view.pt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
lang="en"
metal:use-macro="context/@@main_template/macros/master"
i18n:domain="plone">
<body>

<metal:content-core fill-slot="content-core">
<metal:content-core define-macro="content-core">

</metal:content-core>
</metal:content-core>

</body>
</html>
19 changes: 19 additions & 0 deletions eea/website/policy/profiles/default/types/Folder.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<object name="Folder" meta_type="Dexterity FTI">
<property name="global_allow">True</property>
<property
name="model_source">&lt;model xmlns:i18n=&quot;http://xml.zope.org/namespaces/i18n&quot; xmlns:marshal=&quot;http://namespaces.plone.org/supermodel/marshal&quot; xmlns:form=&quot;http://namespaces.plone.org/supermodel/form&quot; xmlns:security=&quot;http://namespaces.plone.org/supermodel/security&quot; xmlns:users=&quot;http://namespaces.plone.org/supermodel/users&quot; xmlns:lingua=&quot;http://namespaces.plone.org/supermodel/lingua&quot; xmlns=&quot;http://namespaces.plone.org/supermodel/schema&quot;&gt;
&lt;schema&gt;
&lt;fieldset name=&quot;layout&quot; label=&quot;Layout&quot;&gt;
&lt;field name=&quot;blocks&quot; type=&quot;plone.schema.jsonfield.JSONField&quot;&gt;
&lt;default&gt;{&#x27;3003434a-2455-4222-98d4-9b0310154352&#x27;: {&#x27;@type&#x27;: &#x27;slate&#x27;, &#x27;placeholder&#x27;: &#x27;Add folder content&#x27;, &#x27;plaintext&#x27;: &#x27;&#x27;, &#x27;value&#x27;: [{&#x27;children&#x27;: [{&#x27;text&#x27;: &#x27;&#x27;}], &#x27;type&#x27;: &#x27;p&#x27;}]}, &#x27;3c6c3e6d-e1f1-4047-9e3a-27118ac67ff6&#x27;: {&#x27;@type&#x27;: &#x27;listing&#x27;, &#x27;block&#x27;: &#x27;3c6c3e6d-e1f1-4047-9e3a-27118ac67ff6&#x27;, &#x27;placeholder&#x27;: &#x27;Folder contents&#x27;, &#x27;query&#x27;: [], &#x27;variation&#x27;: &#x27;summary&#x27;}, &#x27;5a4f40e4-2d08-4594-9d5d-c0632d415c7f&#x27;: {&#x27;@type&#x27;: &#x27;title&#x27;, &#x27;fixed&#x27;: False, &#x27;placeholder&#x27;: &#x27;Add folder title&#x27;, &#x27;required&#x27;: False, &#x27;hideContentType&#x27;: True, &#x27;hideCreationDate&#x27;: True, &#x27;hidePublishingDate&#x27;: True, &#x27;hideModificationDate&#x27;: True, &#x27;hideShareButton&#x27;: False, &#x27;hideDownloadButton&#x27;: False}, &#x27;cddb507b-dbea-4ac5-bf83-80c2d5724307&#x27;: {&#x27;@type&#x27;: &#x27;description&#x27;, &#x27;fixed&#x27;: True, &#x27;placeholder&#x27;: &#x27;Add folder description&#x27;, &#x27;required&#x27;: True}}&lt;/default&gt;
&lt;description/&gt;
&lt;required&gt;False&lt;/required&gt;
&lt;title&gt;Blocks&lt;/title&gt;
&lt;/field&gt;
&lt;field name=&quot;blocks_layout&quot; type=&quot;plone.schema.jsonfield.JSONField&quot;&gt;
&lt;default&gt;{&#x27;items&#x27;: [&#x27;5a4f40e4-2d08-4594-9d5d-c0632d415c7f&#x27;, &#x27;cddb507b-dbea-4ac5-bf83-80c2d5724307&#x27;, &#x27;3c6c3e6d-e1f1-4047-9e3a-27118ac67ff6&#x27;, &#x27;3003434a-2455-4222-98d4-9b0310154352&#x27;]}&lt;/default&gt;
&lt;description/&gt;
&lt;required&gt;False&lt;/required&gt;
&lt;title&gt;Blocks Layout&lt;/title&gt;
&lt;/field&gt;
&lt;/fieldset&gt;
&lt;/schema&gt;
&lt;/model&gt;</property>
</object>
4 changes: 4 additions & 0 deletions eea/website/policy/profiles/default/types/LRF.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
<property name="behaviors" purge="False">
<element value="volto.blocks"/>
</property>
<property name="view_methods" purge="False">
<element value="homepage_view"/>
<element value="homepage_inverse_view"/>
</property>
</object>
2 changes: 1 addition & 1 deletion eea/website/policy/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1
1.2

0 comments on commit d9386c2

Please sign in to comment.