Tpe win sign (#1399)
* [GHA] TPE signing service adoption * [GHA] yaml syntax error * [GHA] corrections * [GHA] corrections * [GHA] correct wait times * [GHA] correct aws s3 command * [GHA] wrap up * [GHA] polish up
This commit is contained in:
2
.github/scripts/sign-exe-in-zip-file.sh
vendored
2
.github/scripts/sign-exe-in-zip-file.sh
vendored
@@ -18,7 +18,7 @@ echo "Successfully extracted ${filename}"
|
||||
sts_folder=`find ./${destination_folder_name} -maxdepth 1 -type d -name 'sts-*' -print -quit`
|
||||
echo "Found STS distro folder: ${sts_folder}"
|
||||
echo "About to sign win exe file: ${sts_folder}/SpringToolSuite4.exe (id = ${id})"
|
||||
$sign_script ${sts_folder}/SpringToolSuite4.exe ${sts_folder}/SpringToolSuite4.exe $id
|
||||
$sign_script ${sts_folder}/SpringToolSuite4.exe ${sts_folder}/SpringToolSuite4.exe "${id}-${filename%.*}" 30 900
|
||||
echo "Adding to zip contents of a folder ${destination_folder_name}"
|
||||
cd ${destination_folder_name}
|
||||
zip -r -q ../$file .
|
||||
|
||||
26
.github/scripts/sign-exe.sh
vendored
26
.github/scripts/sign-exe.sh
vendored
@@ -2,17 +2,21 @@ set -e
|
||||
in_file=$1
|
||||
out_file=$2
|
||||
id=$3
|
||||
wait_time=$4
|
||||
timeout=$5
|
||||
|
||||
in_filename="$(basename -- $in_file)"
|
||||
echo "Setting up folder ${id} on the remote machine"
|
||||
ssh -i $SSH_KEY $SSH_USER@vm-tools.spring.vmware.com -- mkdir /opt/bamboo/$id
|
||||
echo "Copying $in_filename to remote machine into /opt/bamboo/${id}..."
|
||||
scp -i $SSH_KEY $in_file $SSH_USER@vm-tools.spring.vmware.com:/opt/bamboo/$id
|
||||
echo "Signing $in_filename..."
|
||||
ssh -i $SSH_KEY $SSH_USER@vm-tools.spring.vmware.com -- /build/apps/signing/signserver/signc -v --input=/opt/bamboo/$id/$in_filename --keyid=authenticode_SHA2 --signmethod="winddk-8.1" --output=/opt/bamboo/$id/$in_filename --hash sha256
|
||||
echo "Copying **signed** $in_filename back... (into $out_file)"
|
||||
scp -i $SSH_KEY $SSH_USER@vm-tools.spring.vmware.com:/opt/bamboo/$id/$in_filename $out_file
|
||||
echo "Cleaning up remote machine..."
|
||||
ssh -i $SSH_KEY $SSH_USER@vm-tools.spring.vmware.com -- rm -rf /opt/bamboo/$id
|
||||
echo "Successfully signed $in_filename"
|
||||
echo "Copying ${in_file} to s3 s3://${AWS_S3_BUCKET}/exes-to-sign/${id}.exe for signing"
|
||||
aws s3 cp $in_file s3://$AWS_S3_BUCKET/exes-to-sign/$id.exe --no-progress
|
||||
for (( i=wait_time; i<timeout; i+=wait_time )) ; {
|
||||
sleep $wait_time
|
||||
object_exists=$(aws s3api head-object --bucket $CDN_BUCKET --key spring-tools/exes-signed/$id.exe || true)
|
||||
if [ -z "$object_exists" ]; then
|
||||
echo "Waited ${i} seconds but ${in_filename} hasn't been signed yet..."
|
||||
else
|
||||
echo "Successfully signed file ${in_filename}"
|
||||
break
|
||||
fi
|
||||
}
|
||||
aws s3 mv s3://$AWS_S3_BUCKET/exes-signed/$id.exe $out_file --no-progress
|
||||
|
||||
|
||||
Reference in New Issue
Block a user