Commit a4639713 authored by kpcyrd's avatar kpcyrd Committed by Holger Levsen

reproducible alpine: add alpine scheduler

Signed-off-by: Holger Levsen's avatarHolger Levsen <holger@layer-acht.org>
parent db7a2b8d
#!/bin/bash
# Copyright 2018 Holger Levsen <holger@layer-acht.org>
# 2019 kpcyrd <git@rxv.cc>
# released under the GPLv=2
DEBUG=false
. /srv/jenkins/bin/common-functions.sh
common_init "$@"
# common code
. /srv/jenkins/bin/reproducible_common.sh
set -e
if [ "$1" = "" ] || [ "$2" = "" ] ; then
echo "Need at least two parameters:"
echo "$0 \$RESPOSITORY \$SOURCEPKGNAME1 \$SOURCEPKGNAME2 \$SOURCEPKGNAME3..."
exit 1
elif [ "$1" != "main" ] && [ "$1" != "community" ] ; then
echo "\$RESPOSITORY needs to be one of main or community."
exit 1
fi
DATE="$(date -u +'%Y-%m-%d %H:%M' -d '21 days ago')"
REPOSITORY=$1
SUITE=alpine_$REPOSITORY
ARCH=x86_64
shift
PACKAGES="$@"
SUCCESS=""
ALREADY_SCHEDULED=""
NOT_EXISTING=""
DISTROID=$(query_db "SELECT id FROM distributions WHERE name='alpine'")
for PKG in $PACKAGES ; do
echo "Now trying to reschedule $PKG in $SUITE."
PKG_ID=$(query_db "SELECT id FROM sources WHERE distribution=$DISTROID AND name='$PKG' AND suite='$SUITE' AND architecture='$ARCH';")
if [ ! -z "${PKG_ID}" ] ; then
SCHEDULED=$(query_db "SELECT * FROM schedule WHERE package_id = '${PKG_ID}';")
if [ -z "$SCHEDULED" ] ; then
query_db "INSERT INTO schedule (package_id, date_scheduled) VALUES ('${PKG_ID}', '$DATE');"
SUCCESS="$SUCCESS $PKG"
else
echo " $PKG (package_id: ${PKG_ID}) already scheduled, not scheduling again."
ALREADY_SCHEDULED="$ALREADY_SCHEDULED $PKG"
fi
else
echo " $PKG does not exist in $SUITE, ignoring."
NOT_EXISTING="$NOT_EXISTING $PKG"
fi
done
echo
if [ ! -z "$SUCCESS" ] ; then
AMOUNT=$(echo $SUCCESS | sed 's# #\n#g' | wc -l)
if [ $AMOUNT -gt 3 ] ; then
MANY=" $AMOUNT packages"
else
MANY=""
fi
MESSAGE="Manually scheduled$MANY in $REPOSITORY:$SUCCESS"
# shorten irc message if longer then 256 characters
if [ ${#MESSAGE} -gt 256 ] ; then
MESSAGE="${MESSAGE:0:256}✂…"
fi
echo "$MESSAGE"
irc_message alpine-reproducible "$MESSAGE"
fi
if [ ! -z "$ALREADY_SCHEDULED" ] || [ ! -z "$NOT_EXISTING" ] ; then
echo
if [ ! -z "$ALREADY_SCHEDULED" ] ; then
echo "$ALREADY_SCHEDULED were already scheduled..."
fi
if [ ! -z "$NOT_EXISTING" ] ; then
echo "$NOT_EXISTING were not found in $SUITE, so ignored."
fi
fi
echo
exit 0
# vim: set sw=0 noet :
This diff is collapsed.
...@@ -55,6 +55,11 @@ mkdir -p "$DEBIAN_BASE" ...@@ -55,6 +55,11 @@ mkdir -p "$DEBIAN_BASE"
# existing usertags in the Debian BTS # existing usertags in the Debian BTS
USERTAGS="toolchain infrastructure timestamps fileordering buildpath username hostname uname randomness buildinfo cpu signatures environment umask ftbfs locale" USERTAGS="toolchain infrastructure timestamps fileordering buildpath username hostname uname randomness buildinfo cpu signatures environment umask ftbfs locale"
# common settings for testing alpine
ALPINE_REPOS="main community"
ALPINE_PKGS=/srv/reproducible-results/alpine_pkgs
ALPINE_BASE="$BASE/alpine"
# common settings for testing Arch Linux # common settings for testing Arch Linux
ARCHLINUX_REPOS="core extra multilib community" ARCHLINUX_REPOS="core extra multilib community"
ARCHLINUX_PKGS=/srv/reproducible-results/archlinux_pkgs ARCHLINUX_PKGS=/srv/reproducible-results/archlinux_pkgs
......
...@@ -97,7 +97,7 @@ sudo tee "$SCHROOT_BASE/$TARGET/etc/profile.d/proxy.sh" <<-__END__ ...@@ -97,7 +97,7 @@ sudo tee "$SCHROOT_BASE/$TARGET/etc/profile.d/proxy.sh" <<-__END__
__END__ __END__
# install sdk # install sdk
$ROOTCMD apk add alpine-sdk gnupg $ROOTCMD apk add alpine-sdk lua-aports gnupg
# configure sudo # configure sudo
echo 'jenkins ALL= NOPASSWD: /sbin/apk *' | $ROOTCMD tee -a /etc/sudoers echo 'jenkins ALL= NOPASSWD: /sbin/apk *' | $ROOTCMD tee -a /etc/sudoers
...@@ -118,6 +118,9 @@ if [ "$HOSTNAME" = "osuosl-build170-amd64" ] ; then ...@@ -118,6 +118,9 @@ if [ "$HOSTNAME" = "osuosl-build170-amd64" ] ; then
export GIT_SSL_NO_VERIFY=1 export GIT_SSL_NO_VERIFY=1
fi fi
echo "$(date -u) - cloning aports repo"
$USERCMD git clone https://git.alpinelinux.org/aports.git /var/lib/jenkins/aports
echo "=============================================================================" echo "============================================================================="
echo "schroot $TARGET set up successfully in $SCHROOT_BASE/$TARGET - exiting now." echo "schroot $TARGET set up successfully in $SCHROOT_BASE/$TARGET - exiting now."
echo "=============================================================================" echo "============================================================================="
......
...@@ -562,11 +562,14 @@ ...@@ -562,11 +562,14 @@
my_description: 'Generate https://reproducible.debian.net/userContent/reproducible.json for consumption by tracker.debian.org.' my_description: 'Generate https://reproducible.debian.net/userContent/reproducible.json for consumption by tracker.debian.org.'
my_timed: '1 H/2 * * *' my_timed: '1 H/2 * * *'
my_shellext: ".py" my_shellext: ".py"
- 'alpine_scheduler':
my_description: 'Scheduler for alpine reproducibility tests'
my_timed: '0 H/4 * * *'
- 'html_archlinux': - 'html_archlinux':
my_description: 'Build webpages for Arch Linux reproducibility tests' my_description: 'Build webpages for Arch Linux reproducibility tests'
my_timed: '15,45 * * * *' my_timed: '15,45 * * * *'
- 'archlinux_scheduler': - 'archlinux_scheduler':
my_description: 'Scheduler for for Arch Linux reproducibility tests' my_description: 'Scheduler for Arch Linux reproducibility tests'
my_timed: '0 H/4 * * *' my_timed: '0 H/4 * * *'
- 'html_fedora-23_x86_64': - 'html_fedora-23_x86_64':
my_description: 'Build a simple webpage for Fedora 23 reproducibility tests' my_description: 'Build a simple webpage for Fedora 23 reproducibility tests'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment