Files
docker-mods-uptime-kuma-tim…/.travis.yml
T
2020-05-19 21:16:53 -04:00

38 lines
1.3 KiB
YAML

os: linux
language: shell
branches:
only:
- code-server-docker
services:
- docker
env:
global:
- DOCKERHUB="linuxserver/mods"
- BASEIMAGE="code-server"
- MODNAME="docker"
jobs:
include:
- stage: PR-BuildImage
if: (type IN (pull_request))
script:
# Build image
- docker build --no-cache -t ${DOCKERHUB}:${BASEIMAGE}-${MODNAME}-${TRAVIS_COMMIT} .
- stage: BuildImage
if: (NOT (type IN (pull_request)))
script:
# Set version
- if [ -z ${COMPOSE_TAG+x} ]; then COMPOSE_TAG=$(curl -sX GET "https://api.github.com/repos/linuxserver/docker-docker-compose/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]'); fi
- COMPOSE_VERSION=$(echo "$COMPOSE_TAG" | sed 's|-ls.*||g')
# Build image
- docker build --no-cache --build-arg COMPOSE_TAG=${COMPOSE_TAG} -t ${DOCKERHUB}:${BASEIMAGE}-${MODNAME}-${COMPOSE_VERSION}-${TRAVIS_COMMIT} .
- docker tag ${DOCKERHUB}:${BASEIMAGE}-${MODNAME}-${COMPOSE_VERSION}-${TRAVIS_COMMIT} ${DOCKERHUB}:${BASEIMAGE}-${MODNAME}
# Login to DockerHub
- echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
# Push all of the tags
- docker push ${DOCKERHUB}:${BASEIMAGE}-${MODNAME}-${COMPOSE_VERSION}-${TRAVIS_COMMIT}
- docker push ${DOCKERHUB}:${BASEIMAGE}-${MODNAME}