From 0a921179dfeb71a2b689f3d985bd89116bfd2714 Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Tue, 15 Jun 2021 15:35:34 +0200 Subject: [PATCH] get chrome sign key from env --- .drone.yml | 3 +++ pack-chrome.sh | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index a753346..3b60f14 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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 diff --git a/pack-chrome.sh b/pack-chrome.sh index e769ddf..c10024b 100755 --- a/pack-chrome.sh +++ b/pack-chrome.sh @@ -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}