-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from eea/develop
First release
- Loading branch information
Showing
35 changed files
with
1,093 additions
and
136 deletions.
There are no files selected for viewing
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 @@ | ||
static/* |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ Changelog | |
========= | ||
|
||
|
||
1.0a1 (unreleased) | ||
1.1-dev0 (unreleased) | ||
------------------ | ||
|
||
- Initial release. | ||
|
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,226 @@ | ||
pipeline { | ||
agent any | ||
|
||
environment { | ||
GIT_NAME = "wise.theme" | ||
GIT_HISTORYFILE = "CHANGES.rst" | ||
SONARQUBE_TAGS = "water.eea.europa.eu-marine" | ||
// LINK_FREETDS_STATICALLY = "YES" | ||
// LINK_OPENSSL = "YES" | ||
// LINK_KRB5 = "YES" | ||
} | ||
|
||
stages { | ||
|
||
stage('Cosmetics') { | ||
steps { | ||
parallel( | ||
|
||
"JS Hint": { | ||
node(label: 'docker') { | ||
script { | ||
sh '''docker run -i --rm --name="$BUILD_TAG-jshint" -e GIT_SRC="https://github.com/eea/$GIT_NAME.git" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/jshint --exclude-path wise.theme/.jshintignore''' | ||
} | ||
} | ||
}, | ||
|
||
// "CSS Lint": { | ||
// node(label: 'docker') { | ||
// script { | ||
// sh '''docker run -i --rm --name="$BUILD_TAG-csslint" -e GIT_SRC="https://github.com/eea/$GIT_NAME.git" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/csslint --exclude-list=static''' | ||
// } | ||
// } | ||
// }, | ||
|
||
"PEP8": { | ||
node(label: 'docker') { | ||
script { | ||
sh '''docker run -i --rm --name="$BUILD_TAG-pep8" -e GIT_SRC="https://github.com/eea/$GIT_NAME.git" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/pep8 --exclude=sql2018.py,sql.py,sql_extra.py,db.py,data.py,utils.py,search,compliance,translation /code''' | ||
} | ||
} | ||
}, | ||
|
||
// "PyLint": { | ||
// node(label: 'docker') { | ||
// script { | ||
// sh '''docker run -i --rm --name="$BUILD_TAG-pylint" -e GIT_SRC="https://github.com/eea/$GIT_NAME.git" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/pylint''' | ||
// } | ||
// } | ||
// } | ||
|
||
) | ||
} | ||
} | ||
|
||
stage('Code') { | ||
steps { | ||
parallel( | ||
|
||
"ZPT Lint": { | ||
node(label: 'docker') { | ||
sh '''docker run -i --rm --name="$BUILD_TAG-zptlint" -e GIT_BRANCH="$BRANCH_NAME" -e ADDONS="$GIT_NAME" -e DEVELOP="src/$GIT_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plone-test:4 zptlint''' | ||
} | ||
}, | ||
|
||
// "JS Lint": { | ||
// node(label: 'docker') { | ||
// sh '''docker run -i --rm --name="$BUILD_TAG-jslint" -e GIT_SRC="https://github.com/eea/$GIT_NAME.git" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/jslint4java''' | ||
// } | ||
// }, | ||
|
||
// "PyFlakes": { | ||
// node(label: 'docker') { | ||
// sh '''docker run -i --rm --name="$BUILD_TAG-pyflakes" -e GIT_SRC="https://github.com/eea/$GIT_NAME.git" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/pyflakes''' | ||
// } | ||
// }, | ||
|
||
// "i18n": { | ||
// node(label: 'docker') { | ||
// sh '''docker run -i --rm --name=$BUILD_TAG-i18n -e GIT_SRC="https://github.com/eea/$GIT_NAME.git" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/i18ndude''' | ||
// } | ||
// } | ||
) | ||
} | ||
} | ||
|
||
stage('Tests') { | ||
steps { | ||
parallel( | ||
|
||
// "WWW": { | ||
// node(label: 'docker') { | ||
// script { | ||
// try { | ||
// sh '''docker run -i --name="$BUILD_TAG-www" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/www-devel /debug.sh coverage''' | ||
// sh '''mkdir -p xunit-reports; docker cp $BUILD_TAG-www:/plone/instance/parts/xmltestreport/testreports/. xunit-reports/''' | ||
// stash name: "xunit-reports", includes: "xunit-reports/*.xml" | ||
// sh '''docker cp $BUILD_TAG-www:/plone/instance/src/$GIT_NAME/coverage.xml coverage.xml''' | ||
// stash name: "coverage.xml", includes: "coverage.xml" | ||
// } finally { | ||
// sh '''docker rm -v $BUILD_TAG-www''' | ||
// } | ||
// junit 'xunit-reports/*.xml' | ||
// } | ||
// } | ||
// }, | ||
|
||
|
||
// "KGS": { | ||
// node(label: 'docker') { | ||
// sh '''docker run -i --rm --name="$BUILD_TAG-kgs" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/kgs-devel /debug.sh bin/test --test-path /plone/instance/src/$GIT_NAME -v -vv -s $GIT_NAME''' | ||
// } | ||
// }, | ||
|
||
// "Plone4": { | ||
// node(label: 'docker') { | ||
// sh '''docker run -i --rm --name="$BUILD_TAG-plone4" -e GIT_BRANCH="$BRANCH_NAME" -e ADDONS="$GIT_NAME" -e DEVELOP="src/$GIT_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plone-test:4 -v -vv -s $GIT_NAME''' | ||
// } | ||
// }, | ||
|
||
// "Plone5": { | ||
// 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 -v -vv -s $GIT_NAME''' | ||
// } | ||
// }, | ||
|
||
"Python3": { | ||
node(label: 'docker') { | ||
sh '''docker run -i --rm --name="$BUILD_TAG-python3" -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''' | ||
} | ||
} | ||
) | ||
} | ||
} | ||
|
||
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=./src -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 { | ||
not { | ||
environment name: 'CHANGE_ID', value: '' | ||
} | ||
environment name: 'CHANGE_TARGET', value: 'master' | ||
} | ||
steps { | ||
node(label: 'docker') { | ||
script { | ||
if ( env.CHANGE_BRANCH != "develop" && !( env.CHANGE_BRANCH.startsWith("hotfix")) ) { | ||
error "Pipeline aborted due to PR not made from develop or hotfix branch" | ||
} | ||
withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) { | ||
sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-pr" -e GIT_CHANGE_BRANCH="$CHANGE_BRANCH" -e GIT_CHANGE_AUTHOR="$CHANGE_AUTHOR" -e GIT_CHANGE_TITLE="$CHANGE_TITLE" -e GIT_TOKEN="$GITHUB_TOKEN" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e GIT_ORG="$GIT_ORG" -e GIT_NAME="$GIT_NAME" eeacms/gitflow''' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
stage('Release') { | ||
when { | ||
allOf { | ||
environment name: 'CHANGE_ID', value: '' | ||
branch 'master' | ||
} | ||
} | ||
steps { | ||
node(label: 'docker') { | ||
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'eea-jenkins', usernameVariable: 'EGGREPO_USERNAME', passwordVariable: 'EGGREPO_PASSWORD'],string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'),[$class: 'UsernamePasswordMultiBinding', credentialsId: 'pypi-jenkins', usernameVariable: 'PYPI_USERNAME', passwordVariable: 'PYPI_PASSWORD']]) { | ||
sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e EGGREPO_USERNAME="$EGGREPO_USERNAME" -e EGGREPO_PASSWORD="$EGGREPO_PASSWORD" -e GIT_NAME="$GIT_NAME" -e PYPI_USERNAME="$PYPI_USERNAME" -e PYPI_PASSWORD="$PYPI_PASSWORD" -e GIT_ORG="$GIT_ORG" -e GIT_TOKEN="$GITHUB_TOKEN" eeacms/gitflow''' | ||
} | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
post { | ||
changed { | ||
script { | ||
def url = "${env.BUILD_URL}/display/redirect" | ||
def status = currentBuild.currentResult | ||
def subject = "${status}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'" | ||
def summary = "${subject} (${url})" | ||
def details = """<h1>${env.JOB_NAME} - Build #${env.BUILD_NUMBER} - ${status}</h1> | ||
<p>Check console output at <a href="${url}">${env.JOB_BASE_NAME} - #${env.BUILD_NUMBER}</a></p> | ||
""" | ||
|
||
def color = '#FFFF00' | ||
if (status == 'SUCCESS') { | ||
color = '#00FF00' | ||
} else if (status == 'FAILURE') { | ||
color = '#FF0000' | ||
} | ||
|
||
emailext (subject: '$DEFAULT_SUBJECT', to: '$DEFAULT_RECIPIENTS', body: details) | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
recursive-include wise * | ||
include docs/* | ||
include *.md *.rst *.txt | ||
graft docs | ||
graft src | ||
global-exclude *pyc | ||
|
||
global-exclude *~ | ||
global-exclude *.un~ | ||
global-include *.mo |
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
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
# pylint: skip-file | ||
__import__('pkg_resources').declare_namespace(__name__) |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# pylint: skip-file | ||
""" blocks.py """ | ||
|
||
import json | ||
|
Oops, something went wrong.