plex-test/.drone.yml

38 lines
1.4 KiB
YAML

pipeline:
build:
image: spritsail/docker-build
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
repo: ppass-dev
test:
image: docker
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
commands:
- apk add --no-cache curl xmlstarlet grep
- export CUR_VERSION="$(docker inspect -f '{{ index .Config.Labels "io.spritsail.version.plex" }}' ppass-dev | cut -d- -f1)"
- CON_NAME=$(docker run --rm -d ppass-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: ppass-dev
repo: spritsail/plex-media-server
tags:
- 'plexpass'
- '%labelauto: %prefix: plexpass% io.spritsail.version.plex'
notify:
image: spritsail/notify
when: { status: [ success, failure ] }
secrets: [ webhook_url, notify_token ]