-
Notifications
You must be signed in to change notification settings - Fork 41
/
demo-pipeline.yml
52 lines (50 loc) · 1.52 KB
/
demo-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
resource_types:
- name: email
type: docker-image
source:
repository: pcfseceng/email-resource
tag: {{docker-tag}}
resources:
- name: send-an-email
type: email
source:
smtp:
host: {{smtp-host}}
port: {{smtp-port}}
username: {{smtp-username}}
password: {{smtp-password}}
from: {{email-from}}
to: [ {{email-to}} ]
jobs:
- name: send-email
plan:
- task: prep-email
config:
platform: linux
image_resource:
type: docker-image
source:
repository: concourse/buildroot
tag: git
params:
OUTPUT_SUBJECT_FILE_NAME: generated-subject
OUTPUT_BODY_FILE_NAME: generated-body
run:
path: sh
args:
- -exc
- |
# ensure you esape the ${BUILD_ID} variable with leading \
echo -e "Email resource demo on $(date): build \${BUILD_ID}" > email-out/${OUTPUT_SUBJECT_FILE_NAME}
echo -e "Cheers!\n\n \
Build ID: \${BUILD_ID} \n \
Build Name: \${BUILD_NAME} \n \
Build Job Name: \${BUILD_JOB_NAME} \n \
Build Pipeline Name: \${BUILD_PIPELINE_NAME} \n \
ATC External URL: \${ATC_EXTERNAL_URL}" > email-out/${OUTPUT_BODY_FILE_NAME}
outputs:
- name: email-out
- put: send-an-email
params:
subject: email-out/generated-subject
body: email-out/generated-body