123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #!groovy
- def GetLog(url) {
- def link = url.replaceAll("http://","")
- println(link)
- println(url)
- //withCredentials([string(credentialsId: 'JenkinsAPI', variable: 'TOKEN')]){
- //responce = httpRequest(httpMode: 'GET', url: 'http://admin:$TOKEN@$link/consoleText')
- return url
- //}
- }
- pipeline {
- agent {
- label 'master'
- }
- stages {
- stage("build project") {
- steps {
- sh 'go build main.go webPage.go'
- }
- }
- stage("deploy docker") {
- steps{
- sh 'docker-compose stop schedule'
- sh 'docker-compose up --build -d'
- }
- }
- }
- post {
- success {
- echo 'I succeeeded!'
-
- }
- unstable {
- echo 'I am unstable :/'
- }
- failure {
- echo 'I failed :((('
- echo GetLog("${BUILD_URL}")
- }
- changed {
- echo 'things were different before...'
- }
- }
- }
|