mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Merge pull request #532 from sbrunner/docker-deploy
Proposal to deploy Docker image on each commit on master
This commit is contained in:
commit
351809b8a9
22
.travis.yml
22
.travis.yml
@ -12,7 +12,11 @@ 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:
|
||||
@ -20,7 +24,7 @@ matrix:
|
||||
install:
|
||||
- true
|
||||
script:
|
||||
- docker build -t paperless .
|
||||
- docker build --tag=the-paperless-project/paperless .
|
||||
after_success:
|
||||
- true
|
||||
|
||||
@ -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
ci/deploy-docker
Executable file
15
ci/deploy-docker
Executable file
@ -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
|
Loading…
x
Reference in New Issue
Block a user