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
|
2017-08-27 15:51:29 +00:00
|
|
|
- wget -qO- https://adam-ant.co.uk/plex/pass-version.php | tee /dev/stderr | 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-09-15 16:47:07 +00:00
|
|
|
volumes:
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
2017-06-29 21:42:35 +00:00
|
|
|
commands:
|
2017-09-19 23:08:35 +00:00
|
|
|
- docker build --no-cache --pull --build-arg PLEX_VER="$(cat .plex_version)" -t ppass-dev .
|
2017-06-30 15:39:55 +00:00
|
|
|
|
2017-06-29 21:42:35 +00:00
|
|
|
test:
|
|
|
|
image: docker
|
2017-09-15 16:47:07 +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)"
|
2017-09-19 22:42:50 +00:00
|
|
|
- CON_NAME=$(docker run --rm -d ppass-dev)
|
2017-08-16 19:24:27 +00:00
|
|
|
- sleep 25 # Wait for plex to start!
|
2017-09-15 16:47:07 +00:00
|
|
|
- docker logs $$CON_NAME
|
2017-09-19 22:44:59 +00:00
|
|
|
- curl -sSL $(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $$CON_NAME):32400/identity
|
|
|
|
| tee /dev/stderr
|
|
|
|
| xmlstarlet sel -t -v "/MediaContainer/@version"
|
2017-09-19 22:26:58 +00:00
|
|
|
| grep -qw $CUR_VERSION
|
2017-09-15 16:47:07 +00:00
|
|
|
- docker kill $$CON_NAME # 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-09-13 22:14:20 +00:00
|
|
|
when:
|
|
|
|
event: [push, tag, deployment]
|
2017-06-30 16:48:24 +00:00
|
|
|
secrets: [ DOCKER_USER, DOCKER_PASS ]
|
2017-09-15 16:47:07 +00:00
|
|
|
volumes:
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
2017-06-30 16:15:13 +00:00
|
|
|
commands:
|
2017-08-24 17:15:51 +00:00
|
|
|
# Grab just the version, not the hash. Used for tagging
|
2017-07-09 21:37:07 +00:00
|
|
|
- export CUR_VERSION=$(cat .plex_version | cut -d \- -f1 )
|
2017-07-09 20:53:15 +00:00
|
|
|
- echo $CUR_VERSION
|
2017-06-30 16:48:24 +00:00
|
|
|
- echo $DOCKER_USER
|
2017-09-15 16:47:07 +00:00
|
|
|
- docker tag ppass-dev adamant/plexmediaserver:plexpass
|
|
|
|
- docker tag ppass-dev adamant/plexmediaserver:plexpass-$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-09-15 16:47:07 +00:00
|
|
|
- docker rmi adamant/plexmediaserver:plexpass adamant/plexmediaserver:plexpass-$CUR_VERSION ppass-dev
|
2017-07-09 20:53:15 +00:00
|
|
|
- echo "CONGRATS! SUCCESSFULLY BUILT PLEX VERSION $CUR_VERSION-PASS"
|