Guest User

Untitled

a guest
Nov 13th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. stage('Test the 500 log URLs') {
  2. steps {
  3. script {
  4. echo 'Testing the URLs from the 500 error access log...'
  5. sh '''#!/bin/bash
  6. while IFS= read -r line; do
  7. URL=`echo $line | awk '{print $2}' | sed 's/http:/https:/' `
  8. RESULT=`curl -LI $URL -o /dev/null -w "%{http_code}n" -s | tr -d '[:space:]' `
  9. if [[ $RESULT != "200" ]]
  10. then
  11. echo "$RESULT $URL"
  12. fi
  13. done < tests/Smoke/logs_testing/500errors.txt
  14. '''
  15. }
  16. }
  17. }
  18.  
  19. URL=`echo $line | awk '{print $2}' | sed 's/http:/https:/' `
  20.  
  21. RESULT=`curl -LI $URL -o /dev/null -w "%{http_code}n" -s | tr -d '[:space:]' `
  22.  
  23. line 4: curl: command not found
  24.  
  25. $ which curl
  26. /usr/somelocation/curl # <- just an example
  27.  
  28. RESULT=`/usr/somelocation/curl -LI $URL...`
  29.  
  30. export PATH=$PATH:/usr/somelocation/
Add Comment
Please, Sign In to add comment