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.

69 lines
1.6 KiB

7 years ago
  1. resource_types:
  2. - name: artifactory
  3. type: docker-image
  4. source:
  5. repository: pivotalservices/artifactory-resource
  6. resources:
  7. - name: file-repository
  8. type: artifactory
  9. check_every: 1m
  10. source:
  11. endpoint: http://ARTIFACTORY-HOST-NAME-GOES-HERE:8081/artifactory
  12. repository: "/repository-name/sub-folder"
  13. regex: "myapp-(?<version>.*).txt"
  14. username: YOUR-ARTIFACTORY-USERNAME
  15. password: YOUR-ARTIFACTORY-PASSWORD
  16. jobs:
  17. - name: build-and-save-to-artifactory
  18. serial: true
  19. public: true
  20. plan:
  21. - task: build-file
  22. config:
  23. platform: linux
  24. image_resource:
  25. type: docker-image
  26. source:
  27. repository: ubuntu
  28. tag: "latest"
  29. outputs:
  30. - name: build
  31. run:
  32. path: sh
  33. args:
  34. - -exc
  35. - |
  36. export DATESTRING=$(date +"%Y%m%d")
  37. echo "This is my file" > ./build/myapp-$(date +"%Y%m%d%H%S").txt
  38. find .
  39. - put: file-repository
  40. params: { file: ./build/myapp-*.txt }
  41. - name: trigger-when-new-file-is-added-to-artifactory
  42. serial: true
  43. public: true
  44. plan:
  45. - get: file-repository
  46. trigger: true
  47. passed:
  48. - build-and-save-to-artifactory
  49. - task: use-new-file
  50. config:
  51. platform: linux
  52. image_resource:
  53. type: docker-image
  54. source:
  55. repository: ubuntu
  56. tag: "latest"
  57. inputs:
  58. - name: file-repository
  59. run:
  60. path: sh
  61. args:
  62. - -exc
  63. - |
  64. export DATESTRING=$(date +"%Y%m%d")
  65. ls -la file-repository
  66. cat ./file-repository/myapp*.txt