Skip to content

Commit

Permalink
Merge pull request #148 from fescobar/beta
Browse files Browse the repository at this point in the history
Version Update 2.13.8, Features & Improvements
  • Loading branch information
fescobar authored Jan 18, 2021
2 parents 42e1d42 + 1f0e8d8 commit c94f3ab
Show file tree
Hide file tree
Showing 11 changed files with 374 additions and 61 deletions.
173 changes: 173 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
name: Allure Docker Service Workflow

on:
push:
branches:
- "*"

tags:
- v*

pull_request:

env:
DOCKER_IMAGE: frankescobar/allure-docker-service
ALLURE_RELEASE: 2.13.8
QEMU_VERSION: v4.0.0
DOCKER_CLI_EXPERIMENTAL: enabled

jobs:
build_release:
runs-on: ubuntu-latest
strategy:
matrix:
ARCH: [amd64, arm32v7, arm64v8]
include:
- ARCH: amd64
DOCKER_FILE: Dockerfile.bionic
JDK: adoptopenjdk:11-jre-openj9-bionic
QEMU_ARCH: x86_64

- ARCH: arm32v7
DOCKER_FILE: Dockerfile.bionic
JDK: adoptopenjdk:11-jdk-hotspot-bionic
QEMU_ARCH: arm

- ARCH: arm64v8
DOCKER_FILE: Dockerfile.bionic
JDK: adoptopenjdk:11-jre-hotspot-bionic
QEMU_ARCH: aarch64

if: github.event_name == 'push'
outputs:
build_version: ${{ steps.prepare.outputs.build_version }}
steps:
- name: Pulling code
uses: actions/checkout@v2

- name: Preparing
id: prepare
run: |
echo "DOCKER BUILD: Build Docker image."
echo "DOCKER BUILD: arch - ${{matrix.ARCH}}."
echo "DOCKER BUILD: jdk -> ${{matrix.JDK}}."
echo "DOCKER BUILD: build version -> ${VERSION}."
echo "DOCKER BUILD: allure version -> ${ALLURE_RELEASE}."
echo "DOCKER BUILD: qemu arch - ${{matrix.QEMU_ARCH}}."
echo "DOCKER BUILD: docker file - ${{matrix.DOCKER_FILE}}."
VERSION=na
TAGS="--tag ${DOCKER_IMAGE}:build"
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}:${VERSION}-${{matrix.ARCH}} --tag ${DOCKER_IMAGE}:beta --tag ${DOCKER_IMAGE}:build"
else
TAGS="--tag ${DOCKER_IMAGE}:${VERSION} --tag ${DOCKER_IMAGE}:${VERSION}-${{matrix.ARCH}} --tag ${DOCKER_IMAGE}:latest --tag ${DOCKER_IMAGE}:build"
fi
fi
echo ::set-output name=docker_image::${DOCKER_IMAGE}
echo ::set-output name=build_version::${VERSION}
echo ::set-output name=docker_args::--build-arg ARCH=${{matrix.ARCH}} \
--build-arg JDK=${{matrix.JDK}} \
--build-arg QEMU_ARCH=${{matrix.QEMU_ARCH}} \
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
--build-arg BUILD_VERSION=${VERSION} \
--build-arg BUILD_REF=${GITHUB_SHA::8} \
--build-arg ALLURE_RELEASE=${ALLURE_RELEASE} \
${TAGS} --file docker/Dockerfile.bionic .
- name: Setting up QEMU
run: |
# Prepare qemu to build non amd64 / x86_64 images
docker run --rm --privileged multiarch/qemu-user-static:register --reset
mkdir tmp
pushd tmp &&
curl -L -o qemu-x86_64-static.tar.gz https://github.com/multiarch/qemu-user-static/releases/download/$QEMU_VERSION/qemu-x86_64-static.tar.gz && tar xzf qemu-x86_64-static.tar.gz &&
curl -L -o qemu-arm-static.tar.gz https://github.com/multiarch/qemu-user-static/releases/download/$QEMU_VERSION/qemu-arm-static.tar.gz && tar xzf qemu-arm-static.tar.gz &&
curl -L -o qemu-aarch64-static.tar.gz https://github.com/multiarch/qemu-user-static/releases/download/$QEMU_VERSION/qemu-aarch64-static.tar.gz && tar xzf qemu-aarch64-static.tar.gz &&
popd
- name: Docker Building
run: |
docker build --no-cache ${{ steps.prepare.outputs.docker_args }}
- name: Docker Testing
run: |
echo "DOCKER TEST: Test Docker image."
echo "DOCKER TEST: testing image -> ${DOCKER_IMAGE}:build"
docker run -d --rm --name=testing ${DOCKER_IMAGE}:build
if [ $? -ne 0 ]; then
echo "DOCKER TEST: FAILED - Docker container testing failed to start."
exit 1
else
echo "DOCKER TEST: PASSED - Docker container testing succeeded to start."
fi
- name: DockerHub Login
if: success() && startsWith(github.ref, 'refs/tags/v')
env:
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_PASS: ${{ secrets.DOCKER_HUB_PASS }}
run: |
echo "${DOCKER_HUB_PASS}" | docker login -u "${DOCKER_HUB_USER}" --password-stdin
- name: Docker Publishing
if: success() && startsWith(github.ref, 'refs/tags/v')
run: |
echo "DOCKER PUSH: pushing - ${DOCKER_IMAGE}:${{ steps.prepare.outputs.build_version }}-${{matrix.ARCH}}."
docker push ${DOCKER_IMAGE}:${{ steps.prepare.outputs.build_version }}-${{matrix.ARCH}}
- name: Docker Logout
if: success() && startsWith(github.ref, 'refs/tags/v')
run: |
docker logout
manifest_release:
runs-on: ubuntu-latest
needs: build_release
steps:
- name: DockerHub Login
if: success() && startsWith(github.ref, 'refs/tags/v')
env:
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_PASS: ${{ secrets.DOCKER_HUB_PASS }}
run: |
echo "${DOCKER_HUB_PASS}" | docker login -u "${DOCKER_HUB_USER}" --password-stdin
- name: Docker Publishing Manifest
if: success() && startsWith(github.ref, 'refs/tags/v')
run: |
BUILD_VERSION=${{ needs.build_release.outputs.build_version }}
docker manifest create ${DOCKER_IMAGE}:${BUILD_VERSION} \
${DOCKER_IMAGE}:${BUILD_VERSION}-amd64 \
${DOCKER_IMAGE}:${BUILD_VERSION}-arm32v7 \
${DOCKER_IMAGE}:${BUILD_VERSION}-arm64v8
docker manifest annotate ${DOCKER_IMAGE}:${BUILD_VERSION} ${DOCKER_IMAGE}:${BUILD_VERSION}-arm32v7 --os=linux --arch=arm --variant=v7
docker manifest annotate ${DOCKER_IMAGE}:${BUILD_VERSION} ${DOCKER_IMAGE}:${BUILD_VERSION}-arm64v8 --os=linux --arch=arm64 --variant=v8
docker manifest push ${DOCKER_IMAGE}:${BUILD_VERSION}
TAG=beta
if [[ ${BUILD_VERSION} != *"beta"* ]]; then
TAG=latest
fi
docker manifest create ${DOCKER_IMAGE}:${TAG} \
${DOCKER_IMAGE}:${BUILD_VERSION}-amd64 \
${DOCKER_IMAGE}:${BUILD_VERSION}-arm32v7 \
${DOCKER_IMAGE}:${BUILD_VERSION}-arm64v8
docker manifest annotate ${DOCKER_IMAGE}:${TAG} ${DOCKER_IMAGE}:${BUILD_VERSION}-arm32v7 --os=linux --arch=arm --variant=v7
docker manifest annotate ${DOCKER_IMAGE}:${TAG} ${DOCKER_IMAGE}:${BUILD_VERSION}-arm64v8 --os=linux --arch=arm64 --variant=v8
docker manifest push ${DOCKER_IMAGE}:${TAG}
- name: Docker Logout
if: success() && startsWith(github.ref, 'refs/tags/v')
run: |
docker logout
38 changes: 32 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Table of contents
* [Refresh Access Token](#refresh-access-token)
* [Logout](#logout)
* [Roles](#roles)
* [Make Viewer endpoints public](#make-viewer-endpoints-public)
* [Scripts](#scripts)
* [Add Custom URL Prefix](#add-custom-url-prefix)
* [Optimize Storage](#optimize-storage)
Expand Down Expand Up @@ -95,9 +96,9 @@ The following table shows the provided Manifest Lists.

| **Tag** | **allure-docker-service Base Image** |
|----------------------------------------|---------------------------------------------------|
| latest, 2.13.7 | frankescobar/allure-docker-service:2.13.7-amd64 |
| | frankescobar/allure-docker-service:2.13.7-arm32v7 |
| | frankescobar/allure-docker-service:2.13.7-arm64v8 |
| latest, 2.13.8 | frankescobar/allure-docker-service:2.13.8-amd64 |
| | frankescobar/allure-docker-service:2.13.8-arm32v7 |
| | frankescobar/allure-docker-service:2.13.8-arm64v8 |

## USAGE
### Generate Allure Results
Expand Down Expand Up @@ -687,6 +688,16 @@ If the type is not recognized it will take the default icon. You can use differe
[![](resources/executor05.png)](resources/executor05.png)
- github
[![](resources/executor06.png)](resources/executor06.png)
- gitlab
[![](resources/executor07.png)](resources/executor07.png)
The icons are based on the native Allure2 Framework:
- https://github.com/allure-framework/allure2/tree/master/allure-generator/src/main/javascript/blocks/executor-icon
Expand All @@ -706,7 +717,7 @@ You can switch the version container using `frankescobar/allure-docker-service:$
Docker Compose example:
```sh
allure:
image: "frankescobar/allure-docker-service:2.13.7"
image: "frankescobar/allure-docker-service:2.13.8"
```
or using latest version:
Expand Down Expand Up @@ -1111,6 +1122,21 @@ Note:
- `SECURITY_USER` & `SECURITY_VIEWER_USER` always need to be different.
- Check [Allure API](#allure-api) to see what endpoints are exclusively for the `ADMIN` role.

##### Make Viewer endpoints public
`Available from Allure Docker Service version 2.13.8`
If you only want to protect the `Admin` endpoints and make public the viewer endpoints, then you can use the environment variable `MAKE_VIEWER_ENDPOINTS_PUBLIC` to make accessible the endpoints:

Docker Compose example:
```sh
environment:
SECURITY_USER: "my_username"
SECURITY_PASS: "my_password"
SECURITY_ENABLED: 1
MAKE_VIEWER_ENDPOINTS_PUBLIC: 1
```
Note:
- With `MAKE_VIEWER_ENDPOINTS_PUBLIC` enabled, your `viewer` user (if you have someone defined) won't have effect.
##### Scripts
- Bash script with security enabled: [allure-docker-api-usage/send_results_security.sh](allure-docker-api-usage/send_results_security.sh)
```sh
Expand Down Expand Up @@ -1314,7 +1340,7 @@ If you want to use docker without sudo, read following links:

### Build image
```sh
docker build -t allure-release -f docker-custom/Dockerfile.bionic-custom --build-arg ALLURE_RELEASE=2.13.7 .
docker build -t allure-release -f docker-custom/Dockerfile.bionic-custom --build-arg ALLURE_RELEASE=2.13.8 .
```
### Run container
```sh
Expand Down Expand Up @@ -1365,5 +1391,5 @@ docker run -d -p 5050:5050 frankescobar/allure-docker-service
```
### Download specific tagged image registered (Example)
```sh
docker run -d -p 5050:5050 frankescobar/allure-docker-service:2.13.7
docker run -d -p 5050:5050 frankescobar/allure-docker-service:2.13.8
```
Loading

0 comments on commit c94f3ab

Please sign in to comment.