This documentation is for WSO2 Stratos 2.0.0. View the latest Apache Stratos documentation.
Configuring a Git Server - Stratos 2.0.0 - WSO2 Documentation
Skip to end of metadata
Go to start of metadata
  1. Download Gitblit from  

  2. Upload the zip file to the relevant machine.

  3. Unzip and open the configuration guide data/

  4. Set the server.httpPort and server.httpsPort ports to any suitable available ports and make sure that they are open to outside access.
    server.httpPort = 8280   and server.httpsPort = 8443 .

    The properties  server.httpBindInterface  and  server.httpsBindInterface  should be empty.

  5. Navigate to the parent directory and run the following command:

    java -jar gitblit.jar --baseFolder data 

    Now you can access the gitblit server from <machine ip>:<http port>. For a complete setup guide go to

  6. Create a repository.
  7. Add a user to the repository. 
    Click on the repository name to obtain the
    URL of the repository.
    Git repo url: . is the IP of the instance.
    8080 is the http port

    Currently only http external Git repository URLs are supported and the URL should not contain the username.

  8. Initialize the repository by cloning it into your local machine, add an initial commit and push it to the repository.
    See the README.txt file for an example. If the repository is not cloned, the pull commands will fail.

Adding a post commit hook

A post commit hook should be added to the Git repository to notify commit events to Stratos Controller. Gitblit supports groovy scripts for execution after an artifact is pushed to the repository.

  1. Open data/ and add the following:

    groovy.scriptsFolder = <path_to_folder_with_script>

    This folder should contain groovy script with the .groovy extension.

  2. Add the script name to groovy.postRecieveScripts.
    This will add scripts common to all repositories.

    groovy.postRecieveScripts = <name_of_script>

  3. If you wish to add a repository specific scripts:
    For more details go to and see the Groovy Hook Scripts section .

    • Remove the entry from groovy.postRecieveScripts  

    • On the E dit Repository menu, click Hook Scripts.

    • S elect the relevant script.    
      The script should contain a curl call with the repository URL to the repository notification service in Stratos Controller.

      Sample script:

      #!/usr/bin/env groovy
      def response = "curl -k -X POST -d payload={'repository':{'url':''}}".execute().text
      println response

      Argument Description

      Allows insecure SSL connections and transfers.
      Specifies a custom request method which in this case is POST
      -d The data to be sent with the request.
       format string which includes the repository URL.


      The following is the POST end point reference for the repository notification service

  • No labels