Skip to content

Commit

Permalink
Merge pull request #109 from Baaaaam/docker
Browse files Browse the repository at this point in the history
update dockerfile/circle to update `:latest` on `develop` merge and `:stable` on `master` merge
  • Loading branch information
scopatz authored Nov 15, 2016
2 parents 6274fb1 + 9d73cb5 commit 47c3630
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 30 deletions.
1 change: 0 additions & 1 deletion Dockerfile

This file was deleted.

18 changes: 14 additions & 4 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ machine:

dependencies:
override:
# build cymetric:latest docker container
- docker/cymetric-ci/build_dockerfile_cymetric.sh latest
- docker build -t cyclus/cymetric:latest .

test:
Expand All @@ -14,17 +16,25 @@ deployment:
develop:
branch: develop
commands:
- docker build -t cyclus/cymetric-deps:latest docker/cymetric-deps
- docker build -t cyclus/cymetric:latest .
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
#build cymetric-deps:latest docker container and push it
- docker/cymetric-deps/build_dockerfile_deps.sh latest
- docker build -t cyclus/cymetric-deps:latest docker/cymetric-deps
- docker push cyclus/cymetric-deps:latest
#build cymetric:latest docker container and push it
- docker/cymetric-ci/build_dockerfile_cymetric.sh latest
- docker build -t cyclus/cymetric:latest .
- docker push cyclus/cymetric:latest

master:
branch: master
commands:
- docker build -t cyclus/cymetric-deps:stable docker/cymetric-deps
- docker build -t cyclus/cymetric:stable .
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
#build cymetric-deps:stable docker container and push it
- docker/cymetric-deps/build_dockerfile_deps.sh stable
- docker build -t cyclus/cymetric-deps:stable docker/cymetric-deps
- docker push cyclus/cymetric-deps:stable
#build cymetric-ci:stable docker container and push it
- docker/cymetric-ci/build_dockerfile_cymetric.sh stable
- docker build -t cyclus/cymetric:stable .
- docker push cyclus/cymetric:stable
22 changes: 9 additions & 13 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Both fodler contain a script to generate the proper Dockerfile require to
generate the `stable` or the `latest` version. The `stable` version should be
generated when merging on `master` branch and is build against
`cyclus/cycamore:stable` container. The `latest` verisonshould be build when
merging on `develop` branch and is build against `cyclus/cycamore:latest`.



* ``cymetric-ci`` is the dockerfile used for running cymetric on a continuous
integration service. This dockerfile assumes that the current working
Expand All @@ -7,16 +14,5 @@
dockerfile uses the base image ``cyclus/cycamore`` from the docker hub
repository.

* ``cymetric-deps`` builds all cymetric dependencies. This is used as the
base image for other dockerfiles that build cymetric and should be updated
only occasionally as needed (i.e. whenever we do a new release of
cyclus+cycamore) and pushed up to the docker hub ``cyclus/cyclus-deps``
repository:

```
cd cymetric-deps
docker build -t cyclus/cymetric-deps:X.X .
docker tag cyclus/cymetric-deps:X.X cyclus/cymetric:latest
docker push cyclus/cymetric-deps
```

* ``cymetric-deps`` builds all cymetric dependencies. This should be done at
each PR on `master` branch automatically.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

FROM cyclus/cymetric-deps
FROM cyclus/cymetric-deps:CYMETRIC_VERSION

COPY . /cymetric
WORKDIR /cymetric
Expand Down
19 changes: 19 additions & 0 deletions docker/cymetric-ci/build_dockerfile_cymetric.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

if [ $# -ne 1 ]; then
echo "illegal number of parameters"
exit 1
fi

if [ ! ${1} = "stable" ] && [ ! ${1} = "latest" ] ; then
echo "Version must be \"stable\" or \"latest\" !"
exit 1
fi

rm Dockerfile
sed -e s/CYMETRIC_VERSION/${1}/g docker/cymetric-ci/Dockerfile_template > Dockerfile

#docker build -t cyclus/cymetric:${1} docker/cymetric
#docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
#docker push cyclus/cymetric:${1}

11 changes: 0 additions & 11 deletions docker/cymetric-deps/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@

FROM cyclus/cycamore

RUN apt-get update
RUN apt-get install -y --force-yes --fix-missing python3-pip
RUN pip3 install cython numpy
RUN pip3 install tables
RUN pip3 install jinja2
RUN pip3 install pandas
RUN pip3 install numexpr argparse

11 changes: 11 additions & 0 deletions docker/cymetric-deps/Dockerfile_template
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

FROM cyclus/cycamore:CYCAMORE_VERSION

RUN apt-get update
RUN apt-get install -y --force-yes --fix-missing python3-pip
RUN pip3 install cython numpy
RUN pip3 install tables
RUN pip3 install jinja2
RUN pip3 install pandas
RUN pip3 install numexpr argparse

19 changes: 19 additions & 0 deletions docker/cymetric-deps/build_dockerfile_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

if [ $# -ne 1 ]; then
echo "illegal number of parameters"
exit 1
fi

if [ ! ${1} = "stable" ] && [ ! ${1} = "latest" ] ; then
echo "Version must be \"stable\" or \"latest\" !"
exit 1
fi

rm Dockerfile
sed -e s/CYCAMORE_VERSION/${1}/g docker/cymetric-deps/Dockerfile_template > Dockerfile

#docker build -t cyclus/cymetric-deps:${1} docker/cymetric-deps
#docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
#docker push cyclus/cymetric-deps:${1}

0 comments on commit 47c3630

Please sign in to comment.