-
Notifications
You must be signed in to change notification settings - Fork 42
/
.travis.yml
56 lines (54 loc) · 1.62 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
sudo: required
language: generic
services:
- docker
env:
global:
- DOCKER="goldarte/img-tool:v0.5"
- TARGET_REPO="https://github.com/${TRAVIS_REPO_SLUG}.git"
- if [[ -z ${TRAVIS_TAG} ]]; then IMAGE_VERSION="${TRAVIS_COMMIT}}"; else IMAGE_VERSION="${TRAVIS_TAG}"; fi
- IMAGE_NAME="$(basename -s '.git' ${TARGET_REPO})_${IMAGE_VERSION}.img"
git:
depth: false
jobs:
fast_finish: true
include:
- stage: Build
name: "Clever Modified Image Build"
cache:
directories:
- imgcache
before_script:
- docker pull ${DOCKER}
# Check if there are any cached images, copy them to our "images" directory
- if [ -n "$(ls -A imgcache/*.zip)" ]; then mkdir -p images && cp imgcache/*.zip images; fi
script:
- docker run --privileged --rm -v /dev:/dev -v $(pwd):/mnt -e TRAVIS_TAG="${TRAVIS_TAG}" ${DOCKER}
before_cache:
- cp images/*.zip imgcache
before_deploy:
# Set up git user name and tag this commit
- git config --local user.name "goldarte"
- git config --local user.email "[email protected]"
- sudo chmod -R 777 *
- cd images && zip ${IMAGE_NAME}.zip ${IMAGE_NAME}
deploy:
provider: releases
api_key: ${GITHUB_OAUTH_TOKEN}
file: ${IMAGE_NAME}.zip
skip_cleanup: true
on:
tags: true
draft: true
name: ${TRAVIS_TAG}
- stage: Test
name: Execute auto tests for drone modules
language: python
python: 2.7
script:
- cd drone
- pip install -r requirements.txt
- pytest
stages:
- Test
- Build