Skip to content

Commit

Permalink
Merge pull request #40 from eea/develop
Browse files Browse the repository at this point in the history
changes to support the new Eionet Groups replacing the NFP branch
  • Loading branch information
valipod authored Nov 12, 2021
2 parents 7d9c818 + a1e9351 commit cb62f9a
Show file tree
Hide file tree
Showing 18 changed files with 178 additions and 161 deletions.
20 changes: 18 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,18 @@ pipeline {

"PloneSaaS": {
node(label: 'docker') {
sh '''docker pull eeacms/plonesaas-devel; docker run -i --rm --name="$BUILD_TAG-plonesaas" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plonesaas-devel /debug.sh bin/test --test-path /plone/instance/src/$GIT_NAME -v -vv -s $GIT_NAME'''
script {
try {
sh '''docker pull eeacms/plonesaas-devel; docker run -i --name="$BUILD_TAG-plonesaas" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plonesaas-devel /debug.sh coverage'''
sh '''mkdir -p xunit-reports; docker cp $BUILD_TAG-plonesaas:/plone/instance/parts/xmltestreport/testreports/. xunit-reports/'''
stash name: "xunit-reports", includes: "xunit-reports/*.xml"
sh '''docker cp $BUILD_TAG-plonesaas:/plone/instance/src/$GIT_NAME/coverage.xml coverage.xml'''
stash name: "coverage.xml", includes: "coverage.xml"
} finally {
sh '''docker rm -v $BUILD_TAG-plonesaas'''
}
junit 'xunit-reports/*.xml'
}
}
},
)
Expand All @@ -105,10 +116,15 @@ pipeline {
node(label: 'swarm') {
script{
checkout scm
dir("xunit-reports") {
unstash "xunit-reports"
}
unstash "coverage.xml"
def scannerHome = tool 'SonarQubeScanner';
def nodeJS = tool 'NodeJS11';
withSonarQubeEnv('Sonarqube') {
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 '''sed -i "s|/plone/instance/src/$GIT_NAME|$(pwd)|g" coverage.xml'''
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.reportPaths=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'''
}
}
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
=========

4.0 - (2021-11-12)
---------------------------
* changes to support the new Eionet Groups replacing the NFP branch
[valipod refs #140578]

3.2 - (2021-04-28)
---------------------------
* Change: Two bugfixes
Expand Down
13 changes: 7 additions & 6 deletions eea/ldapadmin/import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
import logging
from datetime import datetime
from io import BytesIO
import six.moves.urllib.error
import six.moves.urllib.parse
import six.moves.urllib.request
from six.moves import urllib
from six.moves import range
import xlwt

Expand All @@ -15,11 +13,11 @@ def attachment_header(filename):
''' create the attachment header '''
assert isinstance(filename, str)
try:
value = "filename=%s" % six.moves.urllib.parse.quote(filename)
value = "filename=%s" % urllib.parse.quote(filename)
except Exception as e:
# import pdb; pdb.set_trace() not tested exception
logger.error("Error setting filename %s", str(e))
value = "filename*=UTF-8''%s" % six.moves.urllib.parse.quote(filename)
value = "filename*=UTF-8''%s" % urllib.parse.quote(filename)
return "attachment; " + value


Expand Down Expand Up @@ -84,7 +82,10 @@ def generate_excel(header, rows):
try:
excel_1900 = datetime.strptime('01/01/1900', '%d/%m/%Y')
style.num_format_str = 'dd/MM/yyyy'
ws.write(row, col, (val - excel_1900).days + 2, style)
if val:
ws.write(row, col, (val - excel_1900).days + 2, style)
else:
ws.write(row, col, 1, style)
except TypeError:
if '\n' in val:
ws.write(row, col, val, wrapstyle)
Expand Down
1 change: 1 addition & 0 deletions eea/ldapadmin/ldapdump.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ def dump_ldap(ldap_logging_path):
log.info("%s does not exist", naaya_ldap_cfg)
else:
return main.dump_ldap(naaya_ldap_cfg)
return None
Loading

0 comments on commit cb62f9a

Please sign in to comment.