Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Proposal to deploy Docker image on each commit on master #532

Merged
merged 1 commit into from
Apr 25, 2019
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
22 changes: 20 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ matrix:
- python: "3.5"
- python: "3.6"
- python: "3.7-dev"
- env: BUILD_DOCKER=1
- env:
- BUILD_DOCKER=1
# Variable to add to publish the Docker image:
# * DOCKER_USERNAME
# * DOCKER_PASSWORD, to be encrypted, use `travis encrypt DOCKER_PASSWORD=<password>`
services:
- docker
before_install:
- true
install:
- true
script:
- docker build -t paperless .
- docker build --tag=the-paperless-project/paperless .
after_success:
- true

Expand All @@ -37,3 +41,17 @@ script:

after_success:
- coveralls

deploy:
- provider: script
skip_cleanup: true
script: ci/deploy-docker
on:
tags: true
condition: '"${BUILD_DOCKER}" = 1'
- provider: script
skip_cleanup: true
script: ci/deploy-docker
on:
branch: master
condition: '"${BUILD_DOCKER}" = 1'
15 changes: 15 additions & 0 deletions ci/deploy-docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

if [ "${DOCKER_USERNAME}" == "" -o "${DOCKER_PASSWORD}" == "" ]
then
exit 0
fi

docker login --username=${DOCKER_USERNAME} --password=${DOCKER_PASSWORD}
if [ "${TRAVIS_TAG}" != "" ]
then
docker tag the-paperless-project/paperless the-paperless-project/paperless:${TRAVIS_TAG}
docker push the-paperless-project/paperless:${TRAVIS_TAG}
else
docker push the-paperless-project/paperless
fi