pipeline: identify: image: docker commands: # Grab the current version, prevents race conditions - apk add --no-cache openssl jq - wget -qO- https://spritsail.io/plex/release.php?pass | 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 build: image: spritsail/docker-build volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ] repo: ppass-dev build_args: - 'PLEX_URL=%file: .plex_url' - 'PLEX_VER=%file: .plex_version' - 'PLEX_SHA=%file: .plex_checksum' 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_version)" - 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' - '%fileauto: %prefix: plexpass% .plex_tag' notify: image: spritsail/notify when: { status: [ success, failure ] } secrets: [ webhook_url, notify_token ]