Skip to content

Commit 40de217

Browse files
committed
Add support for docker
Add support for creating a docker image that can be used to run cvs2svn and also to run the test suite.
1 parent 5dee635 commit 40de217

File tree

5 files changed

+86
-0
lines changed

5 files changed

+86
-0
lines changed

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git
2+
.gitignore
3+
build
4+
*-tmp
5+
*.tar.gz

Dockerfile

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# cvs2svn has some dependencies that are no longer widely available
2+
# (e.g., Python 2.x and an oldish version of the Subversion library).
3+
# This Dockerfile builds images that can be used to run or test
4+
# cvs2svn. Note that it is based on debian:jessie, which is pretty
5+
# old. But this is the most recent version of Debian where the
6+
# required dependencies are easily available. One way to use this is
7+
# to run
8+
#
9+
# make docker-image
10+
#
11+
# to make an image for running cvs2svn, or
12+
#
13+
# make docker-test
14+
#
15+
# to make an image for testing cvs2svn and to run those tests using
16+
# the image.
17+
18+
FROM debian:jessie AS run
19+
20+
RUN apt-get update && \
21+
apt-get install -y \
22+
python \
23+
python-bsddb3 \
24+
subversion \
25+
rcs \
26+
cvs
27+
28+
RUN mkdir /src
29+
WORKDIR /src
30+
COPY . .
31+
RUN ${PYTHON} ./setup.py install
32+
33+
# The CVS repository can be mounted here:
34+
VOLUME ["/cvs"]
35+
36+
# A volume for storing temporary files can be mounted here:
37+
VOLUME ["/tmp"]
38+
39+
ENTRYPOINT ["cvs2svn"]
40+
41+
FROM run AS test
42+
43+
RUN ln -s /tmp cvs2svn-tmp
44+
45+
ENTRYPOINT ["./run-tests.py"]

Makefile

+21
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,24 @@ clean:
5353
rm -f $$d/*.pyc $$d/*.pyo; \
5454
done
5555

56+
# Create a docker image, tagged `cvs2svn`, which is ready to run
57+
# `cvs2svn` (as its ENTRYPOINT). The image can be used as follows:
58+
#
59+
# docker run -it --rm \
60+
# --mount 'src=/path/to/my/cvs,dst=/cvs,readonly' \
61+
# --mount 'type=volume,src=/tmp,dst=/tmp' \
62+
# cvs2svn [OPTS] /cvs
63+
#
64+
# By default, temporary files are stored under `/tmp`, so this
65+
# invocation mounts your local `/tmp` directory there. You should
66+
# either make sure that your `/tmp` partition has enough free space,
67+
# or mount a different directory there.
68+
.PHONY: docker-image
69+
docker-image:
70+
docker build --target=run -t cvs2svn .
71+
72+
# Create a docker image, then use it to run the automated tests.
73+
.PHONY: docker-test
74+
docker-test:
75+
docker build --target=test -t cvs2svn-test .
76+
docker run -it --rm --mount 'type=tmpfs,dst=/tmp' cvs2svn-testing

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@ cvs2svn features or if you're debugging or patching cvs2svn, you might
2929
want to use the master version (which is usually quite stable). To do
3030
so, use Git to clone the repository, and run it straight from the
3131
working copy.
32+
33+
This repository contains a `Dockerfile` that can be used to create a
34+
docker image in which cvs2svn can be run. (It has some dependencies
35+
that are no longer easily installable, so this is probably the easiest
36+
way to run cvs2svn.)

cvs2svn.md

+10
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ cvs2svn requires the following:
5353
required. The CVS home page is http://ccvs.cvshome.org/. See the
5454
`--use-cvs` flag for more details.
5555

56+
These dependencies are no longer so easy to find, so it might be
57+
convenient to use the `Dockerfile` in this repository to run
58+
`cvs2svn` inside a container. This can be done by running
59+
60+
make docker-image
61+
docker run -it --rm \
62+
--mount 'src=/path/to/my/cvs,dst=/cvs,readonly' \
63+
--mount 'type=volume,src=/tmp,dst=/tmp' \
64+
cvs2svn [OPTS] /cvs
65+
5666

5767
## CVSNT repositories
5868

0 commit comments

Comments
 (0)