Skip to content

Commit

Permalink
Merge pull request #3 from DurhamARC/feature/validator-update
Browse files Browse the repository at this point in the history
Updates for latest version of validator
  • Loading branch information
GraemeWatt authored Mar 17, 2020
2 parents 199acd5 + d78a4d2 commit 2afe355
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 28 deletions.
17 changes: 10 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
sudo: required

services:
- docker

language: python

python:
- '2.7'

- '3.6'

env:
global:
Expand All @@ -25,6 +22,12 @@ install:

script:
- docker build -t $IMAGE_NAME .
- docker tag $IMAGE_NAME $IMAGE_NAME_REMOTE:latest
- docker login --password=$DOCKER_PASSWORD --username=$DOCKER_USERNAME
- docker push $IMAGE_NAME_REMOTE:latest

deploy:
skip_cleanup: true
provider: script
script: bash docker_push
on:
repo: HEPData/hepdata-converter-ws-docker
all_branches: true
condition: $TRAVIS_BRANCH == "master" || -n $TRAVIS_TAG
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
FROM hepdata/hepdata-converter

COPY requirements.txt /tmp/requirements.txt
FROM hepdata/hepdata-converter:0.1.35

RUN pip install --upgrade pip
RUN pip install --ignore-installed -r /tmp/requirements.txt && rm /tmp/requirements.txt
RUN pip install -I hepdata-converter-ws==0.1.7

CMD hepdata-converter-ws
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,31 @@

# hepdata-converter-ws-docker

*Build system for creating Docker image used by Travis testing framework for hepdata-converter-ws*
*Build system for creating Docker image used to run hepdata-converter-ws*

This is a *companion repository* for the https://github.com/HEPData/hepdata-converter-ws repository
(it is also included there as a submodule in ```docker``` directory)
This is a *companion repository* for the https://github.com/HEPData/hepdata-converter-ws repository.

This repository has only one purpose, to separate Dockerfile from the main hepdata-converter-ws
repository, in order to automate building Docker images with the help of Travis and then
pushing them to DockerHub.
This repository automates building Docker images with the help of Travis and then
pushing them to DockerHub. The docker image installs hepdata-converter-ws from pypi
and then runs the webservice (on its default port, 5000).

The basic workflow is as follows:

1. Modify Dockerfile / requirements.txt (or any other files)
1. Modify Dockerfile (or any other files) (e.g. to fix the pypi version of hepdata-converter-ws)
2. Commit it to the repository
3. Push the code
4. Travis will create Docker image from Dockerfile and upload it to DockerHub

## For developers

This file contains file requirements.txt, it is here on purpose, it should not be duplicated
in hepdata-converter-ws repository. Also Travis already has DockerHub credentials in
its encrypted variables. If credentials are ever changed also update secure
variables in Travis build, otherwise the image will be created but not uploaded.
Travis already has DockerHub credentials in its encrypted variables. If credentials are ever changed also
update secure variables in Travis build, otherwise the image will be created but not uploaded.

**Warning:** any build will trigger upload of the new image (regardless of the branch,
**Warning:** any build on master will trigger upload of the new image (regardless of the branch,
so be cautious about it, especially if you plan to start breaking things)


**Run me**
**Run me**
```
docker pull hepdata/hepdata-converter-ws
docker run --restart=always -d --name=hepdata_converter -p 0.0.0.0:5500:5000 hepdata/hepdata-converter-ws hepdata-converter-ws
Expand Down
5 changes: 5 additions & 0 deletions docker_push
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
TAG_NAME="${TRAVIS_TAG:-latest}"
docker tag $IMAGE_NAME $IMAGE_NAME_REMOTE:$TAG_NAME
echo "$DOCKER_PASSWORD" | docker login --username=$DOCKER_USERNAME --password-stdin
docker push $IMAGE_NAME_REMOTE:$TAG_NAME
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

0 comments on commit 2afe355

Please sign in to comment.