Skip to content

Commit

Permalink
Make sign artifact lib output clear msgs on utility versions (#2201)
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
  • Loading branch information
peterzhuamazon authored Jun 15, 2022
1 parent 48701ef commit 5209fd8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
18 changes: 9 additions & 9 deletions tests/jenkins/jobs/AssembleManifest_rpm_Jenkinsfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@

echo "------------------------------------------------------------------------"
echo "Check Utility Versions"
gpg_version_limit="2.2.0"
rpm_version_limit="4.13.0" # https://bugzilla.redhat.com/show_bug.cgi?id=227632
gpg_version_requirement="2.2.0"
rpm_version_requirement="4.13.0" # https://bugzilla.redhat.com/show_bug.cgi?id=227632

gpg_version_check=`gpg --version | head -n 1 | grep -oE '[0-9.]+'`
gpg_version_check_final=`echo $gpg_version_check $gpg_version_limit | tr ' ' '
gpg_version_check_final=`echo $gpg_version_check $gpg_version_requirement | tr ' ' '
' | sort -V | head -n 1`
rpm_version_check=`rpm --version | head -n 1 | grep -oE '[0-9.]+'`
rpm_version_check_final=`echo $rpm_version_check $rpm_version_limit | tr ' ' '
rpm_version_check_final=`echo $rpm_version_check $rpm_version_requirement | tr ' ' '
' | sort -V | head -n 1`

echo -e "gpg_version_limit gpg_version_check"
echo -e "$gpg_version_limit $gpg_version_check_final"
echo -e "rpm_version_limit rpm_version_check"
echo -e "$rpm_version_limit $rpm_version_check_final"
echo -e "gpg_version_requirement gpg_version_check"
echo -e "$gpg_version_requirement $gpg_version_check"
echo -e "rpm_version_requirement rpm_version_check"
echo -e "$rpm_version_requirement $rpm_version_check"

if [[ $gpg_version_limit = $gpg_version_check_final ]] && [[ $rpm_version_limit = $rpm_version_check_final ]]; then
if [[ $gpg_version_requirement = $gpg_version_check_final ]] && [[ $rpm_version_requirement = $rpm_version_check_final ]]; then
echo "Utility version is equal or greater than set limit, continue."
else
echo "Utility version is lower than set limit, exit 1"
Expand Down
18 changes: 9 additions & 9 deletions tests/jenkins/jobs/SignArtifacts_Jenkinsfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@

echo "------------------------------------------------------------------------"
echo "Check Utility Versions"
gpg_version_limit="2.2.0"
rpm_version_limit="4.13.0" # https://bugzilla.redhat.com/show_bug.cgi?id=227632
gpg_version_requirement="2.2.0"
rpm_version_requirement="4.13.0" # https://bugzilla.redhat.com/show_bug.cgi?id=227632

gpg_version_check=`gpg --version | head -n 1 | grep -oE '[0-9.]+'`
gpg_version_check_final=`echo $gpg_version_check $gpg_version_limit | tr ' ' '
gpg_version_check_final=`echo $gpg_version_check $gpg_version_requirement | tr ' ' '
' | sort -V | head -n 1`
rpm_version_check=`rpm --version | head -n 1 | grep -oE '[0-9.]+'`
rpm_version_check_final=`echo $rpm_version_check $rpm_version_limit | tr ' ' '
rpm_version_check_final=`echo $rpm_version_check $rpm_version_requirement | tr ' ' '
' | sort -V | head -n 1`

echo -e "gpg_version_limit gpg_version_check"
echo -e "$gpg_version_limit $gpg_version_check_final"
echo -e "rpm_version_limit rpm_version_check"
echo -e "$rpm_version_limit $rpm_version_check_final"
echo -e "gpg_version_requirement gpg_version_check"
echo -e "$gpg_version_requirement $gpg_version_check"
echo -e "rpm_version_requirement rpm_version_check"
echo -e "$rpm_version_requirement $rpm_version_check"

if [[ $gpg_version_limit = $gpg_version_check_final ]] && [[ $rpm_version_limit = $rpm_version_check_final ]]; then
if [[ $gpg_version_requirement = $gpg_version_check_final ]] && [[ $rpm_version_requirement = $rpm_version_check_final ]]; then
echo "Utility version is equal or greater than set limit, continue."
else
echo "Utility version is lower than set limit, exit 1"
Expand Down
18 changes: 9 additions & 9 deletions vars/signArtifacts.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ void call(Map args = [:]) {
echo "------------------------------------------------------------------------"
echo "Check Utility Versions"
gpg_version_limit="2.2.0"
rpm_version_limit="4.13.0" # https://bugzilla.redhat.com/show_bug.cgi?id=227632
gpg_version_requirement="2.2.0"
rpm_version_requirement="4.13.0" # https://bugzilla.redhat.com/show_bug.cgi?id=227632
gpg_version_check=`gpg --version | head -n 1 | grep -oE '[0-9.]+'`
gpg_version_check_final=`echo \$gpg_version_check \$gpg_version_limit | tr ' ' '\n' | sort -V | head -n 1`
gpg_version_check_final=`echo \$gpg_version_check \$gpg_version_requirement | tr ' ' '\n' | sort -V | head -n 1`
rpm_version_check=`rpm --version | head -n 1 | grep -oE '[0-9.]+'`
rpm_version_check_final=`echo \$rpm_version_check \$rpm_version_limit | tr ' ' '\n' | sort -V | head -n 1`
rpm_version_check_final=`echo \$rpm_version_check \$rpm_version_requirement | tr ' ' '\n' | sort -V | head -n 1`
echo -e "gpg_version_limit gpg_version_check"
echo -e "\$gpg_version_limit \$gpg_version_check_final"
echo -e "rpm_version_limit rpm_version_check"
echo -e "\$rpm_version_limit \$rpm_version_check_final"
echo -e "gpg_version_requirement gpg_version_check"
echo -e "\$gpg_version_requirement \$gpg_version_check"
echo -e "rpm_version_requirement rpm_version_check"
echo -e "\$rpm_version_requirement \$rpm_version_check"
if [[ \$gpg_version_limit = \$gpg_version_check_final ]] && [[ \$rpm_version_limit = \$rpm_version_check_final ]]; then
if [[ \$gpg_version_requirement = \$gpg_version_check_final ]] && [[ \$rpm_version_requirement = \$rpm_version_check_final ]]; then
echo "Utility version is equal or greater than set limit, continue."
else
echo "Utility version is lower than set limit, exit 1"
Expand Down

0 comments on commit 5209fd8

Please sign in to comment.