plex-test/.drone.yml

44 lines
1.5 KiB
YAML

pipeline:
build:
image: spritsail/docker-build
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
repo: plex-dev
tag:
image: docker
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
commands:
- docker inspect -f '{{ index .Config.Labels "io.spritsail.version.plex" }}' plex-dev | cut -d- -f1 > .plex_tag
test:
image: docker
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
commands:
- apk add --no-cache curl xmlstarlet grep
- export CUR_VERSION="$(cat .plex_tag)"
- CON_NAME=$(docker run --rm -d plex-dev)
- timeout -t 15 docker logs $$CON_NAME &
- sleep 10 # Wait for plex to start!
- curl -sSL --retry-max-time 30 --max-time 5 --retry 10 --retry-delay 5 --retry-connrefused
$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $$CON_NAME):32400/identity
| tee /dev/stderr
| xmlstarlet sel -t -v "/MediaContainer/@version"
| grep -qw $CUR_VERSION
- docker kill $$CON_NAME
publish:
image: spritsail/docker-publish
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
secrets: [ docker_username, docker_password, microbadger_token ]
when: { branch: [ master, pass ], event: [ push, tag, deployment ] }
from: plex-dev
repo: spritsail/plex-media-server
tags:
- 'latest'
- '%fileauto: .plex_tag'
notify:
image: spritsail/notify
when: { status: [ success, failure ] }
secrets: [ webhook_url, notify_token ]