This repository has been archived by the owner on Apr 18, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
travis: build debian packages and documentation
The resulting packages are pushed to Debian repositories hosted on bintray.com. This is the first step to move away from our custom buildbot setup (see https://i3wm.org/docs/buildbot.html for details on that) towards infrastructure which is more standard (travis) and in the open.
- Loading branch information
1 parent
ea55729
commit bd29745
Showing
18 changed files
with
345 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"package": { | ||
"name": "i3-wm", | ||
"repo": "i3-autobuild", | ||
"subject": "i3" | ||
}, | ||
|
||
"version": { | ||
"name": "%version%", | ||
"desc": "TODO", | ||
"gpgSign": false | ||
}, | ||
|
||
"files": [ | ||
{ | ||
"includePattern": "deb/debian-amd64/(.*\\.deb)$", | ||
"matrixParams": { | ||
"deb_distribution": "sid", | ||
"deb_component": "main", | ||
"deb_architecture": "amd64" | ||
}, | ||
"uploadPattern": "$1" | ||
}, | ||
{ | ||
"includePattern": "deb/debian-i386/(.*\\.deb)$", | ||
"matrixParams": { | ||
"deb_distribution": "sid", | ||
"deb_component": "main", | ||
"deb_architecture": "i386" | ||
}, | ||
"uploadPattern": "$1" | ||
} | ||
], | ||
|
||
"publish": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"package": { | ||
"name": "i3-wm", | ||
"repo": "i3-autobuild-ubuntu", | ||
"subject": "i3" | ||
}, | ||
|
||
"version": { | ||
"name": "%version%", | ||
"desc": "TODO", | ||
"gpgSign": false | ||
}, | ||
|
||
"files": [ | ||
{ | ||
"includePattern": "deb/ubuntu-amd64/(.*\\.deb)$", | ||
"matrixParams": { | ||
"deb_distribution": "wily", | ||
"deb_component": "main", | ||
"deb_architecture": "amd64" | ||
}, | ||
"uploadPattern": "$1" | ||
}, | ||
{ | ||
"includePattern": "deb/ubuntu-i386/(.*\\.deb)$", | ||
"matrixParams": { | ||
"deb_distribution": "wily", | ||
"deb_component": "main", | ||
"deb_architecture": "i386" | ||
}, | ||
"uploadPattern": "$1" | ||
} | ||
], | ||
|
||
"publish": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
set -x | ||
|
||
clang-format-3.5 -i $(find . -name "*.[ch]" | tr '\n' ' ') && git diff --exit-code || (echo 'Code was not formatted using clang-format!'; false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
set -x | ||
|
||
mkdir -p deb/DIST-clang | ||
tar xf *.tar.bz2 -C deb/DIST-clang --strip-components=1 | ||
(cd deb/DIST-clang && scan-build -o ../CLANG --html-title="Analysis of i3 v$(git describe --tags)" make -j8) | ||
mv deb/CLANG/*/* deb/CLANG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env perl | ||
# vim:ts=4:sw=4:expandtab | ||
|
||
use strict; | ||
use warnings; | ||
use Data::Dumper; | ||
use HTTP::Tiny; # in core since v5.13.9 | ||
use JSON::PP; # in core since v5.13.9 | ||
use MIME::Base64; # in core since v5.7 | ||
use v5.13; | ||
|
||
my $repo = shift; | ||
|
||
my $auth = $ENV{'BINTRAY_USER'} . ':' . $ENV{'BINTRAY_KEY'}; | ||
die "BINTRAY_USER and/or BINTRAY_KEY environment variables not set" if $auth eq ':'; | ||
# TODO(stapelberg): switch to putting $auth into the URL once perl-modules ≥ | ||
# 5.20 is available on travis (Ubuntu Wily or newer). | ||
my $auth_header = 'Basic ' . MIME::Base64::encode_base64($auth, ""); | ||
my $apiurl = 'https://api.bintray.com/packages/i3/' . $repo . '/i3-wm'; | ||
my $client = HTTP::Tiny->new( | ||
verify_SSL => 1, | ||
default_headers => { | ||
'authorization' => $auth_header, | ||
}); | ||
my $resp = $client->get($apiurl); | ||
die "Getting versions failed: HTTP status $resp->{status} (content: $resp->{content})" unless $resp->{success}; | ||
my $decoded = decode_json($resp->{content}); | ||
my @versions = sort @{$decoded->{versions}}; | ||
|
||
# Keep the most recent 5 versions. | ||
splice(@versions, 0, 5); | ||
|
||
for my $version (@versions) { | ||
say "Deleting old version $version"; | ||
$resp = $client->request('DELETE', "$apiurl/versions/$version"); | ||
die "Deletion of version $version failed: HTTP status $resp->{status} (content: $resp->{content})" unless $resp->{success}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
set -x | ||
|
||
DEST=$1 | ||
|
||
make dist | ||
# unpack dist tarball | ||
mkdir -p "${DEST}" | ||
tar xf *.tar.bz2 -C "${DEST}" --strip-components=1 | ||
cp -r debian "${DEST}" | ||
cd "${DEST}" | ||
debchange -m -l+g$(git describe --tags) 'Automatically built' | ||
dpkg-buildpackage -b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
set -x | ||
|
||
GITVERSION=$(git describe --tags) | ||
|
||
mkdir build.i3wm.org | ||
cp -r deb/CLANG build.i3wm.org/clang-analyze | ||
cp -r deb/COPY-DOCS build.i3wm.org/docs | ||
cd build.i3wm.org | ||
echo build.i3wm.org > CNAME | ||
git init | ||
|
||
git config user.name "Travis CI" | ||
git config user.email "i3bot@i3wm.org" | ||
git add . | ||
git commit -m "Publish docs/static analysis for github.com/i3/i3 v${GITVERSION}" | ||
|
||
# Hide stdout/stderr because it might contain sensitive info. | ||
set +x | ||
echo "git push" | ||
git push --force --quiet "https://${GH_TOKEN}@github.com/i3/build.i3wm.org.git" master:gh-pages >/dev/null 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
set -x | ||
|
||
make -C docs ASCIIDOC="asciidoc -a linkcss -a stylesdir=http://i3wm.org/css -a scriptsdir=http://i3wm.org/js --backend=xhtml11 -f docs/asciidoc-git.conf" | ||
./docs/i3-pod2html i3-dmenu-desktop man/i3-dmenu-desktop.html | ||
./docs/i3-pod2html i3-save-tree man/i3-save-tree.html | ||
for file in $(sed 's/\.1$/.man/g' debian/i3-wm.manpages) | ||
do | ||
[ -f "$file" ] && asciidoc -a linkcss -a stylesdir=http://i3wm.org/css -a scriptsdir=http://i3wm.org/js --backend=xhtml11 -f docs/asciidoc-git.conf "$file" | ||
done | ||
|
||
mkdir -p deb/COPY-DOCS | ||
|
||
cp $(tr "\n" ' ' < debian/i3-wm.docs) deb/COPY-DOCS/ | ||
cp $(sed 's/\.1$/.html/g' debian/i3-wm.manpages | tr "\n" ' ') deb/COPY-DOCS/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
set -x | ||
|
||
sed -i "s,%version%,$(git describe --tags),g" travis/bintray-autobuild-*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
# Returns true if Debian/Ubuntu packages should be skipped because this CI run | ||
# was triggered by a pull request. | ||
|
||
# Verify BINTRAY_USER is present (only set on github.com/i3/i3), | ||
# otherwise the CI run was triggered by a pull request. | ||
# Verify CC=gcc so that we only build packages once for each commit, | ||
# not twice (with gcc and clang). | ||
if [ ! -z "$BINTRAY_USER" ] && [ "$CC" = "gcc" ] | ||
then | ||
exit 1 | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# vim:ft=Dockerfile | ||
# Same as travis-base.Dockerfile, but without the test suite dependencies since | ||
# we only build Debian packages on i386, we don’t run the tests. | ||
FROM i386/debian:sid | ||
|
||
RUN echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup | ||
# Paper over occasional network flakiness of some mirrors. | ||
RUN echo 'APT::Acquire::Retries "5";' > /etc/apt/apt.conf.d/80retry | ||
|
||
# NOTE: I tried exclusively using gce_debian_mirror.storage.googleapis.com | ||
# instead of httpredir.debian.org, but the results (Fetched 123 MB in 36s (3357 | ||
# kB/s)) are not any better than httpredir.debian.org (Fetched 123 MB in 34s | ||
# (3608 kB/s)). Hence, let’s stick with httpredir.debian.org (default) for now. | ||
|
||
# Install mk-build-deps (for installing the i3 build dependencies), | ||
# clang and clang-format-3.5 (for checking formatting and building with clang), | ||
# lintian (for checking spelling errors), | ||
RUN linux32 apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
dpkg-dev devscripts git equivs \ | ||
clang clang-format-3.5 \ | ||
lintian && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install i3 build dependencies. | ||
COPY debian/control /usr/src/i3-debian-packaging/control | ||
RUN linux32 apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive mk-build-deps --install --remove --tool 'apt-get --no-install-recommends -y' /usr/src/i3-debian-packaging/control && \ | ||
rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# vim:ft=Dockerfile | ||
# Same as travis-base.Dockerfile, but without the test suite dependencies since | ||
# we only build Debian packages on Ubuntu i386, we don’t run the tests. | ||
FROM i386/ubuntu:wily | ||
|
||
RUN echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup | ||
# Paper over occasional network flakiness of some mirrors. | ||
RUN echo 'APT::Acquire::Retries "5";' > /etc/apt/apt.conf.d/80retry | ||
|
||
# NOTE: I tried exclusively using gce_debian_mirror.storage.googleapis.com | ||
# instead of httpredir.debian.org, but the results (Fetched 123 MB in 36s (3357 | ||
# kB/s)) are not any better than httpredir.debian.org (Fetched 123 MB in 34s | ||
# (3608 kB/s)). Hence, let’s stick with httpredir.debian.org (default) for now. | ||
|
||
# Install mk-build-deps (for installing the i3 build dependencies), | ||
# clang and clang-format-3.5 (for checking formatting and building with clang), | ||
# lintian (for checking spelling errors), | ||
RUN linux32 apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
dpkg-dev devscripts git equivs \ | ||
clang clang-format-3.5 \ | ||
lintian && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install i3 build dependencies. | ||
COPY debian/control /usr/src/i3-debian-packaging/control | ||
RUN linux32 apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive mk-build-deps --install --remove --tool 'apt-get --no-install-recommends -y' /usr/src/i3-debian-packaging/control && \ | ||
rm -rf /var/lib/apt/lists/* |
Oops, something went wrong.