Files
clover/.travis.yml

45 lines
1.4 KiB
YAML

sudo: required
language: generic
services:
- docker
# branches:
# only:
# - master
# - /^v\d+\.\d+(\.\d+)?(-\S*)?$/
env:
global:
- DOCKER="smirart/builder:latest"
- TARGET_REPO="https://github.com/${TRAVIS_REPO_SLUG}.git"
# - IMAGE_VERSION="${TRAVIS_BRANCH}_$(echo ${TRAVIS_COMMIT} | cut -c1-7)"
- IMAGE_VERSION="${TRAVIS_TAG}"
- IMAGE_PATH="$(pwd)/images/$(basename -s '.git' ${TARGET_REPO})_${IMAGE_VERSION}.img"
- IMAGE_NAME="$(basename ${IMAGE_PATH})"
git:
depth: 1
before_script:
- docker pull ${DOCKER}
script:
- if [[ ! -z $TRAVIS_TAG ]]; then docker run --privileged --rm -v /dev:/dev -v $(pwd):/builder/repo ${DOCKER}; fi
# after_failure:
# - skip_deploy: true
before_deploy:
# Set up git user name and tag this commit
- git config --local user.name "urpylka"
- git config --local user.email "urpylka@gmail.com"
# - git tag "$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)"
- sudo chmod -R 777 *
- cd images && zip ${IMAGE_NAME}.zip ${IMAGE_NAME}
deploy:
provider: releases
api_key: ${GITHUB_OAUTH_TOKEN}
file: ${IMAGE_PATH}.zip
skip_cleanup: true
on:
tags: true
# More info there
# https://github.com/travis-ci/travis-ci/issues/6893
# https://docs.travis-ci.com/user/customizing-the-build/
# https://docs.travis-ci.com/user/deployment/releases
# https://docs.travis-ci.com/user/environment-variables/