Commit 18302ed0 authored by Guido Gunther's avatar Guido Gunther
Browse files

build-image: Allow to provide jenkins auth

For restricted builds (e.g. when preparing embargoed security updates)o
it's good to be able to fetch artifacts from restricted jobs.
parent c8a97623
Pipeline #29138 passed with stage
in 13 seconds
......@@ -3,6 +3,7 @@ local.sh
*.img
*.img.xz
*.tar.xz
conf/auth.conf
files/
tmp/
bin/qemu-arm-static
......
......@@ -19,6 +19,15 @@ usage() {
}
build_auth () {
if [ -f conf/auth.conf ]; then
# shellcheck disable=SC1091
. ./conf/auth.conf
JENKINS_AUTH=(--auth-no-challenge "--http-user=${JENKINS_USER}" "--http-password=${JENKINS_TOKEN}")
fi
}
fetch_nitrogen_uboot_upgrade() {
local board="$1"
local url="$2"
......@@ -37,7 +46,7 @@ fetch_kernel() {
[ -n "${kernel_url}" ] || { echo "kernel_url not set in board config"; exit 1; }
rm -f files/archive.zip
echo "Fetching kernel from ${kernel_url}"
wget -nv --no-glob -Pfiles/ "${kernel_url}"
wget "${JENKINS_AUTH[@]}" -nv --no-glob -Pfiles/ "${kernel_url}"
(cd files/ && unzip -ojq archive.zip)
}
......@@ -48,7 +57,7 @@ fetch_uboot() {
[ -n "${uboot_url}" ] || { echo "uboot_url not set in board config"; exit 1; }
rm -f "${dir}/archive.zip"
echo "Fetching uboot from ${uboot_url}"
wget -nv --no-glob -P"${dir}" "${uboot_url}"
wget "${JENKINS_AUTH[@]}" -nv --no-glob -P"${dir}" "${uboot_url}"
(cd "${dir}" && unzip -ojq archive.zip)
}
......@@ -119,6 +128,7 @@ custom_package_opt=
board_packages=
meta_yml=files/meta.yml
fk_machine=
JENKINS_AUTH=()
while getopts ":hb:d:T:B" opt; do
case ${opt} in
......@@ -157,6 +167,8 @@ mainimg="${pureos_board}.img"
# shellcheck source=conf/dists/buster
. conf/dists/"${distro}"
build_auth
[ -n "${debootstrap_dist}" ] || debootstrap_dist="${distro}"
echo "Building ${mainimg} (board_type: ${board_type}, arch: ${arch}, build_type: ${build_type}, ci_pkgs: ${ci_pkgs}, ${debootstrap_dist})"
echo "Installing extra packages ${packages}"
......
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