2017-06-30 15:39:55 +00:00
|
|
|
services:
|
|
|
|
docker:
|
|
|
|
image: docker:dind
|
|
|
|
privileged: true
|
|
|
|
|
2017-06-29 21:42:35 +00:00
|
|
|
pipeline:
|
2017-07-09 21:37:07 +00:00
|
|
|
identify:
|
|
|
|
image: docker
|
|
|
|
commands:
|
|
|
|
# Grab the current version, prevents race conditions #### Pass this into the Dockerfile somehow?
|
2017-07-17 17:51:46 +00:00
|
|
|
- apk add --no-cache openssl jq
|
|
|
|
- wget -qO- https://adam-ant.co.uk/plex/version.php | jq -r .release> .plex_version
|
2017-07-09 21:37:07 +00:00
|
|
|
|
2017-06-29 21:42:35 +00:00
|
|
|
build:
|
|
|
|
image: docker
|
2017-06-30 15:39:55 +00:00
|
|
|
environment:
|
|
|
|
- DOCKER_HOST=tcp://docker:2375
|
2017-06-29 21:42:35 +00:00
|
|
|
commands:
|
2017-06-30 15:39:55 +00:00
|
|
|
- docker build -t devbuild .
|
|
|
|
|
2017-06-29 21:42:35 +00:00
|
|
|
test:
|
|
|
|
image: docker
|
2017-06-30 15:39:55 +00:00
|
|
|
environment:
|
|
|
|
- DOCKER_HOST=tcp://docker:2375
|
2017-06-29 21:42:35 +00:00
|
|
|
commands:
|
2017-07-09 21:37:07 +00:00
|
|
|
- apk add --no-cache curl xmlstarlet grep
|
|
|
|
- export CUR_VERSION="$(cat .plex_version)"
|
2017-06-30 15:39:55 +00:00
|
|
|
- docker run --name=DEV -d -p 32400:32400 devbuild
|
|
|
|
- sleep 10 # Wait for plex to start!
|
2017-06-30 16:15:13 +00:00
|
|
|
- docker logs DEV
|
2017-07-09 21:37:07 +00:00
|
|
|
- curl -sSL docker:32400/identity | tee /dev/stderr | xmlstarlet sel -t -v "/MediaContainer/@version" | grep -qw $CUR_VERSION
|
2017-06-30 16:15:13 +00:00
|
|
|
- docker kill DEV #Not really needed, but keeps things quick
|
2017-06-30 15:39:55 +00:00
|
|
|
|
2017-06-30 16:15:13 +00:00
|
|
|
publish:
|
|
|
|
image: docker
|
2017-06-30 16:48:24 +00:00
|
|
|
secrets: [ DOCKER_USER, DOCKER_PASS ]
|
2017-06-30 16:15:13 +00:00
|
|
|
environment:
|
|
|
|
- DOCKER_HOST=tcp://docker:2375
|
|
|
|
commands:
|
2017-07-09 21:37:07 +00:00
|
|
|
#Grab just the version, not the hash. Used for tagging
|
|
|
|
- export CUR_VERSION=$(cat .plex_version | cut -d \- -f1 )
|
2017-06-30 16:48:24 +00:00
|
|
|
- echo $DOCKER_USER
|
2017-06-30 17:16:40 +00:00
|
|
|
- docker tag devbuild adamant/plexmediaserver:latest
|
|
|
|
- docker tag devbuild adamant/plexmediaserver:$CUR_VERSION
|
2017-06-30 16:48:24 +00:00
|
|
|
- docker login -u $DOCKER_USER -p $DOCKER_PASS
|
2017-07-09 21:37:07 +00:00
|
|
|
- docker push adamant/plexmediaserver
|
2017-06-30 17:16:40 +00:00
|
|
|
- echo "CONGRATS! SUCCESSFULLY BUILT PLEX VERSION "$CUR_VERSION
|
2017-08-24 17:10:07 +00:00
|
|
|
|
|
|
|
downstream:
|
|
|
|
image: plugins/downstream
|
|
|
|
secrets: [ DOWNSTREAM_TOKEN ]
|
|
|
|
server: https://drone.adam-ant.co.uk
|
|
|
|
fork: true
|
|
|
|
repositories:
|
|
|
|
# A public release potentially means an
|
|
|
|
# updated plexpass release - update that too!
|
|
|
|
- Adam-Ant/docker-plex-tiny@pass
|
|
|
|
when:
|
|
|
|
event: [ push, tag, deployment ]
|
|
|
|
status: [ success ]
|