Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
zoe
main
Commits
e15b341a
Commit
e15b341a
authored
Feb 10, 2017
by
Daniele Venzano
Browse files
Add Jenkinsfile and test image Dockerfile
parent
773ffea5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Jenkinsfile
0 → 100644
View file @
e15b341a
#
!
groovy
node
(
'docker-trusty'
)
{
stage
(
'Cleanup'
)
{
step
([
$class
:
'WsCleanup'
])
}
stage
(
'Checkout'
)
{
checkout
scm
sshagent
([
'67aa0a6c-64d5-40bd-ae9f-4ff66de97411'
])
{
sh
"git checkout ${BRANCH_NAME}"
}
}
stage
(
'Install prerequisites'
)
{
sh
"virtualenv venv"
sh
"""
. venv/bin/activate
pip install -r requirements.txt
"""
sh
"""
. venv/bin/activate
pip install -r requirements_tests.txt
"""
}
stage
(
'Test'
)
{
try
{
sh
"""
. venv/bin/activate
bash ./run_tests.sh
"""
currentBuild
.
result
=
'SUCCESS'
}
catch
(
Exception
err
)
{
currentBuild
.
result
=
'FAILURE'
}
}
stage
(
'Push'
)
{
try
{
if
(
currentBuild
.
result
==
'SUCCESS'
)
{
echo
"Test successful, pushing to github"
sshagent
([
'67aa0a6c-64d5-40bd-ae9f-4ff66de97411'
])
{
sh
"git remote add github git@github.com:DistributedSystemsGroup/zoe.git"
sh
"git branch -a"
sh
"git push github HEAD"
sh
"git push github --tags"
}
}
else
{
echo
"Build failed, no push"
}
}
catch
(
Exception
err
)
{
currentBuild
.
result
=
'FAILURE'
}
}
stage
(
'Notification and cleanup'
)
{
echo
"Sending notifications"
step
([
$class
:
'Mailer'
,
notifyEveryUnstableBuild:
true
,
recipients:
'daniele.venzano@eurecom.fr'
,
sendToIndividuals:
true
])
step
([
$class
:
'GitHubCommitStatusSetter'
,
errorHandlers:
[[
$class
:
'ChangingBuildStatusErrorHandler'
,
result:
'FAILURE'
]],
reposSource:
[
$class
:
'ManuallyEnteredRepositorySource'
,
url:
'https://github.com/DistributedSystemsGroup/zoe.git'
]])
}
}
contrib/jenkins_docker/Dockerfile
0 → 100644
View file @
e15b341a
# This Dockerfile is used to build an image for testing Zoe with Jenkins and the Docker slave plugin
FROM
ubuntu:trusty
MAINTAINER
Daniele Venzano <venza@brownhat.org>
RUN
locale-gen en_US.UTF-8
&&
\
apt-get
-q
update
&&
\
DEBIAN_FRONTEND
=
"noninteractive"
apt-get
-q
upgrade
-y
--no-install-recommends
&&
\
DEBIAN_FRONTEND
=
"noninteractive"
apt-get
-q
install
-y
--no-install-recommends
openssh-server openjdk-7-jre-headless python3 python3-pip git python3-dev build-essential libpq-dev
&&
\
apt-get
-q
autoremove
&&
\
apt-get
-q
clean
-y
&&
rm
-rf
/var/lib/apt/lists/
*
&&
rm
-f
/var/cache/apt/
*
.bin
&&
\
sed
-i
's|session required pam_loginuid.so|session optional pam_loginuid.so|g'
/etc/pam.d/sshd
&&
\
mkdir
-p
/var/run/sshd
ENV
LANG en_US.UTF-8
ENV
LANGUAGE en_US:en
ENV
LC_ALL en_US.UTF-8
# Set user jenkins to the image
RUN
useradd
-m
-d
/home/jenkins
-s
/bin/sh jenkins
&&
\
echo
"jenkins:jenkins"
| chpasswd
RUN
pip3
install
--upgrade
pip virtualenv
RUN
printf
"
\n
StrictHostKeyChecking no
\n
"
>>
/etc/ssh/ssh_config
# Standard SSH port
EXPOSE
22
# Default command
CMD
["/usr/sbin/sshd", "-D"]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment