{"id":13680614,"url":"https://github.com/duck8823/duci","last_synced_at":"2025-04-30T00:30:35.824Z","repository":{"id":31336772,"uuid":"127587125","full_name":"duck8823/duci","owner":"duck8823","description":"The simple ci server ","archived":true,"fork":false,"pushed_at":"2023-02-27T00:37:49.000Z","size":1236,"stargazers_count":75,"open_issues_count":10,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-11T23:37:36.653Z","etag":null,"topics":["ci","docker","github","golang","moby"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/duck8823.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-04-01T01:51:02.000Z","updated_at":"2024-05-18T09:20:32.000Z","dependencies_parsed_at":"2024-02-06T01:33:42.080Z","dependency_job_id":null,"html_url":"https://github.com/duck8823/duci","commit_stats":null,"previous_names":["duck8823/minimal-ci"],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duck8823%2Fduci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duck8823%2Fduci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duck8823%2Fduci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duck8823%2Fduci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duck8823","download_url":"https://codeload.github.com/duck8823/duci/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251607260,"owners_count":21616728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","docker","github","golang","moby"],"created_at":"2024-08-02T13:01:19.217Z","updated_at":"2025-04-30T00:30:34.477Z","avatar_url":"https://github.com/duck8823.png","language":"Go","funding_links":[],"categories":["Continuous Integration","持续集成","Uncategorized","持续集成`持续集成的辅助工具`"],"sub_categories":["Standard CLI","Advanced Console UIs","标准CLI","标准 CLI"],"readme":"# duci\n![Language](https://img.shields.io/badge/language-go-74CCDC.svg) ![GitHub release](https://img.shields.io/github/release/duck8823/duci.svg?colorB=7E7E7E) [![GoDoc](https://godoc.org/github.com/duck8823/duci?status.svg)](https://godoc.org/github.com/duck8823/duci) [![Build Status](https://travis-ci.org/duck8823/duci.svg?branch=master)](https://travis-ci.org/duck8823/duci) [![Coverage Status](https://coveralls.io/repos/github/duck8823/duci/badge.svg?branch=master)](https://coveralls.io/github/duck8823/duci?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/duck8823/duci)](https://goreportcard.com/report/github.com/duck8823/duci) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)\n\nduci \\[zushi\\] (Docker Under Continuous Integration) is a simple ci server.  \n \n\n## DSL is Unnecessary For CI\nLet's define the task in the task runner.  \nLet's define the necessary infrastructure for the task in the Dockerfile.  \nduci just only execute the task in docker container.  \n\n## Features\n- Execute the task in Docker container\n- Execute the task triggered by GitHub pull request comment or push \n- Execute tasks asynchronously\n- Create GitHub commit status\n- Store and Show logs\n\n## How to use\n### Target Repository\nThe target repository must have Dockerfile in repository root or `.duci/Dockerfile`.  \nIf there is `.duci/Dockerfile`, duci read it preferentially.  \n  \nIn Dockerfile, I suggest to use `ENTRYPOINT`.\n\ne.g.\n```Dockerfile\nENTRYPOINT [\"mvn\"]\nCMD [\"compile\"]\n```\n\n```Dockerfile\nENTRYPOINT [\"fastlane\"]\nCMD [\"build\"]\n```\n\nWhen push to github, duci execute `mvn compile` / `fastlane build`.  \nAnd when comment `ci test` on github pull request, execute `mvn test` / `fastlane test`.  \n\n### Using host environment variables\nIf exists `ARG` instruction in `Dockerfile`, override value from host environment variable.  \n\n```Dockerfile\nARG FOO=default\nARG BAR\n```\n\nand you can use as envrionment variable in command.\n\n```Dockerfile\nARG FOO=default\nENV FOO=$FOO\n```\n\n\n### Runtime configuration\n#### volumes\nYou can use volumes options for external dependency, cache and etc.  \nSet configurations in `.duci/config.yml`  \n\n```yaml\nvolumes:\n  - '/path/to/host/dir:/path/to/container/dir'\n```\n\n#### environment variable\nYou can set environment variables in docker container.  \nAdd the following to `.duci/config.yml`\n\n```yaml\nenvironments:\n  - ENVIRONMENT_VAIRABLE=value\n```\n\n## Server Settings\n### Installation\n```sh \n# binary will be $(go env GOPATH)/bin/duci\ncurl -sfL https://raw.githubusercontent.com/duck8823/duci/master/install.sh | sh -s -- -b $(go env GOPATH)/bin\nduci version\n```\n\nYou can also install a specific version. (replace `vX.Y.Z` with the specific version from the [releases page](https://github.com/duck8823/duci/releases)):\n\n```sh \n# binary will be $(go env GOPATH)/bin/duci\ncurl -sfL https://raw.githubusercontent.com/duck8823/duci/master/install.sh | sh -s -- -b $(go env GOPATH)/bin vX.Y.Z\nduci version\n```\n\n### Setting SSH (optional)\nIf target repository is private, You can use SSH key to clone repository from github.com.  \nPlease set the public key of the pair at https://github.com/settings/keys.\n\n### Add Webhooks to Your GitHub repository\nduci start to listen webhook with port `8080` (default) and endpoint `/`.  \nIn GitHub target repository settings (`https://github.com/\u003cowner\u003e/\u003crepository\u003e/settings/hooks`),\nAdd endpoint of duci to `Payload URL` and `application/json` to `Content type` respectively.\n\n### Run Server\n```bash\n$ duci server\n```\n\n### Server Configuration file\nYou can specify configuration file with `-c` option.\nThe configuration file must be yaml format.\nPossible values ​​are as follows.\n\n```yaml\nserver:\n  workdir: '/path/to/tmp/duci'\n  port: 8080\n  database_path: '$HOME/.duci/db'\ngithub:\n  # (optional) You can use SSH key to clone. ex. '${HOME}/.ssh/id_rsa'\n  ssh_key_path: ''\n  # For create commit status. You can also use environment variable\n  api_token: ${GITHUB_API_TOKEN}\njob:\n  timeout: 600\n  concurrency: 4 # default is number of cpu\n```\n\nYou can check the configuration values.\n\n```bash\n$ duci config\n```\n\n## Using Docker\nYou can use Docker to run server.\n```\n$ docker run -p 8080:8080 \\\n             -e GITHUB_API_TOKEN=\u003cyour toekn\u003e \\\n             -v /var/run/docker.sock:/var/run/docker.sock \\\n             duck8823/duci\n```\n\nWhen you want to clone with SSH in container,\n```\n$ docker run -p 8080:8080 \\\n             -e GITHUB_API_TOKEN=\u003cyour toekn\u003e \\\n             -e SSH_KEY_PATH=/root/.ssh/id_rsa \\\n             -v ~/.ssh:/root/.ssh:ro \\ \n             -v /var/run/docker.sock:/var/run/docker.sock \\\n             duck8823/duci\n```\n\n## Run with docker-compose\nWith docker-compose, you can also start ui and reverse proxy together.\n\n```bash\n$ git clone https://github.com/duck8823/duci.git\n$ cd duci\n$ docker-compose up -d\n```\n\nIf you start up on another host, set your host name (default: `localhost`) to environment variable `DUCI_HOST`.\n\n## Read job log\nGitHub send payload as webhook including `X-GitHub-Delivery` header.  \nYou can read job log with the `X-GitHub-Delivery` value formatted UUID.\n\n```bash\n$ curl -XGET http://localhost:8080/logs/{X-GitHub-Delivery}\n```\n\nThe endpoint returns NDJSON (Newline Delimited JSON) formatted log.\n\n```jsons\n{\"time\":\"2018-09-21T22:19:42.572879+09:00\",\"message\":\"Step 1/10 : FROM golang:1.11-alpine\"}\n{\"time\":\"2018-09-21T22:19:42.573093+09:00\",\"message\":\"\\n\"}\n{\"time\":\"2018-09-21T22:19:42.573494+09:00\",\"message\":\" ---\\u003e 233ed4ed14bf\\n\"}\n{\"time\":\"2018-09-21T22:19:42.573616+09:00\",\"message\":\"Step 2/10 : MAINTAINER shunsuke maeda \\u003cduck8823@gmail.com\\u003e\"}\n{\"time\":\"2018-09-21T22:19:42.573734+09:00\",\"message\":\"\\n\"}\n...\n```\n\n## Health Check\nThis server has an health check API endpoint (`/health`) that returns the health of the service. The endpoint returns `200` status code if all green.  \n\n```bash\n$ curl -XGET -I http://localhost:8080/health\n```\n\n```\nHTTP/1.1 200 OK\nDate: Wed, 31 Oct 2018 20:33:42 GMT\nContent-Length: 0\n```\n\nThe check items are as follows\n\n- Whether the Docker daemon is running or not\n\nYou can also check with `health` sub-command.\n\n```bash\n$ duci health\n```\n\n```\nINFO[14/Jan/2019 07:17:38.864] ok.\n```\n\n## License\nMIT License\n\nCopyright (c) 2018 Shunsuke Maeda\n\nSee [LICENSE](./LICENSE) file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduck8823%2Fduci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduck8823%2Fduci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduck8823%2Fduci/lists"}