-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathpipeline.yml
69 lines (66 loc) · 1.56 KB
/
pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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