get chrome sign key from env

This commit is contained in:
Roy Olav Purser 2021-06-15 15:35:34 +02:00
parent 9d354c837e
commit 0a921179df
Signed by: roypur
GPG Key ID: E14D26A036F21656
2 changed files with 11 additions and 1 deletions

View File

@ -3,6 +3,9 @@ name: default
steps:
- name: compile-chrome
image: roypur/chrome-packer:latest
environment:
CHROME_PRIVKEY:
from_secret: chrome_privkey
commands:
- ./pack-chrome.sh
- name: gitea_release

View File

@ -5,6 +5,13 @@ temp_dir="/tmp/${temp_name}"
chrome_dir="${temp_dir}/chrome"
mkdir -p "${chrome_dir}"
if [[ "${CHROME_PRIVKEY}test" == "test" ]]
then
cp "${HOME}/keys/chrome-privkey.pem" "${temp_dir}/privkey.pem"
else
echo "${CHROME_PRIVKEY}" > "${temp_dir}/privkey.pem"
fi
if [[ "${DBUS_SESSION_BUS_ADDRESS}test" == "test" ]]
then
export DBUS_SYSTEM_BUS_ADDRESS="unix:path=${temp_dir}/dbus-system.sock"
@ -27,6 +34,6 @@ then
browser=$(which chromium 2> /dev/null)
fi
${browser} --disable-gpu --no-sandbox --user-data-dir=${chrome_dir} --pack-extension="${dir}/chrome" --pack-extension-key=${HOME}/keys/privkey.pem
${browser} --disable-gpu --no-sandbox --user-data-dir=${chrome_dir} --pack-extension="${dir}/chrome" --pack-extension-key="${temp_dir}/privkey.pem"
rm -rf ${temp_dir}