Skip to content

Commit

Permalink
Merge pull request #3 from openmicroscopy/fix-travis
Browse files Browse the repository at this point in the history
Fix travis
sbesson committed Nov 12, 2015

Verified

This commit was signed with the committer’s verified signature.
dmihalcik-virtru Dave Mihalcik
2 parents 2b03398 + d142b47 commit 46c7183
Showing 6 changed files with 38 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -6,8 +6,11 @@ services:
- docker

before_install:
- docker-compose build
- ./rename.py travis

install:
- docker-compose build

script:
- docker-compose up -d slave
- docker-compose stop
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ jenkins:
- SERVICE_NAME=SPACENAME-ci

git:
image: openmicroscopy/tags:5.1.1
build: git
volumes:
- /src
command: 'true'
13 changes: 13 additions & 0 deletions git/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM mini/base
MAINTAINER [email protected]

ENV TAG 5.1.4

RUN apk-install git && \
mkdir /src

RUN time git clone --bare --depth=1 -b v$TAG git://github.com/ome/scripts/ /src/scripts.git
RUN time git clone --bare --depth=1 -b v$TAG git://github.com/openmicroscopy/openmicroscopy /src/omero.git
RUN time git clone --bare --depth=1 -b v$TAG git://github.com/openmicroscopy/bioformats /src/bio-formats.git

WORKDIR /src
3 changes: 1 addition & 2 deletions jenkins/Dockerfile
Original file line number Diff line number Diff line change
@@ -2,9 +2,8 @@ FROM jenkins
MAINTAINER OME

USER root
RUN usermod -u 11521 jenkins
RUN usermod -u SPACEUSER jenkins
RUN chown -R jenkins /usr/share/jenkins/
RUN chown -R jenkins /var/log/copy_reference_file.log
USER jenkins

COPY plugins.txt /usr/share/jenkins/plugins.txt
22 changes: 18 additions & 4 deletions rename.py
Original file line number Diff line number Diff line change
@@ -5,20 +5,33 @@
import fnmatch
import os

def replace(name, branch):
def replace(name, branch, uid):
cnt = 0
for root, dir, files in os.walk("."):
yml = list(fnmatch.filter(files, "*.yml"))
xml = list(fnmatch.filter(files, "*.xml"))
dkr = list(fnmatch.filter(files, "Dockerfile"))
for f in yml + xml:
fname = os.path.join(root, f)
print "Setting space to '%s' in %s" % (name, fname)
for line in fileinput.input([fname], inplace=True):
line = line.replace("SPACENAME", name)
line = line.replace("SPACEBRANCH", name)
if "SPACE" in line:
cnt += 1
line = line.replace("SPACENAME", name)
line = line.replace("SPACEBRANCH", name)
print line,
for f in dkr:
fname = os.path.join(root, f)
for line in fileinput.input([fname], inplace=True):
if "SPACE" in line:
cnt += 1
line = line.replace("SPACEUSER", str(uid))
print line,
return cnt

if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--uid", type=int, default=os.getuid())
parser.add_argument("name")
parser.add_argument("branch", nargs="?")
ns = parser.parse_args()
@@ -27,5 +40,6 @@ def replace(name, branch):
if not branch:
branch = name

replace(name, branch)
# This number will need to be updated when new changes are commited.
assert 19 == replace(name, branch, ns.uid)
print "Done. You may want to review and commit your changes now"
2 changes: 1 addition & 1 deletion slave/Dockerfile
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ ENV JENKINS_SWARM_VERSION 1.24
ENV HOME /home/jenkins-slave

RUN useradd -c "Jenkins Slave user" -d $HOME -m jenkins-slave
RUN usermod -u 11521 jenkins-slave
RUN usermod -u SPACEUSER jenkins-slave
RUN curl --create-dirs -sSLo /usr/share/jenkins/swarm-client-$JENKINS_SWARM_VERSION-jar-with-dependencies.jar http://maven.jenkins-ci.org/content/repositories/releases/org/jenkins-ci/plugins/swarm-client/$JENKINS_SWARM_VERSION/swarm-client-$JENKINS_SWARM_VERSION-jar-with-dependencies.jar \
&& chmod 755 /usr/share/jenkins

0 comments on commit 46c7183

Please sign in to comment.