API - ArchCI/archci GitHub Wiki

Webhooks

POST /hooks

Account

Create

POST /account

Request

{   username: "wizawu",
    password: "123456",
    email: "[email protected]"
}

Response

{   id: 1
}

Login

POST /login

Request

{   username: "wizawu",
    password: "123456"
}

Get Login Information

GET /login

Request

{   id: 1,
    username: "wizawu",
    email: "[email protected]"
}

Builds

Get Active Builds

GET /builds/active

Search Builds

GET /builds/search

Request

{   keyword: "archci"
}

Get Build Logs

GET /builds/:id/log
GET /builds/:id/log/:partId

Response

{   log: "apt-get install golang",
    last: 10    // optional
}

Projects

Add A New Project

POST /projects

Request

{   type: "github" | "gitlab" | ... ,
    public: true | false,
    url: "[email protected]:ArchCI/archci.git"
}

Get All Projects

GET /projects

Response

 [
        {   id: 1
            type: "github",
            owner: "wizawu",
            repository: "archici",
            description: "Hello",
            domain: "github.com"
        },
        ...
    ]

Images

Create A Image

POST /images

Request

{   name: "debian-mysql",
    dockerfile: "apt-get install -y mysql"
}

Get Image List

GET /images

Response

[
        {   id: 1,
            name: "debian",
            size: 517233948,
            dockerfile: "go version",
            created: "2015-05-01T00:59:53.889834584Z",
            url: "hub.archci.com/debian"
        },
        ...
    ]

Get Image Information

GET /images/:id

Response

{   id: 1,
    name: "debian",
    size: 517233948,
    dockerfile: "go version",
    created: "2015-05-01T00:59:53.889834584Z",
    url: "hub.archci.com/debian"
}

Workers

Get A Task

GET /tasks

Response

[{
    "id": 123,    // Task ID
    login: "wizawu",    // optional
    token: "67c38b2c25b8ec20ca373df176f217826c1acb80",    // optional
    type: "none" | "github" | ... ,
    public: true,
    project: archci
    url: "[email protected]:ArchCI/archci.git",
    commit: "ccf4d8b385117aab1e30b46bfa0d887f621b9423"
}]

Parameters

number

GET /tasks?number=1 will return one task.

http://stackoverflow.com/questions/10046027/having-trouble-downloading-git-archive-tarballs-from-private-repo

Finish A Task

PUT /tasks/:id

Request

{    status: 0
}

Get Worker List

GET /workers

Response

[   {   ip: "192.168.1.0",
         busy: true,
         contacted: "2015-06-06T07:28:08.375Z"
    },
    ...
]