From 365d87a6499ca3bd1d40f4d42d031b9701f8d541 Mon Sep 17 00:00:00 2001 From: Alex Boyko Date: Thu, 7 Nov 2024 00:57:53 -0500 Subject: [PATCH] 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 --- .github/scripts/sign-exe-in-zip-file.sh | 2 +- .github/scripts/sign-exe.sh | 26 +++++++++++-------- .../gh-hosted-eclipse-distro-build.yml | 20 +++----------- 3 files changed, 20 insertions(+), 28 deletions(-) diff --git a/.github/scripts/sign-exe-in-zip-file.sh b/.github/scripts/sign-exe-in-zip-file.sh index a91ea7eeab..6021e41d32 100755 --- a/.github/scripts/sign-exe-in-zip-file.sh +++ b/.github/scripts/sign-exe-in-zip-file.sh @@ -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 . diff --git a/.github/scripts/sign-exe.sh b/.github/scripts/sign-exe.sh index ef2c209bde..997e3f7d35 100755 --- a/.github/scripts/sign-exe.sh +++ b/.github/scripts/sign-exe.sh @@ -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