Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix travis #3

Merged
merged 5 commits into from
Nov 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -6,7 +6,7 @@ jenkins:
- SERVICE_NAME=SPACENAME-ci

git:
image: openmicroscopy/tags:5.1.1
build: git
volumes:
- /src
command: 'true'
Expand Down
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 ome-devel@lists.openmicroscopy.org.uk

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
Expand Up @@ -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
Expand Down
22 changes: 18 additions & 4 deletions rename.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Up @@ -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

Expand Down