8 project
= os
.environ
["P_PROJECT"]
9 url
= os
.environ
["P_WEBHOOK"]
10 version
= os
.environ
["P_VERSION"]
11 host
= os
.environ
["P_HOST"]
12 if os
.environ
["P_HTTPS"] == "true":
18 urllib3
.disable_warnings()
19 http
= urllib3
.PoolManager()
21 encoded
= data
.encode('utf-8')
23 r
= http
.request("POST", url
,
24 headers
={'Content-Type': 'application/json'}
,
29 "icon_url": "https://learn.puppet.com/static/images/logos/Puppet-Logo-Mark-Amber.png",
30 "text": "Deployed {} of {} on {}{}".format(
38 json_data
= json
.dumps(data
)