Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.dockerignore
Dockerfile
docker-compose*

.git
.gitignore

.travis.yml

config/**
!config/docker.json

docs
vendor
volumes

*.sqlite

LICENSE
Makefile
README.md

uberalls

.vscode
__debug_bin
18 changes: 18 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docker Image CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build --tag haxandmat\uberalls:latest .
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ coverage.out
*.xml
*.cov
*.html

docker-compose.yml
volumes/*
!**/.keep

.vscode
__debug_bin
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM golang:1.14.0-alpine3.11 as go

WORKDIR /go/src/uberalls

COPY . .

RUN apk add --no-cache git gcc g++ &&\
go get github.com/Masterminds/glide &&\
glide install &&\
go get -v &&\
go build

###########################################
FROM alpine:3.11

ARG UID=1000

ENV UBERALLS_CONFIG=/home/docker.json

WORKDIR /home

RUN adduser -D -u $UID -h /home user &&\
mkdir volumes &&\
chown user:user volumes

COPY --chown=user config/docker.json $UBERALLS_CONFIG

COPY --from=go --chown=user /go/src/uberalls/uberalls uberalls

USER user

EXPOSE 3000

VOLUME [ "/home/volumes" ]

CMD ["/home/uberalls"]
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,28 @@ and TravisCI.
[Jenkins]: https://jenkins-ci.org/
[Coveralls]: https://coveralls.io/

## Docker
```console
docker run -p 3000:3000 haxandmat/uberalls:latest
```
## ... via [`docker-compose`](https://github.com/docker/compose)

Example `docker-compose.yml` for `uberalls`:

```yaml
version: '3'

services:
server:
restart: unless-stopped
image: haxandmat/uberalls:latest
ports:
- "3000:3000"

```

Run `docker-compose up -d`, wait for it to initialize completely, and visit `http://localhost:3000`, or `http://host-ip:3000` (as appropriate).

## Running

Configure your database by editing `config/default.json` or specify a different
Expand All @@ -31,7 +53,7 @@ Uberalls works best when paired with our [Phabricator Jenkins Plugin][], which
will record Cobertura data on master runs, and compare coverage to the base
revision on differentials.

![Jenkins Integration](/docs/jenkins-integration.png)
![Jenkins Integration](https://raw.githubusercontent.com/Haxandmat/uberalls/master/docs/jenkins-integration.png)

[Phabricator Jenkins Plugin]: https://github.com/uber/phabricator-jenkins-plugin

Expand All @@ -42,7 +64,7 @@ In order to have a baseline to compare against, you must also have jenkins build
your project on your mainline branch ("master" by default). You can either
create a separate job, or enable SCM polling under Build Triggers:

![scm polling](/docs/scm-polling.png)
![scm polling](https://raw.githubusercontent.com/Haxandmat/uberalls/master/docs/scm-polling.png)

## Development

Expand Down
6 changes: 6 additions & 0 deletions config/docker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dbType": "sqlite3",
"dbLocation": "volumes/db.sqlite",
"listenAddress": "0.0.0.0",
"listenPort": 3000
}
14 changes: 14 additions & 0 deletions docker-compose.sample.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3'

services:
server:
build:
context: .
args:
UID: 1000
restart: unless-stopped
image: uberalls:latest
volumes:
- ./volumes:/home/volumes
ports:
- "3000:3000"
Empty file added volumes/.keep
Empty file.