Added deploy section to .travis.yml to automatically push docker images

This commit is contained in:
Michael Mayer 2018-09-17 12:11:19 +02:00
parent 4d68fa3139
commit bc4417b6b0
6 changed files with 25 additions and 8 deletions

View file

@ -4,10 +4,16 @@ services:
- docker
before_script:
- docker-compose -f docker-compose.travis.yml up -d
- docker-compose -f docker-compose.travis.yml up -d --build
script:
- docker-compose -f docker-compose.travis.yml exec photoprism make all migrate-db test
after_script:
- docker-compose -f docker-compose.travis.yml down
- docker-compose -f docker-compose.travis.yml down
deploy:
provider: script
script: scripts/docker_push.sh
on:
branch: master

View file

@ -14,10 +14,16 @@ install: install-bin install-assets install-config
install-bin:
$(GOINSTALL) cmd/photoprism/photoprism.go
install-assets:
cp -r assets /var/photoprism
mkdir -p /var/photoprism
mkdir -p /var/photoprism/photos
mkdir -p /var/photoprism/thumbnails
cp -r assets/favicons /var/photoprism
cp -r assets/public /var/photoprism
cp -r assets/templates /var/photoprism
cp -r assets/tensorflow /var/photoprism
install-config:
mkdir -p /etc/photoprism
cp configs/photoprism.prod.yml /etc/photoprism/photoprism.yml
test -e /etc/photoprism/photoprism.yml || cp -n configs/photoprism.prod.yml /etc/photoprism/photoprism.yml
build:
$(GOBUILD) cmd/photoprism/photoprism.go
js:
@ -34,9 +40,8 @@ clean:
rm -f $(BINARY_NAME)
tensorflow-model:
scripts/download-tf-model.sh
image:
docker build . --tag photoprism/photoprism
docker push photoprism/photoprism
docker-push:
scripts/docker-push.sh
fmt:
$(GOFMT) ./...
dep:

View file

@ -2,7 +2,7 @@ version: '3.3'
services:
photoprism:
build: .
image: photoprism/photoprism
ports:
- 80:80
volumes:

View file

@ -2,6 +2,7 @@ version: '3.3'
services:
photoprism:
build: .
image: photoprism/photoprism
command: tail -f /dev/null
volumes:

View file

@ -2,6 +2,7 @@ version: '3.3'
services:
photoprism:
build: .
image: photoprism/photoprism
command: tail -f /dev/null
ports:

4
scripts/docker-push.sh Executable file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env bash
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push photoprism/photoprism