Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Add aliases for the remotes expected by the merge script (if you haven't already):

    Code Block
    languagebash
    $ cd $ZOOKEPER_BASE_DIR
    $ git remote add apache-github https://github.com/apache/zookeeper.git
    $ git remote add apache https://git-wip-us.apache.org/repos/asf/zookeeper.git


    You can easily checkout pull requests using the following. Here I'm fetching pull #9 and creating a local "pr/9" branch.

    Code Block
    $ git fetch apache-github  pull/9/head:pr/9

    However you can also (instead of the fetch above - this part is optional) add the following refspec as a shortcut

    Code Block
    $ git config --add remote.apache-github.fetch '+refs/pull/*/head:refs/remotes/apache-github/pr/*'

    after which:

    Code Block
    $ git fetch apache-github

    and then just:

    Code Block
    $ git checkout pr/9
  2. Before starting using the script it’s required to setup environment variables below:

    PR_REMOTE_NAME - points to Github mirror of Apache project (default git-remote name: apache-github)

    PUSH_REMOTE_NAME - points to Apache Git repo (default git-remote name: apache)

    Code Block
    languagebash
    $ export PR_REMOTE_NAME=apache-github
    $ export PUSH_REMOTE_NAME=apache
  3. Install jira-python: 

    Code Block
    languagebash
    sudo easy_install jira

    Or 

    Code Block
    languagebash
    sudo pip install jira



  4. Setup environment variables to JIRA credentials:

    JIRA_USERNAME & JIRA_PASSWORD - apache JIRA credentials

     

    Code Block
    languagebash
    $ export JIRA_USERNAME=myname
    $ export JIRA_PASSWORD=mypassword

     

    If you don't execute steps 3 and 4 then the script will not be able to automatically close the JIRA after merging the PR.

     

  5. (Optional) Setup Github OAUTH token:

    GITHUB_OAUTH_KEY  (optional) - if you exceed Github API rate limit then set this variable to allow it to surpass this limit as the script comment states:

     

    Code Block
    languagebash
    $ export GITHUB_OAUTH_KEY=<your-github-oauth-key>

    “OAuth key used for issuing requests against the GitHub API. If this is not defined, then requests will be unauthenticated. You should only need to configure this if you find yourself regularly exceeding your IP's unauthenticated request rate limit. You can create an OAuth key at https://github.com/settings/tokens. This script only requires the "public_repo" scope.”

...