Skip to content

Commit

Permalink
Refs #87909 - Jenkinsfile - tearDown Docker containers safely
Browse files Browse the repository at this point in the history
  • Loading branch information
avoinea committed Sep 14, 2017
1 parent 8285f33 commit 95ebfac
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 73 deletions.
112 changes: 46 additions & 66 deletions Jenkinsfile
Expand Up @@ -12,28 +12,37 @@ pipeline {

"WWW": {
node(label: 'docker-1.13') {
sh '''
NAME="$BUILD_TAG-www"
docker run -i --net=host --name="$NAME" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" eeacms/www-devel /debug.sh bin/test -v -vv -s $GIT_NAME
docker rm -v $NAME'''
script {
try {
sh '''docker run -i --net=host --name="$BUILD_TAG-www" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" eeacms/www-devel /debug.sh bin/test -v -vv -s $GIT_NAME'''
} finally {
sh '''docker rm -v $BUILD_TAG-www'''
}
}
}
},

"KGS": {
node(label: 'docker-1.13') {
sh '''
NAME="$BUILD_TAG-kgs"
docker run -i --net=host --name="$NAME" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" eeacms/kgs-devel /debug.sh bin/test --test-path /plone/instance/src/$GIT_NAME -v -vv -s $GIT_NAME
docker rm -v $NAME'''
script {
try {
sh '''docker run -i --net=host --name="$BUILD_TAG-kgs" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" eeacms/kgs-devel /debug.sh bin/test --test-path /plone/instance/src/$GIT_NAME -v -vv -s $GIT_NAME'''
} finally {
sh '''docker rm -v $BUILD_TAG-kgs'''
}
}
}
},

"Plone4": {
node(label: 'docker-1.13') {
sh '''
NAME="$BUILD_TAG-plone4"
docker run -i --net=host --name="$NAME" -v /plone/instance/parts -e GIT_BRANCH="$BRANCH_NAME" -e ADDONS="$GIT_NAME" -e DEVELOP="src/$GIT_NAME" eeacms/plone-test:4 -v -vv -s $GIT_NAME
docker rm -v $NAME'''
script {
try {
sh '''docker run -i --net=host --name="$BUILD_TAG-plone4" -v /plone/instance/parts -e GIT_BRANCH="$BRANCH_NAME" -e ADDONS="$GIT_NAME" -e DEVELOP="src/$GIT_NAME" eeacms/plone-test:4 -v -vv -s $GIT_NAME'''
} finally {
sh '''docker rm -v $BUILD_TAG-plone4'''
}
}
}
}
)
Expand All @@ -48,14 +57,9 @@ docker rm -v $NAME'''
node(label: 'docker-1.13') {
script {
try {
sh '''
NAME="$BUILD_TAG-zptlint"
GIT_SRC="https://github.com/eea/$GIT_NAME.git --branch=$BRANCH_NAME"
docker run -i --net=host --name="$NAME" -e GIT_SRC="$GIT_SRC" eeacms/zptlint
docker rm -v $NAME'''
} catch (err) {
echo "Unstable: ${err}"
throw err
sh '''docker run -i --net=host --name="$BUILD_TAG-zptlint" -e GIT_SRC="https://github.com/eea/$GIT_NAME.git --branch=$BRANCH_NAME" eeacms/zptlint'''
} finally {
sh '''docker rm -v $BUILD_TAG-zptlint'''
}
}
}
Expand All @@ -65,14 +69,9 @@ docker rm -v $NAME'''
node(label: 'docker-1.13') {
script {
try {
sh '''
NAME="$BUILD_TAG-jslint"
GIT_SRC="https://github.com/eea/$GIT_NAME.git --branch=$BRANCH_NAME"
docker run -i --net=host --name="$NAME" -e GIT_SRC="$GIT_SRC" eeacms/jslint4java
docker rm -v $NAME'''
} catch (err) {
echo "Unstable: ${err}"
throw err
sh '''docker run -i --net=host --name="$BUILD_TAG-jslint" -e GIT_SRC="https://github.com/eea/$GIT_NAME.git --branch=$BRANCH_NAME" eeacms/jslint4java'''
} finally {
sh '''docker rm -v $BUILD_TAG-jslint'''
}
}
}
Expand All @@ -82,14 +81,9 @@ docker rm -v $NAME'''
node(label: 'docker-1.13') {
script {
try {
sh '''
NAME="$BUILD_TAG-pyflakes"
GIT_SRC="https://github.com/eea/$GIT_NAME.git --branch=$BRANCH_NAME"
docker run -i --net=host --name="$NAME" -e GIT_SRC="$GIT_SRC" eeacms/pyflakes
docker rm -v $NAME'''
} catch (err) {
echo "Unstable: ${err}"
throw err
sh '''docker run -i --net=host --name="$BUILD_TAG-pyflakes" -e GIT_SRC="https://github.com/eea/$GIT_NAME.git --branch=$BRANCH_NAME" eeacms/pyflakes'''
} finally {
sh '''docker rm -v $BUILD_TAG-pyflakes'''
}
}
}
Expand All @@ -99,14 +93,9 @@ docker rm -v $NAME'''
node(label: 'docker-1.13') {
script {
try {
sh '''
NAME="$BUILD_TAG-i18n"
GIT_SRC="https://github.com/eea/$GIT_NAME.git --branch=$BRANCH_NAME"
docker run -i --net=host --name=$NAME -e GIT_SRC="$GIT_SRC" eeacms/i18ndude
docker rm -v $NAME'''
} catch (err) {
echo "Unstable: ${err}"
throw err
sh '''docker run -i --net=host --name=$BUILD_TAG-i18n -e GIT_SRC="https://github.com/eea/$GIT_NAME.git --branch=$BRANCH_NAME" eeacms/i18ndude'''
} finally {
sh '''docker rm -v $BUILD_TAG-i18n'''
}
}
}
Expand All @@ -123,13 +112,11 @@ docker rm -v $NAME'''
node(label: 'docker-1.13') {
script {
try {
sh '''
NAME="$BUILD_TAG-jshint"
GIT_SRC="https://github.com/eea/$GIT_NAME.git --branch=$BRANCH_NAME"
docker run -i --net=host --name="$NAME" -e GIT_SRC="$GIT_SRC" eeacms/jshint
docker rm -v $NAME'''
sh '''docker run -i --net=host --name="$BUILD_TAG-jshint" -e GIT_SRC="https://github.com/eea/$GIT_NAME.git --branch=$BRANCH_NAME" eeacms/jshint'''
} catch (err) {
echo "Unstable: ${err}"
} finally {
sh '''docker rm -v $BUILD_TAG-jshint'''
}
}
}
Expand All @@ -139,13 +126,11 @@ docker rm -v $NAME'''
node(label: 'docker-1.13') {
script {
try {
sh '''
NAME="$BUILD_TAG-csslint"
GIT_SRC="https://github.com/eea/$GIT_NAME.git --branch=$BRANCH_NAME"
docker run -i --net=host --name="$NAME" -e GIT_SRC="$GIT_SRC" eeacms/csslint
docker rm -v $NAME'''
sh '''docker run -i --net=host --name="$BUILD_TAG-csslint" -e GIT_SRC="https://github.com/eea/$GIT_NAME.git --branch=$BRANCH_NAME" eeacms/csslint'''
} catch (err) {
echo "Unstable: ${err}"
} finally {
sh '''docker rm -v $BUILD_TAG-csslint'''
}
}
}
Expand All @@ -155,30 +140,25 @@ docker rm -v $NAME'''
node(label: 'docker-1.13') {
script {
try {
sh '''
NAME="$BUILD_TAG-pep8"
GIT_SRC="https://github.com/eea/$GIT_NAME.git --branch=$BRANCH_NAME"
docker run -i --net=host --name="$NAME" -e GIT_SRC="$GIT_SRC" eeacms/pep8
docker rm -v $NAME'''
sh '''docker run -i --net=host --name="$BUILD_TAG-pep8" -e GIT_SRC="https://github.com/eea/$GIT_NAME.git --branch=$BRANCH_NAME" eeacms/pep8'''
} catch (err) {
echo "Unstable: ${err}"
} finally {
sh '''docker rm -v $BUILD_TAG-pep8'''
}
}
}
},


"PyLint": {
node(label: 'docker-1.13') {
script {
try {
sh '''
NAME="$BUILD_TAG-pylint"
GIT_SRC="https://github.com/eea/$GIT_NAME.git --branch=$BRANCH_NAME"
docker run -i --net=host --name="$NAME" -e GIT_SRC="$GIT_SRC" eeacms/pylint
docker rm -v $NAME'''
sh '''docker run -i --net=host --name="$BUILD_TAG-pylint" -e GIT_SRC="https://github.com/eea/$GIT_NAME.git --branch=$BRANCH_NAME" eeacms/pylint'''
} catch (err) {
echo "Unstable: ${err}"
} finally {
sh '''docker rm -v $BUILD_TAG-pylint'''
}
}
}
Expand Down Expand Up @@ -212,4 +192,4 @@ docker rm -v $NAME'''
}
}
}
}
}
10 changes: 3 additions & 7 deletions README.rst
@@ -1,12 +1,8 @@
=================
EEA Google Charts
=================
.. image:: http://ci.eionet.europa.eu/job/eea.googlecharts-www/badge/icon
:target: http://ci.eionet.europa.eu/job/eea.googlecharts-www/lastBuild
.. image:: http://ci.eionet.europa.eu/job/eea.googlecharts-plone4/badge/icon
:target: http://ci.eionet.europa.eu/job/eea.googlecharts-plone4/lastBuild
.. image:: http://ci.eionet.europa.eu/job/eea.googlecharts-zope/badge/icon
:target: http://ci.eionet.europa.eu/job/eea.googlecharts-zope/lastBuild
.. image:: http://ci.eionet.europa.eu/job/eea/job/eea.googlecharts/job/master/badge/icon
:target: http://ci.eionet.europa.eu/job/eea/job/eea.googlecharts/job/master/display/redirect

`EEA Google Charts`_ provides `Google Charts`_ framework integration for
`eea.app.visualization`_. See `eea.daviz`_ package for more details.
Expand Down Expand Up @@ -58,7 +54,7 @@ Live demos

* `Basic tutorials <http://www.youtube.com/playlist?list=PLVPSQz7ahsByeq8nVKC7TT9apArEXBrV0>`_
* `Advanced tutorials <http://www.youtube.com/playlist?list=PLVPSQz7ahsBxbe8pwzFWLQuvDSP9JFn8I>`_
* `Daviz showroom <http://daviz.eionet.europa.eu>`_
* `Daviz showroom <https://www.eea.europa.eu/data-and-maps/daviz>`_
* `Google charts demos <http://code.google.com/apis/chart/>`_


Expand Down

0 comments on commit 95ebfac

Please sign in to comment.