From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8CF78139084 for ; Fri, 15 Dec 2017 05:48:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E4DA0E1091; Fri, 15 Dec 2017 05:48:32 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B4579E1091 for ; Fri, 15 Dec 2017 05:48:31 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4838F33BE19 for ; Fri, 15 Dec 2017 05:48:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D7AF7AE85 for ; Fri, 15 Dec 2017 05:48:28 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1513316900.0292a7e2b5e28486380ea1c5eef1ccbd8ca1365b.robbat2@gentoo> Subject: [gentoo-commits] proj/releng:master commit in: tools/ X-VCS-Repository: proj/releng X-VCS-Files: tools/catalyst-auto-amd64.conf tools/catalyst-auto-x86.conf X-VCS-Directories: tools/ X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: 0292a7e2b5e28486380ea1c5eef1ccbd8ca1365b X-VCS-Branch: master Date: Fri, 15 Dec 2017 05:48:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 812a8021-a6dd-45d7-a62c-666105cf1545 X-Archives-Hash: d84cb0f18b7cb9cf9f92c6f64bc4de62 commit: 0292a7e2b5e28486380ea1c5eef1ccbd8ca1365b Author: Robin H. Johnson gentoo org> AuthorDate: Fri Dec 15 05:48:20 2017 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Fri Dec 15 05:48:20 2017 +0000 URL: https://gitweb.gentoo.org/proj/releng.git/commit/?id=0292a7e2 tools/catalyst-auto-{x86,amd64}: refactor post_build for remote buildhost. Signed-off-by: Robin H. Johnson gentoo.org> tools/catalyst-auto-amd64.conf | 28 ++++++++++++++++++++-------- tools/catalyst-auto-x86.conf | 32 ++++++++++++++++++++++++-------- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/tools/catalyst-auto-amd64.conf b/tools/catalyst-auto-amd64.conf index a6082de7..53dac821 100644 --- a/tools/catalyst-auto-amd64.conf +++ b/tools/catalyst-auto-amd64.conf @@ -84,31 +84,43 @@ pre_build() { } post_build() { + cmd=( + rsync + -e 'ssh -i /root/.ssh/id_rsa' + -a + --omit-dir-times + --delay-updates + ) + case $HOSTNAME in + nightheron) DEST=${BUILD_DESTDIR_BASE} ;; + *) DEST=${ARCH}@nightheron.gentoo.org:${BUILD_DESTDIR_BASE} ;; + esac pushd ${BUILD_SRCDIR_BASE}/default >/dev/null - mkdir -p ${BUILD_DESTDIR_BASE} + mkdir -p ${TMPDIR}/empty + "${cmd[@]}" ${TMPDIR}/empty ${DEST} for file in $(ls stage{3,4}*${DATESTAMP}*${EXTENSIONS} stage{3,4}*${TIMESTAMP}*${EXTENSIONS} ); do if [ -f $file ]; then - cp $file* ${BUILD_DESTDIR_BASE} + "${cmd[@]}" ${file}* ${DEST} fi done if [ -f *${DATESTAMP}*.iso ]; then - cp *${DATESTAMP}*.iso* ${BUILD_DESTDIR_BASE} + "${cmd[@]}" *${DATESTAMP}*.iso* ${DEST} elif [ -f *${TIMESTAMP}*.iso ]; then - cp *${TIMESTAMP}*.iso* ${BUILD_DESTDIR_BASE} + "${cmd[@]}" *${TIMESTAMP}*.iso* ${DEST} fi popd >/dev/null pushd ${BUILD_SRCDIR_BASE}/hardened >/dev/null - mkdir -p ${BUILD_DESTDIR_BASE}/hardened + "${cmd[@]}" ${TMPDIR}/empty ${DEST}/hardened for file in $(ls stage{3,4}*${DATESTAMP}*${EXTENSIONS} stage{3,4}*${TIMESTAMP}*${EXTENSIONS} ); do if [ -f $file ]; then - cp $file* ${BUILD_DESTDIR_BASE}/hardened + "${cmd[@]}" $file* ${DEST}/hardened fi done if [ -f *${DATESTAMP}*.iso ]; then - cp *${DATESTAMP}*.iso* ${BUILD_DESTDIR_BASE}/hardened + "${cmd[@]}" *${DATESTAMP}*.iso* ${DEST}/hardened elif [ -f *${TIMESTAMP}*.iso ]; then - cp *${TIMESTAMP}*.iso* ${BUILD_DESTDIR_BASE}/hardened + "${cmd[@]}" *${TIMESTAMP}*.iso* ${DEST}/hardened fi } diff --git a/tools/catalyst-auto-x86.conf b/tools/catalyst-auto-x86.conf index 4d49b8b4..6ec010ce 100644 --- a/tools/catalyst-auto-x86.conf +++ b/tools/catalyst-auto-x86.conf @@ -55,27 +55,43 @@ pre_build() { } post_build() { + cmd=( + rsync + -e 'ssh -i /root/.ssh/id_rsa' + -a + --omit-dir-times + --delay-updates + ) + case $HOSTNAME in + nightheron) DEST=${BUILD_DESTDIR_BASE} ;; + *) DEST=${ARCH}@nightheron.gentoo.org:${BUILD_DESTDIR_BASE} ;; + esac pushd ${BUILD_SRCDIR_BASE}/default >/dev/null - mkdir -p ${BUILD_DESTDIR_BASE} - for file in $(ls stage{3,4}*${DATESTAMP}*${EXTENSIONS} ); do + mkdir -p ${TMPDIR}/empty + "${cmd[@]}" ${TMPDIR}/empty ${DEST} + for file in $(ls stage{3,4}*{${DATESTAMP},${TIMESTAMP}}*${EXTENSIONS} ); do if [ -f $file ]; then - cp $file* ${BUILD_DESTDIR_BASE} + "${cmd[@]}" ${file}* ${DEST} fi done if [ -f *${DATESTAMP}*.iso ]; then - cp *${DATESTAMP}*.iso* ${BUILD_DESTDIR_BASE} + "${cmd[@]}" *${DATESTAMP}*.iso* ${DEST} + elif [ -f *${TIMESTAMP}*.iso ]; then + "${cmd[@]}" *${TIMESTAMP}*.iso* ${DEST} fi popd >/dev/null pushd ${BUILD_SRCDIR_BASE}/hardened >/dev/null - mkdir -p ${BUILD_DESTDIR_BASE}/hardened - for file in $(ls stage{3,4}*${DATESTAMP}*${EXTENSIONS} ); do + "${cmd[@]}" ${TMPDIR}/empty ${DEST}/hardened + for file in $(ls stage{3,4}*{${DATESTAMP},${TIMESTAMP}}*${EXTENSIONS} ); do if [ -f $file ]; then - cp $file* ${BUILD_DESTDIR_BASE}/hardened + "${cmd[@]}" $file* ${DEST}/hardened fi done if [ -f *${DATESTAMP}*.iso ]; then - cp *${DATESTAMP}*.iso* ${BUILD_DESTDIR_BASE}/hardened + "${cmd[@]}" *${DATESTAMP}*.iso* ${DEST}/hardened + elif [ -f *${TIMESTAMP}*.iso ]; then + "${cmd[@]}" *${TIMESTAMP}*.iso* ${DEST}/hardened fi }