Skip to content

Commit c94f3ab

Browse files
authored
Merge pull request #148 from fescobar/beta
Version Update 2.13.8, Features & Improvements
2 parents 42e1d42 + 1f0e8d8 commit c94f3ab

File tree

11 files changed

+374
-61
lines changed

11 files changed

+374
-61
lines changed
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
name: Allure Docker Service Workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- "*"
7+
8+
tags:
9+
- v*
10+
11+
pull_request:
12+
13+
env:
14+
DOCKER_IMAGE: frankescobar/allure-docker-service
15+
ALLURE_RELEASE: 2.13.8
16+
QEMU_VERSION: v4.0.0
17+
DOCKER_CLI_EXPERIMENTAL: enabled
18+
19+
jobs:
20+
build_release:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
ARCH: [amd64, arm32v7, arm64v8]
25+
include:
26+
- ARCH: amd64
27+
DOCKER_FILE: Dockerfile.bionic
28+
JDK: adoptopenjdk:11-jre-openj9-bionic
29+
QEMU_ARCH: x86_64
30+
31+
- ARCH: arm32v7
32+
DOCKER_FILE: Dockerfile.bionic
33+
JDK: adoptopenjdk:11-jdk-hotspot-bionic
34+
QEMU_ARCH: arm
35+
36+
- ARCH: arm64v8
37+
DOCKER_FILE: Dockerfile.bionic
38+
JDK: adoptopenjdk:11-jre-hotspot-bionic
39+
QEMU_ARCH: aarch64
40+
41+
if: github.event_name == 'push'
42+
outputs:
43+
build_version: ${{ steps.prepare.outputs.build_version }}
44+
steps:
45+
- name: Pulling code
46+
uses: actions/checkout@v2
47+
48+
- name: Preparing
49+
id: prepare
50+
run: |
51+
echo "DOCKER BUILD: Build Docker image."
52+
echo "DOCKER BUILD: arch - ${{matrix.ARCH}}."
53+
echo "DOCKER BUILD: jdk -> ${{matrix.JDK}}."
54+
echo "DOCKER BUILD: build version -> ${VERSION}."
55+
echo "DOCKER BUILD: allure version -> ${ALLURE_RELEASE}."
56+
echo "DOCKER BUILD: qemu arch - ${{matrix.QEMU_ARCH}}."
57+
echo "DOCKER BUILD: docker file - ${{matrix.DOCKER_FILE}}."
58+
59+
VERSION=na
60+
TAGS="--tag ${DOCKER_IMAGE}:build"
61+
62+
if [[ $GITHUB_REF == refs/tags/* ]]; then
63+
VERSION=${GITHUB_REF#refs/tags/v}
64+
if [[ $GITHUB_REF == *"beta"* ]]; then
65+
TAGS="--tag ${DOCKER_IMAGE}:${VERSION} --tag ${DOCKER_IMAGE}:${VERSION}-${{matrix.ARCH}} --tag ${DOCKER_IMAGE}:beta --tag ${DOCKER_IMAGE}:build"
66+
else
67+
TAGS="--tag ${DOCKER_IMAGE}:${VERSION} --tag ${DOCKER_IMAGE}:${VERSION}-${{matrix.ARCH}} --tag ${DOCKER_IMAGE}:latest --tag ${DOCKER_IMAGE}:build"
68+
fi
69+
fi
70+
71+
echo ::set-output name=docker_image::${DOCKER_IMAGE}
72+
echo ::set-output name=build_version::${VERSION}
73+
echo ::set-output name=docker_args::--build-arg ARCH=${{matrix.ARCH}} \
74+
--build-arg JDK=${{matrix.JDK}} \
75+
--build-arg QEMU_ARCH=${{matrix.QEMU_ARCH}} \
76+
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
77+
--build-arg BUILD_VERSION=${VERSION} \
78+
--build-arg BUILD_REF=${GITHUB_SHA::8} \
79+
--build-arg ALLURE_RELEASE=${ALLURE_RELEASE} \
80+
${TAGS} --file docker/Dockerfile.bionic .
81+
82+
- name: Setting up QEMU
83+
run: |
84+
# Prepare qemu to build non amd64 / x86_64 images
85+
docker run --rm --privileged multiarch/qemu-user-static:register --reset
86+
mkdir tmp
87+
pushd tmp &&
88+
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 &&
89+
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 &&
90+
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 &&
91+
popd
92+
93+
- name: Docker Building
94+
run: |
95+
docker build --no-cache ${{ steps.prepare.outputs.docker_args }}
96+
97+
- name: Docker Testing
98+
run: |
99+
echo "DOCKER TEST: Test Docker image."
100+
echo "DOCKER TEST: testing image -> ${DOCKER_IMAGE}:build"
101+
102+
docker run -d --rm --name=testing ${DOCKER_IMAGE}:build
103+
if [ $? -ne 0 ]; then
104+
echo "DOCKER TEST: FAILED - Docker container testing failed to start."
105+
exit 1
106+
else
107+
echo "DOCKER TEST: PASSED - Docker container testing succeeded to start."
108+
fi
109+
110+
- name: DockerHub Login
111+
if: success() && startsWith(github.ref, 'refs/tags/v')
112+
env:
113+
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
114+
DOCKER_HUB_PASS: ${{ secrets.DOCKER_HUB_PASS }}
115+
run: |
116+
echo "${DOCKER_HUB_PASS}" | docker login -u "${DOCKER_HUB_USER}" --password-stdin
117+
118+
- name: Docker Publishing
119+
if: success() && startsWith(github.ref, 'refs/tags/v')
120+
run: |
121+
echo "DOCKER PUSH: pushing - ${DOCKER_IMAGE}:${{ steps.prepare.outputs.build_version }}-${{matrix.ARCH}}."
122+
docker push ${DOCKER_IMAGE}:${{ steps.prepare.outputs.build_version }}-${{matrix.ARCH}}
123+
124+
- name: Docker Logout
125+
if: success() && startsWith(github.ref, 'refs/tags/v')
126+
run: |
127+
docker logout
128+
129+
manifest_release:
130+
runs-on: ubuntu-latest
131+
needs: build_release
132+
steps:
133+
- name: DockerHub Login
134+
if: success() && startsWith(github.ref, 'refs/tags/v')
135+
env:
136+
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
137+
DOCKER_HUB_PASS: ${{ secrets.DOCKER_HUB_PASS }}
138+
run: |
139+
echo "${DOCKER_HUB_PASS}" | docker login -u "${DOCKER_HUB_USER}" --password-stdin
140+
141+
- name: Docker Publishing Manifest
142+
if: success() && startsWith(github.ref, 'refs/tags/v')
143+
run: |
144+
BUILD_VERSION=${{ needs.build_release.outputs.build_version }}
145+
docker manifest create ${DOCKER_IMAGE}:${BUILD_VERSION} \
146+
${DOCKER_IMAGE}:${BUILD_VERSION}-amd64 \
147+
${DOCKER_IMAGE}:${BUILD_VERSION}-arm32v7 \
148+
${DOCKER_IMAGE}:${BUILD_VERSION}-arm64v8
149+
150+
docker manifest annotate ${DOCKER_IMAGE}:${BUILD_VERSION} ${DOCKER_IMAGE}:${BUILD_VERSION}-arm32v7 --os=linux --arch=arm --variant=v7
151+
docker manifest annotate ${DOCKER_IMAGE}:${BUILD_VERSION} ${DOCKER_IMAGE}:${BUILD_VERSION}-arm64v8 --os=linux --arch=arm64 --variant=v8
152+
153+
docker manifest push ${DOCKER_IMAGE}:${BUILD_VERSION}
154+
155+
TAG=beta
156+
if [[ ${BUILD_VERSION} != *"beta"* ]]; then
157+
TAG=latest
158+
fi
159+
160+
docker manifest create ${DOCKER_IMAGE}:${TAG} \
161+
${DOCKER_IMAGE}:${BUILD_VERSION}-amd64 \
162+
${DOCKER_IMAGE}:${BUILD_VERSION}-arm32v7 \
163+
${DOCKER_IMAGE}:${BUILD_VERSION}-arm64v8
164+
165+
docker manifest annotate ${DOCKER_IMAGE}:${TAG} ${DOCKER_IMAGE}:${BUILD_VERSION}-arm32v7 --os=linux --arch=arm --variant=v7
166+
docker manifest annotate ${DOCKER_IMAGE}:${TAG} ${DOCKER_IMAGE}:${BUILD_VERSION}-arm64v8 --os=linux --arch=arm64 --variant=v8
167+
168+
docker manifest push ${DOCKER_IMAGE}:${TAG}
169+
170+
- name: Docker Logout
171+
if: success() && startsWith(github.ref, 'refs/tags/v')
172+
run: |
173+
docker logout

README.md

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Table of contents
4848
* [Refresh Access Token](#refresh-access-token)
4949
* [Logout](#logout)
5050
* [Roles](#roles)
51+
* [Make Viewer endpoints public](#make-viewer-endpoints-public)
5152
* [Scripts](#scripts)
5253
* [Add Custom URL Prefix](#add-custom-url-prefix)
5354
* [Optimize Storage](#optimize-storage)
@@ -95,9 +96,9 @@ The following table shows the provided Manifest Lists.
9596

9697
| **Tag** | **allure-docker-service Base Image** |
9798
|----------------------------------------|---------------------------------------------------|
98-
| latest, 2.13.7 | frankescobar/allure-docker-service:2.13.7-amd64 |
99-
| | frankescobar/allure-docker-service:2.13.7-arm32v7 |
100-
| | frankescobar/allure-docker-service:2.13.7-arm64v8 |
99+
| latest, 2.13.8 | frankescobar/allure-docker-service:2.13.8-amd64 |
100+
| | frankescobar/allure-docker-service:2.13.8-arm32v7 |
101+
| | frankescobar/allure-docker-service:2.13.8-arm64v8 |
101102

102103
## USAGE
103104
### Generate Allure Results
@@ -687,6 +688,16 @@ If the type is not recognized it will take the default icon. You can use differe
687688
[![](resources/executor05.png)](resources/executor05.png)
688689

689690

691+
- github
692+
693+
[![](resources/executor06.png)](resources/executor06.png)
694+
695+
696+
- gitlab
697+
698+
[![](resources/executor07.png)](resources/executor07.png)
699+
700+
690701
The icons are based on the native Allure2 Framework:
691702
- https://github.com/allure-framework/allure2/tree/master/allure-generator/src/main/javascript/blocks/executor-icon
692703

@@ -706,7 +717,7 @@ You can switch the version container using `frankescobar/allure-docker-service:$
706717
Docker Compose example:
707718
```sh
708719
allure:
709-
image: "frankescobar/allure-docker-service:2.13.7"
720+
image: "frankescobar/allure-docker-service:2.13.8"
710721
```
711722
or using latest version:
712723

@@ -1111,6 +1122,21 @@ Note:
11111122
- `SECURITY_USER` & `SECURITY_VIEWER_USER` always need to be different.
11121123
- Check [Allure API](#allure-api) to see what endpoints are exclusively for the `ADMIN` role.
11131124

1125+
##### Make Viewer endpoints public
1126+
`Available from Allure Docker Service version 2.13.8`
1127+
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:
1128+
1129+
Docker Compose example:
1130+
```sh
1131+
environment:
1132+
SECURITY_USER: "my_username"
1133+
SECURITY_PASS: "my_password"
1134+
SECURITY_ENABLED: 1
1135+
MAKE_VIEWER_ENDPOINTS_PUBLIC: 1
1136+
```
1137+
Note:
1138+
- With `MAKE_VIEWER_ENDPOINTS_PUBLIC` enabled, your `viewer` user (if you have someone defined) won't have effect.
1139+
11141140
##### Scripts
11151141
- Bash script with security enabled: [allure-docker-api-usage/send_results_security.sh](allure-docker-api-usage/send_results_security.sh)
11161142
```sh
@@ -1314,7 +1340,7 @@ If you want to use docker without sudo, read following links:
13141340

13151341
### Build image
13161342
```sh
1317-
docker build -t allure-release -f docker-custom/Dockerfile.bionic-custom --build-arg ALLURE_RELEASE=2.13.7 .
1343+
docker build -t allure-release -f docker-custom/Dockerfile.bionic-custom --build-arg ALLURE_RELEASE=2.13.8 .
13181344
```
13191345
### Run container
13201346
```sh
@@ -1365,5 +1391,5 @@ docker run -d -p 5050:5050 frankescobar/allure-docker-service
13651391
```
13661392
### Download specific tagged image registered (Example)
13671393
```sh
1368-
docker run -d -p 5050:5050 frankescobar/allure-docker-service:2.13.7
1394+
docker run -d -p 5050:5050 frankescobar/allure-docker-service:2.13.8
13691395
```

0 commit comments

Comments
 (0)