Files
clover/.travis.yml
2018-10-01 20:01:13 +03:00

34 lines
1.1 KiB
YAML

sudo: required
language: generic
services:
- docker
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_PATH="$(pwd)/image/$(basename -s '.git' ${TARGET_REPO})_${IMAGE_VERSION}.img"
- IMAGE_NAME="$(basename ${IMAGE_PATH})"
- BUILD_DIR="$(dirname ${IMAGE_PATH})"
git:
depth: 1
before_script:
- docker pull ${DOCKER}
script:
- docker run --privileged --rm -v /dev:/dev -v ${BUILD_DIR}:/builder/image -e "TARGET_REPO=${TARGET_REPO}" -e "TARGET_REF=${TRAVIS_BRANCH}" ${DOCKER}
#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 ${BUILD_DIR}
- cd ${BUILD_DIR} && zip ${IMAGE_NAME}.zip ${IMAGE_NAME}
deploy:
provider: releases
api_key: ${GITHUB_OAUTH_TOKEN}
file: ${IMAGE_PATH}.zip
skip_cleanup: true