duci

command module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2018 License: MIT Imports: 11 Imported by: 0

README

duci

Language GitHub release Build Status Coverage Status Go Report Card codebeat badge MIT License

duci [zushi] (Docker Under Continuous Integration) is a small ci server.

DSL is Unnecessary For CI

Let's define the task in the task runner.
In the Dockerfile, let's define the necessary infrastructure for the task.
duci just execute the task in docker container.

Features

  • Run task in Docker container
  • The task is triggered by pull request comment and push
  • Create GitHub commit status
  • Execute tasks asynchronously

How to use

Target Repository

The target repository must have Dockerfile in repository root or .duci/Dockerfile.
If there is .duci/Dockerfile, duci read it preferentially.

In Dockerfile, I suggest to use ENTRYPOINT.

e.g.

ENTRYPOINT ["mvn"]
CMD ["compile"]
ENTRYPOINT ["fastlane"]
CMD ["build"]

When push to github, duci execute mvn compile / fastlane build.
And when comment ci test on github pull request, execute mvn test / fastlane test.

Using Volumes

You can use volumes options for external dependency, cache and etc.
Set configurations in .duci/config.yml

---
server:
  volumes:
    - '/path/to/host/dir:/path/to/container/dir'
Run Server
Add Environment Variable

This server needs environment variable GITHUB_API_TOKEN to create status.

export GITHUB_API_TOKEN=<your token>

Server Settings

Run Server

If you have already set $GOPATH, you can install it with the following command.

$ go get -u github.com/duck8823/duci
$ duci 
Setting SSH

This server clone from github.com with SSH protocol using private key $HOME/.ssh/id_rsa.
Please set the public key of the pair at https://github.com/settings/keys.

Add Webhooks to GitHub repository

duci start to listen webhook with port 8080 and endpoint /.
Add endpoint of duci to target repository.
https://github.com/<owner>/<repository>/settings/hooks

Using Docker

You can use Docker to run server.

$ docker run -p 8080:8080 \
             -e GITHUB_API_TOKEN=<your toekn> \
             -v /var/run/docker.sock:/var/run/docker.sock \
             -v ~/.ssh:/root/.ssh:ro \ 
             duck8823/duci
docker-compose for Windows
$ git clone https://github.com/duck8823/duci.git
$ cd duci
$ docker-compose -f docker-compose.win.yml up
docker-compose for Mac
$ git clone https://github.com/duck8823/duci.git
$ cd duci
$ docker-compose -f docker-compose.mac.yml up

License

MIT License

Copyright (c) 2018 Shunsuke Maeda

See LICENSE file

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
service/github/mock_github
Package mock_github is a generated GoMock package.
Package mock_github is a generated GoMock package.
service/runner/mock_runner
Package mock_runner is a generated GoMock package.
Package mock_runner is a generated GoMock package.
infrastructure
docker/mock_docker
Package mock_docker is a generated GoMock package.
Package mock_docker is a generated GoMock package.
git
git/mock_git
Package mock_git is a generated GoMock package.
Package mock_git is a generated GoMock package.
presentation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL