-
-
Save kenrachynski/55b5794cae03611645b2784485ff50d7 to your computer and use it in GitHub Desktop.
groovy var
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| if "${SITE_PART}" == 'booking'; then | |
| SITE_URL="a" | |
| else | |
| SITE_URL="b" | |
| fi | |
| # Notify telegram channels about the deploy. | |
| DEPLOY_MESSAGE="<a href='${JOB_URL}'>⚙</a><a href='${BUILD_URL}'>📋</a> [<a href='http://wikipedia.com'>${PROJECT}</a>] <a href='${SITE_URL}'>[${SITE_PART}] ${REGION}</a>" | |
| #DEPLOY_MESSAGE=" <a href='${SITE_URL}'>${SITE_PART} ${REGION}</a>" | |
| curl -X POST \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{"chat_id": "${TG_CHAT_ID__TestChaT}"}' \ | |
| -d '{"text": "${DEPLOY_MESSAGE}"}' \ | |
| -d '{"disable_notification": true}' \ | |
| -d '{"disable_web_page_preview": true}' \ | |
| -d '{"parse_mode": "HTML"}' \ | |
| https://api.telegram.org/${TG_BOT_ID_TOKEN}/sendMessage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pipeline { | |
| agent any | |
| environment { | |
| PROJECT = 'myproj' | |
| SITE_PART = 'booking' | |
| TG_BOT_ID_TOKEN = credentials('bot_token') | |
| TG_CHAT_ID__TestChaT = credentials('TG_CHAT_ID__TestChaT') | |
| } | |
| options { | |
| timestamps() | |
| ansiColor('xterm') | |
| } | |
| stages { | |
| stage('Curl') { | |
| steps { | |
| sh 'deploynode.sh' | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment