Skip to content

Commit

Permalink
Merge pull request #3 from fescobar/beta
Browse files Browse the repository at this point in the history
First UI version
  • Loading branch information
fescobar authored Sep 1, 2020
2 parents cd527a2 + d41e4a4 commit 335ea6a
Show file tree
Hide file tree
Showing 58 changed files with 4,083 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ui/node_modules
ui/build
ui/package-lock.json
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#https://help.github.com/articles/dealing-with-line-endings/
*.sh text eol=lf
78 changes: 78 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Allure Docker UI Workflow

on:
push:
branches:
- "*"

tags:
- v*

pull_request:

env:
DOCKER_IMAGE: frankescobar/allure-docker-service-ui

jobs:
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- name: Pulling code
uses: actions/checkout@v2

- name: Preparing
id: prepare
run: |
DOCKER_PLATFORMS=linux/amd64,linux/arm64,linux/arm/v7
VERSION=na
TAGS="--tag ${DOCKER_IMAGE}:na"
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
if [[ $GITHUB_REF == *"beta"* ]]; then
TAGS="--tag ${DOCKER_IMAGE}:${VERSION} --tag ${DOCKER_IMAGE}:beta"
else
TAGS="--tag ${DOCKER_IMAGE}:${VERSION} --tag ${DOCKER_IMAGE}:latest"
fi
fi
echo ::set-output name=docker_image::${DOCKER_IMAGE}
echo ::set-output name=version::${VERSION}
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \
--build-arg VERSION=${VERSION} \
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
--build-arg VCS_REF=${GITHUB_SHA::8} \
${TAGS} --file docker/Dockerfile .
- name: Setting up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v3
with:
buildx-version: latest
qemu-version: latest

- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Docker Building
run: |
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }}
- name: DockerHub Login
if: success() && startsWith(github.ref, 'refs/tags/v')
uses: crazy-max/ghaction-docker-login@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASS }}

- name: Docker Publishing
if: success() && startsWith(github.ref, 'refs/tags/v')
run: |
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
- name: Inspecting image
if: always() && startsWith(github.ref, 'refs/tags/v')
run: |
docker buildx imagetools inspect ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/projects
/allure-results
/allure-reports
205 changes: 204 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,204 @@
# allure-docker-service-ui
[![](resources/allure.png)](http://allure.qatools.ru/)
[![](resources/docker.png)](https://docs.docker.com/)
[![](resources/reactjs.png)](https://reactjs.org/)

# ALLURE-DOCKER-SERVICE UI

Table of contents
=================
* [FEATURES](#FEATURES)
* [Docker Hub](#docker-hub)
* [Docker Versions](#docker-versions)
* [USAGE](#USAGE)
* [Docker on Unix/Mac](#docker-on-unixmac)
* [Docker on Windows (Git Bash)](#docker-on-windows-git-bash)
* [Docker Compose](#docker-compose)
* [Implementation Examples](#implementation-examples)
* [Accessing UI](#accessing-ui)
* [Extra options](#extra-options)
* [Get Info](#get-info)
* [Add Custom URL Prefix](#add-custom-url-prefix)
* [SUPPORT](#SUPPORT)
* [Gitter](#gitter)
* [DOCKER GENERATION (Usage for developers)](#docker-generation-usage-for-developers)

## FEATURES
Allure Docker Service UI provides a friendly user interface for [frankescobar/allure-docker-service](https://github.com/fescobar/allure-docker-service) API container.

[![](resources/signin-allure-docker-service-ui.png)](resources/signin-allure-docker-service-ui.png)
[![](resources/allure-docker-service-ui.png)](resources/allure-docker-service-ui.png)

### Docker Hub
- Repository: [frankescobar/allure-docker-service-ui](https://hub.docker.com/r/frankescobar/allure-docker-service-ui/)

### Docker Versions
Docker container versions are publish on [https://github.com/fescobar/allure-docker-service-ui/releases](https://github.com/fescobar/allure-docker-service-ui/releases)

#### Image Variants
Allure Docker Service supports architectures amd64, arm/v7 and arm64.

- Tags: https://hub.docker.com/r/frankescobar/allure-docker-service-ui/tags

## USAGE
### Docker on Unix/Mac
```sh
docker run -p 5050:5050 -e CHECK_RESULTS_EVERY_SECONDS=NONE -e KEEP_HISTORY=1 \
-v ${PWD}/projects:/app/projects \
frankescobar/allure-docker-service

docker run -p 5252:5252 -e ALLURE_DOCKER_PUBLIC_API_URL=http://localhost:5050 \
frankescobar/allure-docker-service-ui
```

### Docker on Windows (Git Bash)
```sh
docker run -p 5050:5050 -e CHECK_RESULTS_EVERY_SECONDS=NONE -e KEEP_HISTORY=1 \
-v "/$(pwd)/projects:/app/projects" \
frankescobar/allure-docker-service

docker run -p 5252:5252 -e ALLURE_DOCKER_PUBLIC_API_URL=http://localhost:5050 \
frankescobar/allure-docker-service-ui
```

### Docker Compose
Using docker-compose is the best way to manage containers: [allure-docker-multi-project-example/docker-compose.yml](https://github.com/fescobar/allure-docker-service-examples/blob/master/allure-docker-multi-project-example/docker-compose.yml)

```sh
version: '3'
services:
allure:
image: "frankescobar/allure-docker-service"
environment:
CHECK_RESULTS_EVERY_SECONDS: NONE
KEEP_HISTORY: 1
KEEP_HISTORY_LATEST: 25
ports:
- "5050:5050"
volumes:
- ${PWD}/projects:/app/projects

allure-ui:
image: "frankescobar/allure-docker-service-ui"
environment:
ALLURE_DOCKER_PUBLIC_API_URL: "http://localhost:5050"
ALLURE_DOCKER_PUBLIC_API_URL_PREFIX: ""
ports:
- "5252:5252"
```

```sh
docker-compose up allure allure-ui
```

If you want to run in background:

```sh
docker-compose up -d allure allure-ui
```

You can see the logs:

```sh
docker-compose logs -f allure
docker-compose logs -f allure-ui
```

### Implementation Examples
Check examples here:
[frankescobar/allure-docker-service-examples](https://github.com/fescobar/allure-docker-service-examples)

### Accessing UI
Open your browser and access to the UI: http://localhost:5252/allure-docker-service-ui

### Extra options
#### Get Info
You can get extra info using the next urls:

- http://localhost:5252/allure-docker-service-ui/config

- http://localhost:5252/allure-docker-service-ui/version

#### Add Custom URL Prefix
Configure an url prefix if your deployment requires it (e.g. reverse proxy with nginx)
```sh
environment:
URL_PREFIX: "/my-prefix"
```
With this configuration you can request the UI in this way too:
```sh
curl http://localhost:5252/my-prefix/allure-docker-service-ui
```


## SUPPORT
### Gitter
[![Gitter](https://badges.gitter.im/allure-docker-service/community.svg)](https://gitter.im/allure-docker-service/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)


## DOCKER GENERATION (Usage for developers)
### Install Docker
```sh
sudo apt-get update
```
```sh
sudo apt install -y docker.io
```
If you want to use docker without sudo, read following links:
- https://docs.docker.com/engine/installation/linux/linux-postinstall/#manage-docker-as-a-non-root-user
- https://stackoverflow.com/questions/21871479/docker-cant-connect-to-docker-daemon

### Build image
```sh
docker build -t allure-ui-release -f docker/Dockerfile --build-arg VERSION=na --build-arg VCS_REF=na --build-arg BUILD_DATE=na .
```
### Run container
```sh
docker run -d -p 5252:5252 allure-ui-release
```
### See active containers
```sh
docker container ls
```
### Access to container
```sh
docker exec -it ${CONTAINER_ID} bash
```
### Access to logs
```sh
docker exec -it ${CONTAINER_ID} tail -f log
```
### Remove all containers
```sh
docker container rm $(docker container ls -a -q) -f
```
### Remove all images
```sh
docker image rm $(docker image ls -a -q)
```
### Remove all stopped containers
```sh
docker ps -q -f status=exited | xargs docker rm
```
### Remove all dangling images
```sh
docker images -f dangling=true | xargs docker rmi
```
### Register tagged image (Example)
```sh
docker login
docker tag allure-ui-release frankescobar/allure-docker-service-ui:${PUBLIC_TAG}
docker push frankescobar/allure-docker-service-ui
```
### Register latest image (Example)
```sh
docker tag allure-ui-release frankescobar/allure-docker-service-ui:latest
docker push frankescobar/allure-docker-service-ui
```
### Download latest image registered (Example)
```sh
docker run -d -p 5252:5252 frankescobar/allure-docker-service-ui
```
### Download specific tagged image registered (Example)
```sh
docker run -d -p 5252:5252 frankescobar/allure-docker-service-ui:7.0.0
```
34 changes: 34 additions & 0 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: '3'

services:
allure-docker-service-ui:
build:
context: ../allure-docker-service-ui
dockerfile: docker/Dockerfile
args:
BUILD_DATE: "na"
VERSION: "na"
VCS_REF: "na"
environment:
ALLURE_DOCKER_PUBLIC_API_URL: "http://localhost:5050"
ALLURE_DOCKER_PUBLIC_API_URL_PREFIX: ""
#URL_PREFIX: "/my-prefix"
ports:
- "7474:5252"

allure:
image: "frankescobar/allure-docker-service"
environment:
CHECK_RESULTS_EVERY_SECONDS: NONE
KEEP_HISTORY: 1
KEEP_HISTORY_LATEST: 12
SECURITY_USER: my_username
SECURITY_PASS: my_password
SECURITY_ENABLED: 1
#URL_PREFIX: /my-prefix
#ACCESS_TOKEN_EXPIRES_IN_SECONDS: 10
#REFRESH_TOKEN_EXPIRES_IN_SECONDS: 10
ports:
- "5050:5050"
volumes:
- ${PWD}/projects:/app/projects
48 changes: 48 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
######
FROM node:12.18.3-buster-slim AS builder
ENV ROOT=/code
WORKDIR $ROOT
COPY ui $ROOT
RUN npm install && \
npm run build

######
FROM node:12.18.3-buster-slim
ARG BUILD_DATE
ARG VERSION
ARG VCS_REF
LABEL org.label-schema.build-date=${BUILD_DATE} \
org.label-schema.docker.dockerfile="docker/Dockerfile" \
org.label-schema.license="MIT" \
org.label-schema.name="Allure Docker Service UI" \
org.label-schema.version=${VERSION} \
org.label-schema.description="UI Layer for Allure Docker Service container" \
org.label-schema.vcs-ref=${VCS_REF} \
org.label-schema.vcs-type="Git" \
org.label-schema.vcs-url="https://github.com/fescobar/allure-docker-service-ui" \
authors="Frank Escobar <fescobar.systems@gmail.com>"

ENV ROOT=/app

WORKDIR $ROOT
COPY --chown=node:node --from=builder /code/build $ROOT/ui
COPY --chown=node:node server $ROOT/ui
COPY --chown=node:node scripts $ROOT
COPY --chown=node:node ui/generate_env_file.sh $ROOT

RUN echo "${VERSION}" > $ROOT/ui/ui_version && \
echo "ALLURE_DOCKER_SERVICE_UI_VERSION:" $(cat $ROOT/ui/ui_version) && \
chmod +x $ROOT/*.sh && \
npm install --prefix $ROOT/ui

RUN chown -R node:node $ROOT

ENV PORT=5252
EXPOSE $PORT

HEALTHCHECK --interval=10s --timeout=60s --retries=3 \
CMD curl -f http://localhost:$PORT || exit 1

USER node

CMD $ROOT/run.sh
Binary file added resources/allure-docker-service-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/allure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/docker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/reactjs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/signin-allure-docker-service-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 335ea6a

Please sign in to comment.