blob: 62a410cd23169efebf4fb08bd7f19bddbf14b19b [file] [log] [blame]
#!/bin/bash
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -ex -o pipefail
. "$(dirname "$0")/common.sh" || exit 1
main() {
require_kokoro_artifacts
local src_root="${KOKORO_ARTIFACTS_DIR}/git/cros-container-guest-tools"
local repo_dir="${src_root}"/apt_signed
mkdir -p "${repo_dir}"
cp -r "${KOKORO_GFILE_DIR}"/apt_unsigned/* "${repo_dir}"
# 78BD65473CB3BD13 - old key, expires 2022-07-21
# 4EB27DB2A3B88B8B - new key, expires 2024-10-25
local key_ids="78BD65473CB3BD13,4EB27DB2A3B88B8B"
# Sign the Release file(s).
local release_file
for release_file in "${repo_dir}"/dists/*/Release; do
/escalated_sign/escalated_sign.py --tool=linux_gpg_sign \
--job-dir=/escalated_sign_jobs -- \
--signing_key="${key_ids}" \
--loglevel=debug \
"${release_file}"
mv "${release_file}.asc" "${release_file}.gpg"
done
# Sign the debs.
local deb
find "${repo_dir}/pool" -name "*.deb" -exec \
/escalated_sign/escalated_sign.py --tool=linux_gpg_sign \
--job-dir=/escalated_sign_jobs -- \
--signing_key="${key_ids}" \
--loglevel=debug \
{} \;
}
main "$@"