Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jenkins Pipepline syntax #7

Closed
sschueller opened this issue Oct 26, 2018 · 4 comments
Closed

Jenkins Pipepline syntax #7

sschueller opened this issue Oct 26, 2018 · 4 comments

Comments

@sschueller
Copy link

sschueller commented Oct 26, 2018

How do I send a message to Zulip in a Jenkins Pipeline (Jenkinsfile) ? For example this is how I would do it with hipchat (https://github.com/jenkinsci/hipchat-plugin):

pipeline {
  agent any
  stages {
    stage('Notify Start') {
      steps {
        hipchatSend(color: 'GRAY', message: "<a href=\"${RUN_DISPLAY_URL}\">Web Job ${env.BUILD_NUMBER} on ${env.BRANCH_NAME} started</a>")
      }
    }
    stage('Automated Tests') {
      steps {
        sh '''# my tests
            '''
        junit 'tests/_output/run'
      }
      post {
        unstable {
          hipchatSend(color: 'RED', notify: true, message: "<a href=\"${RUN_DISPLAY_URL}\">Some tests in web job ${env.BUILD_NUMBER} on ${env.BRANCH_NAME} failed</a>")

        }
        success {
          hipchatSend(color: 'GREEN', notify: false, message: "<a href=\"${RUN_DISPLAY_URL}\">All tests in web job ${env.BUILD_NUMBER} on ${env.BRANCH_NAME} passed</a>")
        }
      }
    }
    stage('Build and Release') {
      when {
        tag 'release_*'
      }
      post {
        failure {
          hipchatSend(color: 'RED', notify: true, message: "<a href=\"${RUN_DISPLAY_URL}\">Build web job ${env.BUILD_NUMBER} on ${env.BRANCH_NAME} failed</a>")

        }

      }
      steps {
        sh "# build"
      } 
    }
    stage('Notify Deployment') {
      when {
        tag 'release_*'
      }
      steps {
        hipchatSend(color: 'GREEN', notify: false, message: "Web Job ${env.BRANCH_NAME} deployed")
      }
    }
  }
}

I also noticed that the Zulip plugin is not showing as an option in the blueocean pipeline editor so maybe this is not supported?

@timabbott
Copy link

@sschueller I suspect this is not supported with the current plugin.

@timabbott
Copy link

(Let me see about getting someone to work on improving this)

@timabbott
Copy link

@sschueller I believe #8 should have resolved at least parts of this; can you take a look?

@timabbott
Copy link

@butchyyyy confirmed that this is fixed via #8, so closing. Thanks again for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants