Uploaded image for project: 'Qt Cloud'
  1. Qt Cloud
  2. CLOUD-14

Gitlab API and wrappers

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • P2: Important
    • None
    • None
    • General

    Description

      Related to #3.

      We are using `python-gitlab` package to interact with Gitlab APIs. When required, we are also directly using the REST APIs.

      `pip install python-gitlab`

      Example code:

      ```
      import gitlab
      tunnel_url = <get tunnel url from ngrok wrapper>

      g_obj = gitlab.Gitlab(gitlab_url, private_token=private_token)
      g_project = g_obj.projects.get(project_path)
      g_project_id = g_project.get_id()

      hook_params = {'push_events': True, 'pipeline_events': True, 'enable_ssl_verification': True, 'job_events': True, 'issue_events': True}
      hook_params['url'] = "{0}/random-number-gitlab-incoming".format(tunnel_url)
      hook_params['token'] = hashlib.sha1("some random text or url").hexdigest())

      g_webhook = g_project.hooks.create (hook_params)
      ```

      All relevant gitlab tasks or issues should be tracked under this.

      Attachments

        Activity

          People

            as33ms Aseem Shakuntal
            anttisiukola Antti Siukola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: