Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow secrets to be passed in via file #188

Closed
wants to merge 11 commits into from
19 changes: 19 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: build-and-push

on:
release:
types: [created]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build and push Docker images
uses: docker/build-push-action@v1.1.0
with:
repository: jlundy2/reportportal-service-authorization
username: ${{ secrets.DOCKERHUB_USERNAME}}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
tag_with_ref: true
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM openjdk:11-jre-slim
LABEL version=5.3.1 description="Unified Authorization Trap for all ReportPortal's Services" maintainer="Andrei Varabyeu <andrei_varabyeu@epam.com>"
RUN apt-get update -qq && apt-get install -qq -y wget && \
echo 'exec java ${JAVA_OPTS} -jar service-authorization-5.3.1-exec.jar' > /start.sh && chmod +x /start.sh && \
wget -q https://dl.bintray.com/epam/reportportal/com/epam/reportportal/service-authorization/5.3.1/service-authorization-5.3.1-exec.jar
ENV JAVA_OPTS="-Xmx512m -XX:+UseG1GC -XX:InitiatingHeapOccupancyPercent=70 -Djava.security.egd=file:/dev/./urandom"
VOLUME ["/tmp"]
EXPOSE 8080
ENTRYPOINT ./start.sh
COPY entrypoint.sh ./entrypoint.sh
ENTRYPOINT ./entrypoint.sh
15 changes: 15 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

if [ ! -z $RP_DB_PASS_FILE ]; then
export RP_DB_PASS=$(cat $RP_DB_PASS_FILE)
fi

if [ ! -z $RP_BINARYSTORE_MINIO_ACCESSKEY_FILE ]; then
export RP_BINARYSTORE_MINIO_ACCESSKEY=$(cat $RP_BINARYSTORE_MINIO_ACCESSKEY_FILE)
fi

if [ ! -z $RP_BINARYSTORE_MINIO_SECRETKEY_FILE ]; then
export RP_BINARYSTORE_MINIO_SECRETKEY=$(cat $RP_BINARYSTORE_MINIO_SECRETKEY_FILE)
fi

exec java ${JAVA_OPTS} -jar service-authorization-5.2.1-exec.jar