Closed ibrahim-alzant closed 7 years ago
You should access hipchat plugin and set you settings...I am currently still working on this script and Notification message configs are not yet ready. I post here what was working for me
import jenkins.*
import jenkins.model.*
import hudson.model.*
import java.util.logging.Logger
import com.cloudbees.plugins.credentials.impl.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.domains.*
import hudson.util.Secret
import jenkins.plugins.hipchat.model.*
import org.jenkinsci.plugins.plaincredentials.impl.*
import jenkins.plugins.hipchat.model.notifications.Notification.Color
uuid = java.util.UUID.randomUUID().toString()
secret = new Secret("{{ hipchat_secret }}")
c = new StringCredentialsImpl(CredentialsScope.GLOBAL, uuid, "{{ hipchat_credential_description }}", secret)
SystemCredentialsProvider.getInstance().getStore().addCredentials(Domain.global(), c)
def inst = Jenkins.getInstance()
def desc = inst.getDescriptor("jenkins.plugins.hipchat.HipChatNotifier")
desc.setServer("{{ hipchat_api_server }}")
desc.setCredentialId(uuid)
desc.setRoom("{{ hipchat_room_id }}")
desc.setV2Enabled(true)
worked like a charm, Thanks!
you are wecome ;)
I initialise my Jenkins through initialisation script under (init.groovy.d) which bootstrap the Jenkins and install the plugins along with configuring them. I was wondering how can configure hipchat plugin in the same way setting up the token, server ... etc.