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
69 lines
1.6 KiB
resource_types:
|
|
- name: artifactory
|
|
type: docker-image
|
|
source:
|
|
repository: pivotalservices/artifactory-resource
|
|
|
|
resources:
|
|
- name: file-repository
|
|
type: artifactory
|
|
check_every: 1m
|
|
source:
|
|
endpoint: http://ARTIFACTORY-HOST-NAME-GOES-HERE:8081/artifactory
|
|
repository: "/repository-name/sub-folder"
|
|
regex: "myapp-(?<version>.*).txt"
|
|
username: YOUR-ARTIFACTORY-USERNAME
|
|
password: YOUR-ARTIFACTORY-PASSWORD
|
|
|
|
jobs:
|
|
- name: build-and-save-to-artifactory
|
|
serial: true
|
|
public: true
|
|
plan:
|
|
- task: build-file
|
|
config:
|
|
platform: linux
|
|
image_resource:
|
|
type: docker-image
|
|
source:
|
|
repository: ubuntu
|
|
tag: "latest"
|
|
outputs:
|
|
- name: build
|
|
run:
|
|
path: sh
|
|
args:
|
|
- -exc
|
|
- |
|
|
export DATESTRING=$(date +"%Y%m%d")
|
|
echo "This is my file" > ./build/myapp-$(date +"%Y%m%d%H%S").txt
|
|
find .
|
|
- put: file-repository
|
|
params: { file: ./build/myapp-*.txt }
|
|
|
|
- name: trigger-when-new-file-is-added-to-artifactory
|
|
serial: true
|
|
public: true
|
|
plan:
|
|
- get: file-repository
|
|
trigger: true
|
|
passed:
|
|
- build-and-save-to-artifactory
|
|
- task: use-new-file
|
|
config:
|
|
platform: linux
|
|
image_resource:
|
|
type: docker-image
|
|
source:
|
|
repository: ubuntu
|
|
tag: "latest"
|
|
inputs:
|
|
- name: file-repository
|
|
run:
|
|
path: sh
|
|
args:
|
|
- -exc
|
|
- |
|
|
export DATESTRING=$(date +"%Y%m%d")
|
|
ls -la file-repository
|
|
cat ./file-repository/myapp*.txt
|