2
0
mirror of https://github.com/spritsail/plex-media-server.git synced 2024-11-08 18:56:22 +00:00
plex-media-server/.drone.yml
2017-09-13 22:40:14 +01:00

49 lines
1.6 KiB
YAML

services:
docker:
image: docker:dind
privileged: true
pipeline:
identify:
image: docker
commands:
# Grab the current version, prevents race conditions
#### Pass this into the Dockerfile somehow?
- apk add --no-cache openssl jq
- wget -qO- https://adam-ant.co.uk/plex/version.php | tee /dev/stderr | jq -r .release > .plex_version
build:
image: docker
environment:
- DOCKER_HOST=tcp://docker:2375
commands:
- docker build -t devbuild .
test:
image: docker
environment:
- DOCKER_HOST=tcp://docker:2375
commands:
- apk add --no-cache curl xmlstarlet grep
- export CUR_VERSION="$(cat .plex_version)"
- docker run --name=DEV -d -p 32400:32400 devbuild
- sleep 10 # Wait for plex to start!
- docker logs DEV
- curl -sSL docker:32400/identity | tee /dev/stderr | xmlstarlet sel -t -v "/MediaContainer/@version" | grep -qw $CUR_VERSION
- docker kill DEV # Not really needed, but keeps things quick
publish:
image: docker
secrets: [ DOCKER_USER, DOCKER_PASS ]
environment:
- DOCKER_HOST=tcp://docker:2375
commands:
# Grab just the version, not the hash. Used for tagging
- export CUR_VERSION=$(cat .plex_version | cut -d \- -f1 )
- echo $DOCKER_USER
- docker tag devbuild adamant/plexmediaserver:latest
- docker tag devbuild adamant/plexmediaserver:$CUR_VERSION
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- docker push adamant/BAD_BUILD
- echo "CONGRATS! SUCCESSFULLY BUILT PLEX VERSION $CUR_VERSION"