fix local build

This commit is contained in:
Roy Olav Purser 2022-03-05 19:41:02 +01:00
parent 21c4c64cde
commit e8d4f1f329
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -9,7 +9,8 @@ then
export DRONE_TAG=$(git describe --abbrev=0 | tr -dc v0-9) export DRONE_TAG=$(git describe --abbrev=0 | tr -dc v0-9)
fi fi
rm "${dir}/out" mkdir -p "${dir}/out"
rm -rf "${dir}/out"
mkdir -p "${temp_dir}/out" mkdir -p "${temp_dir}/out"
mkdir -p "${chrome_dir}" mkdir -p "${chrome_dir}"
@ -29,7 +30,7 @@ then
dbus-daemon --session --address="${DBUS_SESSION_BUS_ADDRESS}" & dbus-daemon --session --address="${DBUS_SESSION_BUS_ADDRESS}" &
fi fi
if [[ "${DISPLAY}test" == "test" ]] if [[ ! -n "${DISPLAY}" ]]
then then
export DISPLAY=:8819 export DISPLAY=:8819
Xvfb "${DISPLAY}" & Xvfb "${DISPLAY}" &
@ -46,7 +47,12 @@ fi
release_folder="${temp_dir}/out/proxy-stream-${DRONE_TAG}" release_folder="${temp_dir}/out/proxy-stream-${DRONE_TAG}"
cp -r "${dir}/chrome" "${release_folder}" cp -r "${dir}/chrome" "${release_folder}"
if grep "/proc/1/cgroup" -q -F -e docker
then
${browser} --disable-gpu --no-sandbox --user-data-dir=${chrome_dir} --pack-extension="${temp_dir}/out/proxy-stream-${DRONE_TAG}" --pack-extension-key="${temp_dir}/privkey.pem" ${browser} --disable-gpu --no-sandbox --user-data-dir=${chrome_dir} --pack-extension="${temp_dir}/out/proxy-stream-${DRONE_TAG}" --pack-extension-key="${temp_dir}/privkey.pem"
else
${browser} --user-data-dir=${chrome_dir} --pack-extension="${temp_dir}/out/proxy-stream-${DRONE_TAG}" --pack-extension-key="${temp_dir}/privkey.pem"
fi
rm -rf "${release_folder}" rm -rf "${release_folder}"
mv "${temp_dir}/out" "${dir}/out" mv "${temp_dir}/out" "${dir}/out"