Class GitLabHookCreator


  • public class GitLabHookCreator
    extends Object
    • Field Detail

      • LOGGER

        public static final Logger LOGGER
    • Constructor Detail

      • GitLabHookCreator

        public GitLabHookCreator()
    • Method Detail

      • createSystemHookWhenMissing

        public static void createSystemHookWhenMissing​(GitLabServer server,
                                                       com.cloudbees.plugins.credentials.common.StandardCredentials credentials)
      • getHookUrl

        public static String getHookUrl​(GitLabServer server,
                                        boolean isWebHook)
        Parameters:
        server - the GitLabServer for which the hooks URL would be created. If not null and it has a GitLabServer.getHooksRootUrl(), then the hook URL will be based on this root URL. Otherwise, the hook URL will be based on Jenkins.getRootUrl().
        isWebHook - true to get the webhook URL, false for the systemhook URL
        Returns:
        a webhook or systemhook URL
      • createWebHook

        public static org.gitlab4j.api.models.ProjectHook createWebHook()
      • createWebHookWhenMissing

        public static String createWebHookWhenMissing​(org.gitlab4j.api.GitLabApi gitLabApi,
                                                      String project,
                                                      String hookUrl,
                                                      String secretToken)
                                               throws org.gitlab4j.api.GitLabApiException
        Throws:
        org.gitlab4j.api.GitLabApiException
      • isTokenEqual

        public static boolean isTokenEqual​(String str1,
                                           String str2)