Skip to content

Latest commit

 

History

History
167 lines (145 loc) · 3.71 KB

README.md

File metadata and controls

167 lines (145 loc) · 3.71 KB

drone-hg

Build Status Coverage Status

Drone plugin to clone mercurial repositories. For the usage information and a listing of the available options please take a look at the docs.

Overview

This plugin is responsible for cloning mercurial repositories. It is capable of cloning a specific commit, branch, tag or pull request. The clone path is provided in the dir field.

Binary

Build the binary using make:

make deps build

Clone a commit

./drone-hg <<EOF
{
    "repo": {
        "clone_url": "https://[email protected]/drone/drone"
    },
    "build": {
        # FIXME: How does it look with hg?
        "event": "push",
        "branch": "master",
        "commit": "436b7a6e2abaddfd35740527353e78a227ddcb2c",
        "ref": "refs/heads/master"
    },
    "workspace": {
        "root": "/drone/src",
        "path": "/drone/src/bitbucket.org/drone/drone"
    }
}
EOF

Clone a pull request

./drone-hg <<EOF
{
    "repo": {
        "clone_url": "https://[email protected]/drone/drone"
    },
    "build": {
        # FIXME: How does it look with hg?
        "event": "pull_request",
        "branch": "master",
        "commit": "8d6a233744a5dcacbf2605d4592a4bfe8b37320d",
        "ref": "refs/pull/892/merge"
    },
    "workspace": {
        "root": "/drone/src",
        "path": "/drone/src/bitbucket.org/drone/drone"
    }
}
EOF

Clone a tag

./drone-hg <<EOF
{
    "repo": {
        "clone_url": "https://[email protected]/drone/drone"
    },
    "build": {
        # FIXME: How does it look with hg?
        "event": "tag",
        "branch": "master",
        "commit": "339fb92b9629f63c0e88016fffb865e3e1055483",
        "ref": "refs/tags/v0.2.0"
    },
    "workspace": {
        "root": "/drone/src",
        "path": "/drone/src/bitbucket.org/drone/drone"
    }
}
EOF

Docker

Build the container using make:

make deps docker

Clone a commit

docker run -i plugins/drone-hg <<EOF
{
    "repo": {
        "clone_url": "https://[email protected]/drone/drone"
    },
    "build": {
        # FIXME: How does it look with hg?
        "event": "push",
        "branch": "master",
        "commit": "436b7a6e2abaddfd35740527353e78a227ddcb2c",
        "ref": "refs/heads/master"
    },
    "workspace": {
        "root": "/drone/src",
        "path": "/drone/src/bitbucket.org/drone/drone"
    }
}
EOF

Clone a pull request

docker run -i plugins/drone-hg <<EOF
{
    "repo": {
        "clone_url": "https://[email protected]/drone/drone"
    },
    "build": {
        # FIXME: How does it look with hg?
        "event": "pull_request",
        "branch": "master",
        "commit": "8d6a233744a5dcacbf2605d4592a4bfe8b37320d",
        "ref": "refs/pull/892/merge"
    },
    "workspace": {
        "root": "/drone/src",
        "path": "/drone/src/bitbucket.org/drone/drone"
    }
}
EOF

Clone a tag

docker run -i plugins/drone-hg <<EOF
{
    "repo": {
        "clone_url": "https://[email protected]/drone/drone"
    },
    "build": {
        # FIXME: How does it look with hg?
        "event": "tag",
        "branch": "master",
        "commit": "339fb92b9629f63c0e88016fffb865e3e1055483",
        "ref": "refs/tags/v0.2.0"
    },
    "workspace": {
        "root": "/drone/src",
        "path": "/drone/src/bitbucket.org/drone/drone"
    }
}
EOF