blob: 325adfd069fa769d99d86af9e9e22a447dfcb757 (
plain)
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
|
#!/bin/sh
# webid-oidc, implementation of the Solid specification
# Copyright (C) 2020, 2021 Vivien Kraus
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
refname="$1"
oldrev="$2"
newrev="$3"
zero=$(guix environment --ad-hoc git -- git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
span="^$oldrev $newrev"
if test "x$oldrev" = "x$zero"
then
>&2 echo "Creating a new branch, $refname..."
span="$newrev"
fi
if test "x$newrev" = "x$zero"
then
>&2 echo "Deleting a branch, that's OK."
exit 0
fi
>&2 echo "Checking all refs in range $span."
CHANNEL=$(mktemp -d 2>/dev/null || mktemp -d -t "channel")
>&2 echo "The channel is in $CHANNEL."
for ref in $(guix environment --ad-hoc git -- git rev-list --reverse $span)
do
# If there is not already a note on the refs/notes/dist ref, then we
# should run the CI.
>&2 echo "Checking new commit $ref."
if test "x$ref" = "x0e29ddc3c41870e14da87770a429a94f80dd4110"
then
>&2 echo "This is the root, skipping."
else
>&2 echo "Running CI for $ref..."
guix environment --ad-hoc git -- git archive "-o" "$CHANNEL/source.tar.gz" "$ref" guix ci.scm || exit 1
(cd "$CHANNEL" ; rm -rf "source" ; mkdir "source" ; cd "source" ; guix environment --ad-hoc tar -- tar xf ../source.tar.gz)
export CI_REF="$ref"
if OUTCOME=$(guix build -c 4 -L "$CHANNEL/source/guix" -f "$CHANNEL/source/ci.scm")
then
>&2 echo "CI ran: $OUTCOME."
else
rm -rf $CHANNEL
exit 1
fi
fi
done
rm -rf $CHANNEL
|