forked from rescuezilla/rescuezilla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
67 lines (59 loc) · 3 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
57
58
59
60
61
62
63
64
65
66
67
language: shell
os: linux
# The build bot OS environment does not really matter, as the docker image
# provides the primary host environment for the build. However, a more recent
# OS provides a more recent Docker release, which means additional Docker
# functionality.
dist: bionic
services:
- docker
git:
# Disable shallow clone, this prevents the build failing when the number of commits
# since the last git tag exceeds Travis-CI's default --depth=50 argument, causing the
# `git describe --tags` to error, which causes the deb package build to fail.
depth: false
# Launches Docker container to act as 'host system'. See BUILD.ISO.IMAGE.md for more information.
before_install:
# Build an immutable docker image from the Dockerfile, labelled with a
# meaningful tag
#
# On your local machine, if rebuilding the docker image, it's recommended to
# first delete old build artifacts, and also to fix permissions on the pkg
# caches by running:
# sudo make clean && sudo chown -R $(id -u):$(id -g) pkg.cache/
- docker build --tag builder.image .
# Construct a (mutable) docker container from the docker image, give it
# extended privileges (required for the chroot bind mount), label it with a
# meaningful name, execute the application /bin/cat, so the container doesn't
# automatically exit
- docker run --rm --detach --privileged --name=builder.container --volume=`pwd`:/home/rescuezilla/ --tty builder.image cat
script:
# DANGER: Delete all untracked files and directories to ensure pristine env (do *not* use this on your working dir)
- git clean -dfX && git clean -dfx
# DANGER: Do *not* use this on your working dir
- git reset --hard HEAD
# List any working directory files to help debug any unclean working directory issues
- docker exec --interactive --tty --workdir=/home/rescuezilla/ builder.container make status
# Execute the Makefile's install target within the docker container. This step
# may take some time. Hundreds of megabytes of packages are downloaded from the
# Ubuntu mirror during a build.
- docker exec --interactive --tty --workdir=/home/rescuezilla/ builder.container make amd64
# List any working directory files to help debug any unclean working directory issues
- docker exec --interactive --tty --workdir=/home/rescuezilla/ builder.container make status
- docker exec --interactive --tty --workdir=/home/rescuezilla/ builder.container make i386
# List any working directory files to help debug any unclean working directory issues
- docker exec --interactive --tty --workdir=/home/rescuezilla/ builder.container make status
# When a new tag is pushed, upload the ISO image as a draft release on GitHub
before_deploy:
- sudo mv build/rescuezilla.amd64.iso build/rescuezilla-$TRAVIS_TAG-64bit.iso
- sudo mv build/rescuezilla.i386.iso build/rescuezilla-$TRAVIS_TAG-32bit.iso
deploy:
provider: releases
token: $GITHUB_TOKEN
file:
- build/rescuezilla-$TRAVIS_TAG-64bit.iso
- build/rescuezilla-$TRAVIS_TAG-32bit.iso
draft: true
cleanup: false
on:
tags: true