GithubHelp home page GithubHelp logo

isabella232 / molybdenum Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joyent/molybdenum

0.0 0.0 0.0 2.41 MB

A git repo browser (for when your git repos aren't on GitHub)

Home Page: http://trentm.com/molybdenum

License: Other

Shell 4.05% JavaScript 79.24% CSS 8.24% Makefile 1.41% HTML 7.07%

molybdenum's Introduction

Molybdenum

A github tree viewer when your repo isn't on Github (or even if it is).

molybdenum screenshot

This is a node.js server that provides a web-browsable view of your git repos. Basically, you setup post-receive hooks for notifying Molybdenum of your repo pushes and that's it.

Currently basic repo browsing (somewhat Github-esque) is supported and integration with Jira for adding ticket comments for pushes referencing Jira tickets.

We're using this internally at Joyent.

WARNING: Unfortunately, right now I don't have bandwidth to support this well for others. I'm scratching a personal itch here, and a significant chunk of hacking and duct tape is involved. Also, this is significantly under-documented.

License

MIT

Overview

TODO

post-receive hook

To tell a Molybdenum server about a push to your git repo, you'll want to add something like this to your master git repo's "hooks/post-receive" file:

MOLYBDENUM_CREDENTIALS=user:pass
MOLYBDENUM_URL=https://molybdenum.example.com
echo "Pinging Molybdenum at ${MOLYBDENUM_URL} about push."
echo '{
    "repository": {
        "url": "[email protected]:cool-product.git",
        "name": "cool-product"
    }
}' | curl --connect-timeout 2 -Ss -k -u "${MOLYBDENUM_CREDENTIALS}" \
    "${MOLYBDENUM_URL}/api/repos" -H "Content-Type: application/json" \
    -X POST -d @- >/dev/null || echo "Error telling Molybdenum. Continuing anyway."

Note: Be sure to make "hooks/post-receive" executable (commonly overlooked).

If your repo is on github (even if private), you can use something like the following as a "Post-Receive URL" in "Service Hooks" panel of your repositories admin pages:

https://user:[email protected]/api/repos

Obviously you need to adjust the URL and auth for whereever you are hosting Molybdenum.

Molybdenum post-fetch hooks

(TODO: this is slightly out of date. See the equiv section in docs/index.restdown.)

The "postFetchHooks" (global) config var is a comma-separate list of post-fetch hooks. These are either a hook name (for built-in hooks that ship with Molybdenum) or the full path to a separately installed post-fetch hook. For example:

postFetchHooks=jira,/home/mo/hooks/my-custom-post-fetch-hook

The built-in hooks are all at "tools/${NAME}-post-fetch-hook".

Each post-fetch hook is called for each branch/revision-range fetched whenever a repo is updated. They are called with the same signature as a regular git post-receive hook:

.../foo-post-fetch-hook OLDREV NEWREV REFNAME

with the addition that the "MOLYBDENUM_CONFIG" and "CONFIG" envvars are set to the full path to the Molybdenum json config file. This allows a post-fetch script to get configuration info. For example:

CONFIG=/home/mo/config/molybdenum.json \
    MOLYBDENUM_CONFIG=/home/mo/config/molybdenum.json \
    /home/mo/hooks/my-custom-post-fetch-hook ea8d8c5 8d83628 refs/heads/master

By convention a post-fetch hook needing config info should use a "${name}PostFetchHook" key in the json config file, E.g.:

...
"jiraPostFetchHook": {
    "moUrl": "https://mo.example.com",
    "jiraUrl": "https://jira.example.com/jira",
    "jiraCredentials": "somebody:somepassword",
    "jiraProjects": ["FOO", "BAR", "BAZ"],
    "branchWhitelist": ["*/master", "*/release-*", "special-repo/important-branch"],
    "branchBlacklist": []
}
...

Jira built-in post-fetch hook

This is a post-fetch hook to add a comment describing a commit to a Jira ticket if that ticket id (e.g. "PROJECTA-42") is mentioned in the commit message.

molybdenum's People

Contributors

thekvn avatar trentm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.