Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions push_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ docker login -u ${REGISTRY_USERNAME} -p "${REGISTRY_PASSWD}" ${REGISTRY_SERVER_W
docker_image_name=$(basename ${DOCKER_IMAGE_FILE} | cut -d. -f1)
remote_image_name=${REGISTRY_SERVER_WITH_PORT}/${docker_image_name}

[ -z "${DOCKER_IMAGE_TAG}" ] || {
push_it ${docker_image_name} ${remote_image_name}:${DOCKER_IMAGE_TAG}
}
for tag in ${DOCKER_IMAGE_TAG}
do
push_it ${docker_image_name} ${remote_image_name}:$tag
done

if [ -n "${sonic_version}" ] && [ -n "${sonic_platform}" ]
then
Expand Down
12 changes: 9 additions & 3 deletions src/sonic-build-hooks/scripts/buildinfo_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ DPKG_INSTALLTION_LOCK_FILE=/tmp/.dpkg_installation.lock

URL_PREFIX=$(echo "${PACKAGE_URL_PREFIX}" | sed -E "s#(//[^/]*/).*#\1#")

if [ "$(whoami)" != "root" ] && [ -n "$(which sudo)" ];then
SUDO=sudo
else
SUDO=''
fi

log_err()
{
echo "$1" >> $LOG_PATH/error.log
Expand Down Expand Up @@ -73,7 +79,7 @@ set_reproducible_mirrors()

local mirrors="/etc/apt/sources.list $(find /etc/apt/sources.list.d/ -type f)"
for mirror in $mirrors; do
sed -i "$expression" "$mirror"
$SUDO sed -i "$expression" "$mirror"
done
}

Expand Down Expand Up @@ -162,11 +168,11 @@ run_pip_command()
install=y
elif [[ "$para" == *.whl ]]; then
package_name=$(echo $para | cut -d- -f1 | tr _ .)
sed "/^${package_name}==/d" -i $tmp_version_file
$SUDO sed "/^${package_name}==/d" -i $tmp_version_file
elif [[ "$para" == *==* ]]; then
# fix pip package constraint conflict issue
package_name=$(echo $para | cut -d= -f1)
sed "/^${package_name}==/d" -i $tmp_version_file
$SUDO sed "/^${package_name}==/d" -i $tmp_version_file
fi
done

Expand Down