1
0

jenkins 630 B

1234567891011121314151617181920212223242526
  1. def file = 'Dockerfile'
  2. def context = readfile(file).trim()
  3. def sendMessage(message){
  4. def encode = URLEncoder.encode(message,"UTF-8")
  5. withCredentials([string(credentialsId: 'TGBot', variable: 'SECRET')]) {
  6. responce = httpRequest(ConsoleLogResponceBody: true,
  7. contentType: 'APPLICATION_JSON',
  8. httpMode: 'GET',
  9. url: "https://api.telegram.org/bot$SECRET/sendMessage?text=$encode&chat_id=-1001282104904&disable_web_page_preview=true",
  10. validResponceCodes: '200')
  11. return responce
  12. }
  13. }
  14. pipeline {
  15. agent any
  16. stages {
  17. stage('Hello') {
  18. steps {
  19. sendMessage($context)
  20. }
  21. }
  22. }
  23. }