You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.0 KiB

8 years ago
  1. #!/bin/bash
  2. # before running these tests, set the following env vars:
  3. # export ART_IP=<ip-or-domain-of-artifactory-server>
  4. # export ART_USER=<artifactory-username>
  5. # export ART_PWD=<artifactory-password>
  6. # sample curl commands for artifactory API
  7. # curl -u $ART_USER:$ART_PWD -X PUT "http://host:8081/artifactory/path-to-file" -T ./local-path-to-file
  8. # Artifactory docker image: https://www.jfrog.com/confluence/display/RTF/Running+with+Docker
  9. set -e
  10. source $(dirname $0)/helpers.sh
  11. it_can_list_releases_from_artifactory() {
  12. # local local_ip=$(find_docker_host_ip)
  13. #local_ip="localhost"
  14. artifactory_ip=$ART_IP
  15. TMPDIR=/tmp
  16. local src=$(mktemp -d $TMPDIR/in-src.XXXXXX)
  17. local endpoint="http://${artifactory_ip}:8081/artifactory"
  18. local regex="ecd-front-(?<version>.*).tar.gz"
  19. local folder="/generic/ecd-front"
  20. check_without_credentials_and_version $endpoint $regex $folder $src
  21. }
  22. it_can_list_releases_from_artifactory_with_version() {
  23. # local local_ip=$(find_docker_host_ip)
  24. #local_ip="localhost"
  25. artifactory_ip=$ART_IP
  26. TMPDIR=/tmp
  27. local src=$(mktemp -d $TMPDIR/in-src.XXXXXX)
  28. local endpoint="http://${artifactory_ip}:8081/artifactory"
  29. local regex="ecd-front-(?<version>.*).tar.gz"
  30. local folder="/generic/ecd-front"
  31. local version="20161109222826"
  32. check_without_credentials_with_version $endpoint $regex $folder $version $src
  33. }
  34. it_can_list_releases_from_protected_artifactory_with_version() {
  35. # local local_ip=$(find_docker_host_ip)
  36. #local_ip="localhost"
  37. artifactory_ip=$ART_IP
  38. TMPDIR=/tmp
  39. local src=$(mktemp -d $TMPDIR/in-src.XXXXXX)
  40. local endpoint="http://${artifactory_ip}:8081/artifactory"
  41. local regex="ecd-front-(?<version>.*).tar.gz"
  42. local folder="/generic/ecd-front"
  43. local version="20161109222826"
  44. local username="${ART_USER}"
  45. local password="${ART_PWD}"
  46. check_with_credentials_with_version $endpoint $regex $username $password $folder $version $src
  47. }
  48. run it_can_list_releases_from_artifactory
  49. run it_can_list_releases_from_artifactory_with_version
  50. run it_can_list_releases_from_protected_artifactory_with_version