travis: use ethereal.

Closes: #9396 [via git-merge-pr]
This commit is contained in:
maxice8 2019-03-05 22:47:54 -03:00 committed by Michael Aldridge
parent 32ca5156c4
commit 3f4d1f1555
9 changed files with 56 additions and 37 deletions

View File

@ -1,14 +1,12 @@
language: bash
dist: trusty
sudo: required
git:
depth: 200
env:
global:
- PATH=$PATH:$HOME/bin
- PATH=$PATH:/tmp/bin
- TAG=2019032901
matrix:
- XLINT=1
@ -20,19 +18,22 @@ env:
- ARCH=armv6l-musl BOOTSTRAP=x86_64-musl
- ARCH=aarch64-musl BOOTSTRAP=x86_64-musl
install:
- common/travis/docker.sh
before_script:
- common/travis/set_mirror.sh
- common/travis/prepare.sh
- common/travis/fetch_upstream.sh
- common/travis/changed_templates.sh
- common/travis/fetch-xtools.sh
- common/travis/xlint.sh
- common/travis/bootstrap.sh $BOOTSTRAP
script:
- common/travis/build.sh $BOOTSTRAP $ARCH
- if [ -z "$XLINT" ]; then docker exec -t void hostrepo/common/travis/build.sh $BOOTSTRAP $ARCH; fi
after_script:
- common/travis/show_files.sh $BOOTSTRAP $ARCH
- if [ -z "$XLINT" ]; then docker exec -t void hostrepo/common/travis/show_files.sh $BOOTSTRAP $ARCH; fi
notifications:
email: false

View File

@ -1,7 +0,0 @@
#!/bin/sh
#
# bootstrap.sh
[ "$XLINT" ] && exit 0
./xbps-src -H $HOME/hostdir binary-bootstrap $1

View File

@ -2,16 +2,20 @@
#
# build.sh
[ "$XLINT" ] && exit 0
if [ "$1" != "$2" ]; then
arch="-a $2"
fi
PKGS=$(./xbps-src sort-dependencies $(cat /tmp/templates))
# Tell xbps-src what is our arch, this is done when doing
# binary-bootstrap, but we need to do it every time since
# our masterdir is ethereal.
/bin/echo -e '\x1b[32mWriting bootstrap arch into .xbps_chroot_init of masterdir\x1b[0m'
echo "$1" > /hostrepo/masterdir/.xbps_chroot_init
PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
for pkg in ${PKGS}; do
./xbps-src -H $HOME/hostdir $arch pkg "$pkg"
/hostrepo/xbps-src -H "$HOME"/hostdir $arch pkg "$pkg"
[ $? -eq 1 ] && exit 1
done

16
common/travis/docker.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
#
# docker.sh
[ "$XLINT" ] && exit 0
/bin/echo -e "\x1b[32mPulling docker image for $BOOTSTRAP from $TAG...\x1b[0m"
docker pull voidlinux/masterdir-$BOOTSTRAP:$TAG
docker run -d \
--name void \
-v "$(pwd)":/hostrepo \
-v /tmp:/tmp \
-e XLINT="$XLINT" \
-e PATH="$PATH" \
voidlinux/masterdir-$BOOTSTRAP:$TAG \
/bin/sh -c 'sleep inf'

10
common/travis/fetch-xtools.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
#
# fetch-xtools.sh
mkdir -p /tmp/bin
/bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
wget -q -O - https://github.com/chneukirchen/xtools/archive/master.tar.gz | \
gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
--strip-components=1 || exit 1

View File

@ -2,22 +2,16 @@
#
# install_tools.sh
mkdir -p $HOME/bin
/bin/echo -e '\x1b[32mInstalling xbps...\x1b[0m'
wget -q -O - http://alpha.de.repo.voidlinux.org/static/xbps-static-latest.x86_64-musl.tar.xz | \
unxz | tar x -C $HOME/bin --wildcards "./usr/bin/xbps-*" \
--strip-components=3 || exit 1
sudo chown root $HOME/bin/xbps-uchroot
sudo chmod u+s $HOME/bin/xbps-uchroot
/bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
wget -q -O - https://github.com/chneukirchen/xtools/archive/master.tar.gz | \
gunzip | tar x -C $HOME/bin --wildcards "xtools-master/x*" \
--strip-components=1 || exit 1
[ "$XLINT" ] && exit 0
/bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
echo XBPS_CHROOT_CMD=uchroot >> etc/conf
echo XBPS_MAKEJOBS=4 >> etc/conf
echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
/bin/echo -e '\x1b[32mEnabling ethereal chroot-style...\x1b[0m'
echo XBPS_CHROOT_CMD=ethereal >> etc/conf
echo XBPS_ALLOW_CHROOT_BREAKOUT=yes >> etc/conf
/bin/echo -e '\x1b[32mLinking / to /masterdir...\x1b[0m'
ln -s / masterdir

View File

@ -4,7 +4,7 @@ TRAVIS_PROTO=http
TRAVIS_MIRROR=alpha.us.repo.voidlinux.org
for _i in etc/repos-remote.conf etc/defaults.conf etc/repos-remote-x86_64.conf ; do
printf '\x1b[32mUpdating %s...\x1b[0m\n' $_i
/bin/echo -e "\x1b[32mUpdating $_i...\x1b[0m"
# First fix the proto, ideally we'd serve everything with HTTPS,
# but key management and rotation is a pain, and things are signed
# so we can afford to be a little lazy at times.

View File

@ -2,9 +2,7 @@
#
# show_files.sh
[ "$XLINT" ] && exit 0
export XBPS_TARGET_ARCH="$2"
export XBPS_TARGET_ARCH="$2" XBPS_DISTDIR=/hostrepo
for pkg in $(cat /tmp/templates); do
for subpkg in $(xsubpkg $pkg); do

View File

@ -4,4 +4,7 @@
[ "$XLINT" ] || exit 0
awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates | xargs xlint
awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates | while read -r t; do
/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
xlint "$t"
done