tools: Consolidate upload() function
Signed-off-by: Matt Turner <mattst88@gentoo.org>
This commit is contained in:
parent
8f478fe30b
commit
7ec486fab4
|
@ -47,7 +47,6 @@ Options:
|
|||
--interval <days> Exit if last successful run was less than <days> ago
|
||||
-l|--lock <file> File to grab a lock on to prevent multiple invocations
|
||||
-X|--nonetwork Do not perform network operations (like uploading result)
|
||||
This needs to be supported by the config file as well.
|
||||
-h|--help Show this message and quit
|
||||
|
||||
EOH
|
||||
|
@ -270,6 +269,29 @@ verify_dnssec() {
|
|||
fi
|
||||
}
|
||||
|
||||
upload() {
|
||||
if [[ ${nonetwork} == 0 ]]; then
|
||||
echo Uploading "$@"
|
||||
local SSH_CMD=(
|
||||
ssh
|
||||
-i ${UPLOAD_KEY}
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
-o VerifyHostKeyDNS=yes
|
||||
-o StrictHostKeyChecking=no
|
||||
)
|
||||
local RSYNC_OPTS=(
|
||||
-e "${SSH_CMD[*]}"
|
||||
--archive
|
||||
--omit-dir-times
|
||||
--delay-updates
|
||||
)
|
||||
rsync "${RSYNC_OPTS[@]}" "$@" ${UPLOAD_USER}@releng-incoming.gentoo.org:${UPLOAD_DEST}
|
||||
else
|
||||
echo Would now upload "$@"
|
||||
ls -l $@
|
||||
fi
|
||||
}
|
||||
|
||||
run_catalyst_commands() {
|
||||
doneconfig=0
|
||||
for config_file in "${config_files[@]}"; do
|
||||
|
|
|
@ -33,24 +33,6 @@ update_symlinks() {
|
|||
done
|
||||
}
|
||||
|
||||
upload() {
|
||||
echo Uploading "$@"
|
||||
local SSH_CMD=(
|
||||
ssh
|
||||
-i ${UPLOAD_KEY}
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
-o VerifyHostKeyDNS=yes
|
||||
-o StrictHostKeyChecking=no
|
||||
)
|
||||
local RSYNC_OPTS=(
|
||||
-e "${SSH_CMD[*]}"
|
||||
--archive
|
||||
--omit-dir-times
|
||||
--delay-updates
|
||||
)
|
||||
rsync "${RSYNC_OPTS[@]}" "$@" ${UPLOAD_USER}@releng-incoming.gentoo.org:${UPLOAD_DEST}
|
||||
}
|
||||
|
||||
post_build() {
|
||||
local set=$1 spec=$2
|
||||
|
||||
|
|
|
@ -65,24 +65,6 @@ update_symlinks() {
|
|||
done
|
||||
}
|
||||
|
||||
upload() {
|
||||
echo " ** Uploading $@"
|
||||
local SSH_CMD=(
|
||||
ssh
|
||||
-i ${UPLOAD_KEY}
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
-o VerifyHostKeyDNS=yes
|
||||
-o StrictHostKeyChecking=no
|
||||
)
|
||||
local RSYNC_OPTS=(
|
||||
-e "${SSH_CMD[*]}"
|
||||
--archive
|
||||
--omit-dir-times
|
||||
--delay-updates
|
||||
)
|
||||
rsync "${RSYNC_OPTS[@]}" "$@" ${UPLOAD_USER}@releng-incoming.gentoo.org:${UPLOAD_DEST}
|
||||
}
|
||||
|
||||
post_build() {
|
||||
local set=$1 spec=$2
|
||||
|
||||
|
|
|
@ -54,29 +54,6 @@ update_symlinks() {
|
|||
done
|
||||
}
|
||||
|
||||
upload() {
|
||||
if [[ ${nonetwork} == 0 ]]; then
|
||||
echo Uploading "$@"
|
||||
local SSH_CMD=(
|
||||
ssh
|
||||
-i ${UPLOAD_KEY}
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
-o VerifyHostKeyDNS=yes
|
||||
-o StrictHostKeyChecking=no
|
||||
)
|
||||
local RSYNC_OPTS=(
|
||||
-e "${SSH_CMD[*]}"
|
||||
--archive
|
||||
--omit-dir-times
|
||||
--delay-updates
|
||||
)
|
||||
rsync "${RSYNC_OPTS[@]}" "$@" ${UPLOAD_USER}@releng-incoming.gentoo.org:${UPLOAD_DEST}
|
||||
else
|
||||
echo Would now upload "$@"
|
||||
ls -l $@
|
||||
fi
|
||||
}
|
||||
|
||||
post_build() {
|
||||
local set=$1 spec=$2
|
||||
|
||||
|
|
|
@ -28,23 +28,6 @@ update_symlinks() {
|
|||
done
|
||||
}
|
||||
|
||||
upload() {
|
||||
local SSH_CMD=(
|
||||
ssh
|
||||
-i ${UPLOAD_KEY}
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
-o VerifyHostKeyDNS=yes
|
||||
-o StrictHostKeyChecking=no
|
||||
)
|
||||
local RSYNC_OPTS=(
|
||||
-e "${SSH_CMD[*]}"
|
||||
--archive
|
||||
--omit-dir-times
|
||||
--delay-updates
|
||||
)
|
||||
rsync "${RSYNC_OPTS[@]}" "$@" ${UPLOAD_USER}@releng-incoming.gentoo.org:${UPLOAD_DEST}
|
||||
}
|
||||
|
||||
post_build() {
|
||||
local set=$1 spec=$2
|
||||
|
||||
|
|
|
@ -34,23 +34,6 @@ update_symlinks() {
|
|||
done
|
||||
}
|
||||
|
||||
upload() {
|
||||
local SSH_CMD=(
|
||||
ssh
|
||||
-i ${UPLOAD_KEY}
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
-o VerifyHostKeyDNS=yes
|
||||
-o StrictHostKeyChecking=no
|
||||
)
|
||||
local RSYNC_OPTS=(
|
||||
-e "${SSH_CMD[*]}"
|
||||
--archive
|
||||
--omit-dir-times
|
||||
--delay-updates
|
||||
)
|
||||
rsync "${RSYNC_OPTS[@]}" "$@" ${UPLOAD_USER}@releng-incoming.gentoo.org:${UPLOAD_DEST}
|
||||
}
|
||||
|
||||
post_build() {
|
||||
local set=$1 spec=$2
|
||||
|
||||
|
|
|
@ -27,23 +27,6 @@ update_symlinks() {
|
|||
done
|
||||
}
|
||||
|
||||
upload() {
|
||||
local SSH_CMD=(
|
||||
ssh
|
||||
-i ${UPLOAD_KEY}
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
-o VerifyHostKeyDNS=yes
|
||||
-o StrictHostKeyChecking=no
|
||||
)
|
||||
local RSYNC_OPTS=(
|
||||
-e "${SSH_CMD[*]}"
|
||||
--archive
|
||||
--omit-dir-times
|
||||
--delay-updates
|
||||
)
|
||||
rsync "${RSYNC_OPTS[@]}" "$@" ${UPLOAD_USER}@releng-incoming.gentoo.org:${UPLOAD_DEST}
|
||||
}
|
||||
|
||||
post_build() {
|
||||
local set=$1 spec=$2
|
||||
|
||||
|
|
|
@ -32,23 +32,6 @@ update_symlinks() {
|
|||
popd >/dev/null
|
||||
done
|
||||
}
|
||||
|
||||
upload() {
|
||||
local SSH_CMD=(
|
||||
ssh
|
||||
-i ${UPLOAD_KEY}
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
-o VerifyHostKeyDNS=yes
|
||||
-o StrictHostKeyChecking=no
|
||||
)
|
||||
local RSYNC_OPTS=(
|
||||
-e "${SSH_CMD[*]}"
|
||||
--archive
|
||||
--omit-dir-times
|
||||
--delay-updates
|
||||
)
|
||||
rsync "${RSYNC_OPTS[@]}" "$@" ${UPLOAD_USER}@releng-incoming.gentoo.org:${UPLOAD_DEST}
|
||||
}
|
||||
|
||||
post_build() {
|
||||
local set=$1 spec=$2
|
||||
|
|
|
@ -34,23 +34,6 @@ update_symlinks() {
|
|||
done
|
||||
}
|
||||
|
||||
upload() {
|
||||
local SSH_CMD=(
|
||||
ssh
|
||||
-i ${UPLOAD_KEY}
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
-o VerifyHostKeyDNS=yes
|
||||
-o StrictHostKeyChecking=no
|
||||
)
|
||||
local RSYNC_OPTS=(
|
||||
-e "${SSH_CMD[*]}"
|
||||
--archive
|
||||
--omit-dir-times
|
||||
--delay-updates
|
||||
)
|
||||
rsync "${RSYNC_OPTS[@]}" "$@" ${UPLOAD_USER}@releng-incoming.gentoo.org:${UPLOAD_DEST}
|
||||
}
|
||||
|
||||
post_build() {
|
||||
local set=$1 spec=$2
|
||||
|
||||
|
|
|
@ -55,29 +55,6 @@ update_symlinks() {
|
|||
done
|
||||
}
|
||||
|
||||
upload() {
|
||||
if [[ ${nonetwork} == 0 ]]; then
|
||||
echo Uploading "$@"
|
||||
local SSH_CMD=(
|
||||
ssh
|
||||
-i ${UPLOAD_KEY}
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
-o VerifyHostKeyDNS=yes
|
||||
-o StrictHostKeyChecking=no
|
||||
)
|
||||
local RSYNC_OPTS=(
|
||||
-e "${SSH_CMD[*]}"
|
||||
--archive
|
||||
--omit-dir-times
|
||||
--delay-updates
|
||||
)
|
||||
rsync "${RSYNC_OPTS[@]}" "$@" ${UPLOAD_USER}@releng-incoming.gentoo.org:${UPLOAD_DEST}
|
||||
else
|
||||
echo Would now upload "$@"
|
||||
ls -l $@
|
||||
fi
|
||||
}
|
||||
|
||||
post_build() {
|
||||
local set=$1 spec=$2
|
||||
|
||||
|
|
|
@ -42,26 +42,6 @@ update_symlinks() {
|
|||
done
|
||||
}
|
||||
|
||||
upload() {
|
||||
if [[ ${nonetwork} == 0 ]]; then
|
||||
echo Uploading "$@"
|
||||
local SSH_CMD=(
|
||||
ssh
|
||||
-i ${UPLOAD_KEY}
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
-o VerifyHostKeyDNS=yes
|
||||
-o StrictHostKeyChecking=no
|
||||
)
|
||||
local RSYNC_OPTS=(
|
||||
-e "${SSH_CMD[*]}"
|
||||
--archive
|
||||
--omit-dir-times
|
||||
--delay-updates
|
||||
)
|
||||
rsync "${RSYNC_OPTS[@]}" "$@" ${UPLOAD_USER}@releng-incoming.gentoo.org:${UPLOAD_DEST}
|
||||
fi
|
||||
}
|
||||
|
||||
post_build() {
|
||||
local set=$1 spec=$2
|
||||
|
||||
|
|
|
@ -27,23 +27,6 @@ update_symlinks() {
|
|||
done
|
||||
}
|
||||
|
||||
upload() {
|
||||
local SSH_CMD=(
|
||||
ssh
|
||||
-i ${UPLOAD_KEY}
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
-o VerifyHostKeyDNS=yes
|
||||
-o StrictHostKeyChecking=no
|
||||
)
|
||||
local RSYNC_OPTS=(
|
||||
-e "${SSH_CMD[*]}"
|
||||
--archive
|
||||
--omit-dir-times
|
||||
--delay-updates
|
||||
)
|
||||
rsync "${RSYNC_OPTS[@]}" "$@" ${UPLOAD_USER}@releng-incoming.gentoo.org:${UPLOAD_DEST}
|
||||
}
|
||||
|
||||
post_build() {
|
||||
local set=$1 spec=$2
|
||||
|
||||
|
|
|
@ -27,23 +27,6 @@ update_symlinks() {
|
|||
done
|
||||
}
|
||||
|
||||
upload() {
|
||||
local SSH_CMD=(
|
||||
ssh
|
||||
-i ${UPLOAD_KEY}
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
-o VerifyHostKeyDNS=yes
|
||||
-o StrictHostKeyChecking=no
|
||||
)
|
||||
local RSYNC_OPTS=(
|
||||
-e "${SSH_CMD[*]}"
|
||||
--archive
|
||||
--omit-dir-times
|
||||
--delay-updates
|
||||
)
|
||||
rsync "${RSYNC_OPTS[@]}" "$@" ${UPLOAD_USER}@releng-incoming.gentoo.org:${UPLOAD_DEST}
|
||||
}
|
||||
|
||||
post_build() {
|
||||
local set=$1 spec=$2
|
||||
|
||||
|
|
|
@ -29,23 +29,6 @@ update_symlinks() {
|
|||
done
|
||||
}
|
||||
|
||||
upload() {
|
||||
local SSH_CMD=(
|
||||
ssh
|
||||
-i ${UPLOAD_KEY}
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
-o VerifyHostKeyDNS=yes
|
||||
-o StrictHostKeyChecking=no
|
||||
)
|
||||
local RSYNC_OPTS=(
|
||||
-e "${SSH_CMD[*]}"
|
||||
--archive
|
||||
--omit-dir-times
|
||||
--delay-updates
|
||||
)
|
||||
rsync "${RSYNC_OPTS[@]}" "$@" ${UPLOAD_USER}@releng-incoming.gentoo.org:${UPLOAD_DEST}
|
||||
}
|
||||
|
||||
post_build() {
|
||||
local set=$1 spec=$2
|
||||
|
||||
|
|
|
@ -52,24 +52,6 @@ update_symlinks() {
|
|||
done
|
||||
}
|
||||
|
||||
upload() {
|
||||
echo " ** Uploading $@"
|
||||
local SSH_CMD=(
|
||||
ssh
|
||||
-i ${UPLOAD_KEY}
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
-o VerifyHostKeyDNS=yes
|
||||
-o StrictHostKeyChecking=no
|
||||
)
|
||||
local RSYNC_OPTS=(
|
||||
-e "${SSH_CMD[*]}"
|
||||
--archive
|
||||
--omit-dir-times
|
||||
--delay-updates
|
||||
)
|
||||
rsync "${RSYNC_OPTS[@]}" "$@" ${UPLOAD_USER}@releng-incoming.gentoo.org:${UPLOAD_DEST}
|
||||
}
|
||||
|
||||
post_build() {
|
||||
local set=$1 spec=$2
|
||||
|
||||
|
|
Loading…
Reference in a new issue