plex-test/.drone.yml

56 lines
2.0 KiB
YAML
Raw Normal View History

2017-06-29 21:42:35 +00:00
pipeline:
2017-07-09 21:37:07 +00:00
identify:
image: docker
commands:
2017-08-24 17:15:51 +00:00
# Grab the current version, prevents race conditions
- apk add --no-cache openssl jq
2018-03-16 15:26:23 +00:00
- wget -qO- https://spritsail.io/plex/release.php | tee .plex_release
- jq -r '.["url-deb"]' .plex_release > .plex_url
- jq -r '.["version"]' .plex_release > .plex_version
- jq -r '.["csum-deb"]' .plex_release > .plex_checksum
- jq -r '.["version"]' .plex_release | cut -d- -f1 > .plex_tag
2017-07-09 21:37:07 +00:00
2017-06-29 21:42:35 +00:00
build:
2018-03-16 15:26:23 +00:00
image: spritsail/docker-build
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
repo: plex-dev
build_args:
- 'PLEX_URL=%file: .plex_url'
- 'PLEX_VER=%file: .plex_version'
- 'PLEX_SHA=%file: .plex_checksum'
2017-06-30 15:39:55 +00:00
2017-06-29 21:42:35 +00:00
test:
image: docker
2018-03-16 15:26:23 +00:00
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
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)"
- CON_NAME=$(docker run --rm -d plex-dev)
2017-12-15 16:48:29 +00:00
- timeout -t 15 docker logs $$CON_NAME &
2017-06-30 15:39:55 +00:00
- sleep 10 # Wait for plex to start!
2018-03-16 15:26:23 +00:00
- curl -sSL --retry-max-time 30 --max-time 5 --retry 10 --retry-delay 5
$(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
2017-12-15 16:48:29 +00:00
- docker kill $$CON_NAME
2017-06-30 15:39:55 +00:00
publish:
2018-03-16 15:26:23 +00:00
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: appleboy/drone-telegram
when: { status: [ success, failure ] }
secrets: [ telegram_token, telegram_to ]
message: |
*{{repo.owner}}/{{repo.name}} [{{commit.branch}}]*: Build #{{build.number}}: *{{uppercase build.status}}*
{{build.link}}