From 305a0041e8815d06227e3eee6dff4f88d9688a76 Mon Sep 17 00:00:00 2001 From: Konstantin Albutov Date: Thu, 5 Mar 2020 02:51:29 +0300 Subject: [PATCH 01/16] Fix .gitignore --- .gitignore | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index a2e71fb..e55371f 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,10 @@ coverage.out *.xml *.cov *.html + +docker-compose.yml +volumes/* +!**/.keep + +.vscode +__debug_bin From bab903572f64fe075888db4a86a240be12675793 Mon Sep 17 00:00:00 2001 From: Konstantin Albutov Date: Thu, 5 Mar 2020 02:52:29 +0300 Subject: [PATCH 02/16] Add .dockerignore --- .dockerignore | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..55a7209 --- /dev/null +++ b/.dockerignore @@ -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 From 2d38ee44e1986e57ccd844a5dfc3bf1b84577785 Mon Sep 17 00:00:00 2001 From: Konstantin Albutov Date: Thu, 5 Mar 2020 02:52:56 +0300 Subject: [PATCH 03/16] Add config/docker.json --- config/docker.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 config/docker.json diff --git a/config/docker.json b/config/docker.json new file mode 100644 index 0000000..f902bf8 --- /dev/null +++ b/config/docker.json @@ -0,0 +1,6 @@ +{ + "dbType": "sqlite3", + "dbLocation": "volumes/db.sqlite", + "listenAddress": "localhost", + "listenPort": 3000 +} From d5d9ec2f284ba76ea0a45e980690a357ba6734a5 Mon Sep 17 00:00:00 2001 From: Konstantin Albutov Date: Thu, 5 Mar 2020 02:54:16 +0300 Subject: [PATCH 04/16] Add Dockerfile --- Dockerfile | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..78612e8 --- /dev/null +++ b/Dockerfile @@ -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 + +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"] From cd0eed195448adcd951198c10559b57a373d909d Mon Sep 17 00:00:00 2001 From: Konstantin Albutov Date: Thu, 5 Mar 2020 02:54:28 +0300 Subject: [PATCH 05/16] Create folder volumes --- volumes/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 volumes/.keep diff --git a/volumes/.keep b/volumes/.keep new file mode 100644 index 0000000..e69de29 From 739c6938a14fcd93e2d8eb3cf69301a6d9edb03f Mon Sep 17 00:00:00 2001 From: Konstantin Albutov Date: Thu, 5 Mar 2020 02:54:57 +0300 Subject: [PATCH 06/16] Create docker-compose.sample.yml --- docker-compose.sample.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 docker-compose.sample.yml diff --git a/docker-compose.sample.yml b/docker-compose.sample.yml new file mode 100644 index 0000000..a3788fa --- /dev/null +++ b/docker-compose.sample.yml @@ -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" From 5dfd78804a4e994be9c23b307483d5fcd8539214 Mon Sep 17 00:00:00 2001 From: Haxandmat <35293287+Haxandmat@users.noreply.github.com> Date: Thu, 5 Mar 2020 03:39:47 +0300 Subject: [PATCH 07/16] Create dockerimage.yml --- .github/workflows/dockerimage.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/dockerimage.yml diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml new file mode 100644 index 0000000..6d8e965 --- /dev/null +++ b/.github/workflows/dockerimage.yml @@ -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 . From 321ca565e9c26722561cb873035a82e6fdbd6a1b Mon Sep 17 00:00:00 2001 From: Konstantin Albutov Date: Thu, 5 Mar 2020 03:43:04 +0300 Subject: [PATCH 08/16] Fix Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 78612e8..a106e74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN apk add --no-cache git gcc g++ &&\ ########################################### FROM alpine:3.11 -ARG UID +ARG UID=1000 ENV UBERALLS_CONFIG=/home/docker.json From cb167dcff50698c6a92649103f4b3c89d86af21a Mon Sep 17 00:00:00 2001 From: Haxandmat <35293287+Haxandmat@users.noreply.github.com> Date: Thu, 5 Mar 2020 03:54:01 +0300 Subject: [PATCH 09/16] Update dockerimage.yml --- .github/workflows/dockerimage.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index 6d8e965..e75efae 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -13,6 +13,5 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - name: Build the Docker image run: docker build --tag haxandmat\uberalls:latest . From 3f9d9630456a7f8967904e2af3c5fef3f150b847 Mon Sep 17 00:00:00 2001 From: Konstantin Albutov Date: Thu, 5 Mar 2020 04:00:24 +0300 Subject: [PATCH 10/16] Fix --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bfc4e79..75fdf54 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,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://github.com/Haxandmat/uberalls/docs/jenkins-integration.png) [Phabricator Jenkins Plugin]: https://github.com/uber/phabricator-jenkins-plugin @@ -42,7 +42,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://github.com/Haxandmat/uberalls/docs/scm-polling.png) ## Development From 5ccd8e9c4409003908102f32d962dc90e9eb36c2 Mon Sep 17 00:00:00 2001 From: Konstantin Albutov Date: Thu, 5 Mar 2020 04:04:39 +0300 Subject: [PATCH 11/16] Fix README --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 75fdf54..0478896 100644 --- a/README.md +++ b/README.md @@ -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 From cb866f0c2bc928d1813b71b77ef8bf4c26a0d816 Mon Sep 17 00:00:00 2001 From: Konstantin Albutov Date: Thu, 5 Mar 2020 04:07:57 +0300 Subject: [PATCH 12/16] Fix --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0478896..1b88e46 100644 --- a/README.md +++ b/README.md @@ -53,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](https://github.com/Haxandmat/uberalls/docs/jenkins-integration.png) +![Jenkins Integration](https://raw.githubusercontent.com/Haxandmat/uberalls/docs/jenkins-integration.png) [Phabricator Jenkins Plugin]: https://github.com/uber/phabricator-jenkins-plugin @@ -64,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](https://github.com/Haxandmat/uberalls/docs/scm-polling.png) +![scm polling](https://raw.githubusercontent.com/Haxandmat/uberalls/docs/scm-polling.png) ## Development From 26ebdc9927f085b9589c473b392a5238b2297872 Mon Sep 17 00:00:00 2001 From: Konstantin Albutov Date: Thu, 5 Mar 2020 04:09:12 +0300 Subject: [PATCH 13/16] Fix --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1b88e46..5228727 100644 --- a/README.md +++ b/README.md @@ -53,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](https://raw.githubusercontent.com/Haxandmat/uberalls/docs/jenkins-integration.png) +![Jenkins Integration](https://raw.githubusercontent.com/Haxandmat/master/uberalls/docs/jenkins-integration.png) [Phabricator Jenkins Plugin]: https://github.com/uber/phabricator-jenkins-plugin @@ -64,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](https://raw.githubusercontent.com/Haxandmat/uberalls/docs/scm-polling.png) +![scm polling](https://raw.githubusercontent.com/Haxandmat/uberalls/master/docs/scm-polling.png) ## Development From e1567c636bce96e7b597493e20d8b56857a9d1ed Mon Sep 17 00:00:00 2001 From: Konstantin Albutov Date: Thu, 5 Mar 2020 04:09:48 +0300 Subject: [PATCH 14/16] Fix link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5228727..c354208 100644 --- a/README.md +++ b/README.md @@ -53,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](https://raw.githubusercontent.com/Haxandmat/master/uberalls/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 From 2ddc1d5aebbca416c49ec12652c9634b2e8ea70f Mon Sep 17 00:00:00 2001 From: Haxandmat <35293287+Haxandmat@users.noreply.github.com> Date: Thu, 5 Mar 2020 04:27:09 +0300 Subject: [PATCH 15/16] Update dockerimage.yml --- .github/workflows/dockerimage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index e75efae..6d8e965 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -13,5 +13,6 @@ jobs: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 - name: Build the Docker image run: docker build --tag haxandmat\uberalls:latest . From 70733fa802f1665833fecd3c62af4fd3afb133e0 Mon Sep 17 00:00:00 2001 From: Haxandmat <35293287+Haxandmat@users.noreply.github.com> Date: Thu, 5 Mar 2020 20:14:41 +0300 Subject: [PATCH 16/16] Update docker.json --- config/docker.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/docker.json b/config/docker.json index f902bf8..6344972 100644 --- a/config/docker.json +++ b/config/docker.json @@ -1,6 +1,6 @@ { "dbType": "sqlite3", "dbLocation": "volumes/db.sqlite", - "listenAddress": "localhost", + "listenAddress": "0.0.0.0", "listenPort": 3000 }