Skip to content

Commit

Permalink
Deploy a Docker image using Travis (#503)
Browse files Browse the repository at this point in the history
* Add Docker deployment

* Missing colon in if statement on docker_deploy

* Don't deploy both PyPI with Docker every time

* Remove tagged commit option for Docker deploy and add a TODO on how to address our tagging system

* Add TODO to change Docker deployment to run only on tagged commits (and not on every commit to master)

* Typo in $DOCKER_USERNAME

* Update README and only push to Docker on tagged commit

* Add Docker build status

* Undo Docker badge since we don't have automatic builds

* Update start_docker.sh

* Bump version to 0.2.10

* PyPI defaults to Python 3.7 minimum, need to specify Python 3.6
  • Loading branch information
alex-l-kong authored Feb 16, 2022
1 parent 4843b57 commit 144deae
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
14 changes: 11 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ install:
- travis_retry pip install -r requirements.txt
- travis_retry pip install -r requirements-test.txt
- travis_retry export PYTHONPATH=$PWD
# this is needed to install the requirements
# - travis_retry python setup.py install

env:
- MPLBACKEND=Agg
Expand All @@ -27,13 +25,23 @@ script:

jobs:
include:
- stage: deploy
- stage: pypi_deploy
python: 3.6
deploy:
provider: pypi
user: $PYPI_USERNAME
password: $PYPI_PASSWORD
on:
tags: true
- stage: docker_deploy
if: tag IS present
python: 3.6
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build -t "$TRAVIS_REPO_SLUG" .
- docker tag "$TRAVIS_REPO_SLUG" "$TRAVIS_REPO_SLUG":latest
- docker tag "$TRAVIS_REPO_SLUG" "$TRAVIS_REPO_SLUG":"${TRAVIS_TAG}"
- docker push "$TRAVIS_REPO_SLUG"

after_success:
- coveralls
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ Then input the command:
git clone https://github.com/angelolab/ark-analysis.git
```

Next, you'll need to set up a docker image with all of the required dependencies.
- First, [download](https://hub.docker.com/?overlay=onboarding) docker desktop.
- Once it's sucessfully installed, make sure it is running by looking in toolbar for the Docker whale.
Next, you'll need to set up the Docker image with all of the required dependencies:
- First, [download](https://hub.docker.com/?overlay=onboarding) Docker Desktop.
- Once it's sucessfully installed, make sure it is running by looking in toolbar for the Docker whale.
- Once it's running, enter the following commands into terminal

```
cd ark-analysis
docker build -t ark-analysis '.'
docker pull angelolab/ark-analysis:latest
```

You've now installed the code base.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from distutils.command.build_ext import build_ext as DistUtilsBuildExt
from setuptools import setup, find_packages

VERSION = '0.2.9'
VERSION = '0.2.10'


# set a long description which is basically the README
Expand Down
4 changes: 2 additions & 2 deletions start_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if [ ! -z "$external" ]
-v "$PWD/data:/data" \
-v "$external:/data/external" \
-v "$PWD/.toks:/home/.toks" \
ark-analysis:latest
angelolab/ark-analysis
else
docker run -it \
-p $PORT:$PORT \
Expand All @@ -73,5 +73,5 @@ if [ ! -z "$external" ]
-v "$PWD/$JUPYTER_DIR:/$JUPYTER_DIR" \
-v "$PWD/data:/data" \
-v "$PWD/.toks:/home/.toks" \
ark-analysis:latest
angelolab/ark-analysis
fi

0 comments on commit 144deae

Please sign in to comment.