diff --git a/config b/config index 4603a53..d94b19e 100644 --- a/config +++ b/config @@ -1,8 +1,24 @@ #!/bin/bash +# Identity + DEBSIGN_KEYID=59A3E6FF DEBFULLNAME="YunoHost Contributors" DEBEMAIL="contrib@yunohost.org" +MAIL="rebuildd@yunohost.org" +REPO_URL="repo.yunohost.org" + +# Codenames, components and architectures + +AVAILABLE_CODENAMES="jessie stretch" +AVAILABLE_COMPONENTS="stable testing unstable extra" +AVAILABLE_ARCH="amd64 i386 armhf" + +DEFAULT_CODENAME="jessie" +DEFAULT_COMPONENT="unstable" +DEFAULT_ARCH="amd64" + +# Folders... HOME_VINAIGRETTE="/home/vinaigrette" GIT_REPOS="$HOME_VINAIGRETTE/repos/" @@ -10,29 +26,15 @@ BUILD_DEB="$HOME_VINAIGRETTE/build_deb" PBUILDER_HOME="$HOME_VINAIGRETTE/pbuilder/" PBUILDER_IMAGES="$PBUILDER_HOME/images/" -PBUILDER_RESULTS="$PBUILDER_HOME/results/" +PBUILDER_RESULTS="$PBUILDER_HOME/result/" DAILY_PACKAGES="$PBUILDER_HOME/packages/" - -BUILD_SOURCES="$PBUILDER_HOME/build-sources" -INCLUDE_CHANGES="$HOME_VINAIGRETTE/repo/include-changes" - REPO_DIR=/var/www/repo/debian PATATE_REPO_DIR=/var/www/repo/patate +# Scripts + +BUILD_SOURCES="$PBUILDER_HOME/build-sources" +INCLUDE_CHANGES="$HOME_VINAIGRETTE/repo/include-changes" +SENDXMPP="$HOME_VINAIGRETTE/sendxmpp" - -AVAILABLE_CODENAMES="wheezy jessie stretch" -DEFAULT_CODENAME="jessie" - -AVAILABLE_COMPONENTS="old-stable stable testing unstable extra" -DEFAULT_COMPONENT="unstable" - -AVAILABLE_ARCH="amd64 i386 armhf" -DEFAULT_ARCH="amd64" - - - - -DEPS="pbuilder reprepro" -DEPS="dpkg-parsechangelog pbuilder mk-build-deps debuild debclean reprepo sendxmpp" diff --git a/init.sh b/init.sh index 08c903d..09a3d0f 100644 --- a/init.sh +++ b/init.sh @@ -1,10 +1,33 @@ -cd /home/vinaigrette/repos/ + +apt-get install nginx pbuilder reprepro rebuildd gawk -y + +cd /home/vinaigrette/ +source config +gpg --import keys/$DEBSIGN_KEYID.key +gpg --import keys/$DEBSIGN_KEYID.pub + +cd repos/ git clone https://github.com/yunohost/yunohost git clone https://github.com/yunohost/yunohost-admin git clone https://github.com/yunohost/ssowat git clone https://github.com/yunohost/moulinette mkdir -p /var/www/repo/debian/conf/ + +cd /home/vinaigrette/ cp distributions /var/www/repo/debian/conf/ +cp /home/vinaigrette/rebuildd/rebuildd.conf /etc/rebuildd/rebuilddrc +cat keys/$DEBSIGN_KEYID.pub | apt-key add +cat /home/vinaigrette/sources.list >> /etc/apt/sources.list + +ln -s /home/vinaigrette/pbuilder/images /var/cache/pbuilder/images +ln -s /var/cache/pbuilder/result /home/vinaigrette/pbuilder/result + + +echo "127.0.0.1 $REPO_URL" >> /etc/hosts +cp /home/vinaigrette/nginx/repo.conf /etc/nginx/sites-enabled/repo.conf +service nginx reload + +rebuildd init diff --git a/nginx/repo.conf b/nginx/repo.conf new file mode 100644 index 0000000..b6e7fa0 --- /dev/null +++ b/nginx/repo.conf @@ -0,0 +1,27 @@ +server { + listen 80; + listen [::]:80; + server_name repo.yunohost.org; + + location '/.well-known/acme-challenge' { + default_type "text/plain"; + root /var/www/letsencrypt; + } + + # Document root + root /var/www/repo/debian; + index index.html; + location /debian { + autoindex on; + alias /var/www/repo/debian; + default_type text/plain; + } + + location ~ /(conf|logs)/ { + deny all; + } + + access_log /var/log/nginx/repo_access.log; + error_log /var/log/nginx/repo_error.log; +} + diff --git a/rebuildd/build-binaries b/rebuildd/build-binaries index cf7e8ac..5c92042 100755 --- a/rebuildd/build-binaries +++ b/rebuildd/build-binaries @@ -5,7 +5,7 @@ package=$2 version=$3 arch=$4 -source /home/vinaigrette/repo/config +source /home/vinaigrette/config source /home/vinaigrette/package_helpers.sh # Build only binary-only limited to architecture dependent packages diff --git a/rebuildd/rebuildd.conf b/rebuildd/rebuildd.conf new file mode 100644 index 0000000..b5826ab --- /dev/null +++ b/rebuildd/rebuildd.conf @@ -0,0 +1,44 @@ +[build] +check_every = 30 +max_threads = 1 +max_jobs = 5 +kill_timeout = 90 +source_cmd = /home/vinaigrette/rebuildd/get-sources ${d} ${p} ${v} +build_cmd = /home/vinaigrette/rebuildd/build-binaries ${d} ${p} ${v} ${a} +post_build_cmd = /home/vinaigrette/rebuildd/upload-binaries ${d} ${p} ${v} ${a} ${j} +dists = jessie stretch +work_dir = /var/cache/rebuildd/build +database_uri = sqlite:///var/lib/rebuildd/rebuildd.db +build_more_recent = 1 +more_archs = i386 armhf all any +no_system_arch = 0 + +[mail] +from = rebuildd@yunohost.org +mailto = rebuildd@yunohost.org +subject_prefix = [rebuildd] +smtp_host = localhost +smtp_port = 25 + +[telnet] +port = 9999 +ip = 127.0.0.1 +prompt = rebuildd@localhost-> +motd = Connected on rebuildd on localhost + +[http] +port = 9998 +ip = 0.0.0.0 +log_lines_nb = 30 +templates_dir = /usr/share/rebuildd/templates +cache = 1 +logfile = /var/log/rebuildd/httpd.log + +[log] +file = /var/log/rebuildd/rebuildd.log +time_format = %Y-%m-%d %H:%M:%S +logs_dir = /var/log/rebuildd/build_logs +mail_failed = 1 +mail_successful = 0 + + diff --git a/rebuildd/upload-binaries b/rebuildd/upload-binaries index 1dc2cae..410e92d 100755 --- a/rebuildd/upload-binaries +++ b/rebuildd/upload-binaries @@ -95,7 +95,7 @@ export HOME=$HOME_PBUILDER xmpp_msg="[rebuildd] Completed build of ${package}/${version} in ${COMPONENT} for ${CODENAME}/${arch}. See http://rebuild.yunohost.org/job/${job}" echo -n "$xmpp_msg" \ - | sendxmpp -u gitbot -j im.yunohost.org -p $XMPP_BOT_KEY \ + | $SENDXMPP -u gitbot -j im.yunohost.org -p $XMPP_BOT_KEY \ -c dev@conference.yunohost.org -r GitBot exit $status diff --git a/repo/move-to-incoming b/repo/move-to-incoming index 6aa648c..614d6e8 100755 --- a/repo/move-to-incoming +++ b/repo/move-to-incoming @@ -2,7 +2,7 @@ changes_file=$1 -source /home/vinaigrette/repo/config +source /home/vinaigrette/config source /home/vinaigrette/package_helpers.sh INCOMING_DIR=${REPO_DIR}/incoming diff --git a/repo/process-include b/repo/process-include index fe932c9..670803d 100755 --- a/repo/process-include +++ b/repo/process-include @@ -6,9 +6,8 @@ package=$3 version=$4 changes_file=$5 -source /usr/local/lib/helpers/debian/package.sh - -MAIL="rebuildd@yunohost.org" +source /home/vinaigrette/config +source /home/vinaigrette/package_helpers.sh # Only care about packages being added if [[ $action != accepted ]]; then diff --git a/sources.list b/sources.list new file mode 100644 index 0000000..276aea6 --- /dev/null +++ b/sources.list @@ -0,0 +1,2 @@ +deb-src http://repo.yunohost.org/debian jessie stable testing unstable extra +#deb-src http://repo.yunohost.org/debian stretch extra