Skip to content
This repository was archived by the owner on Jan 20, 2024. It is now read-only.

Commit 215321f

Browse files
committed
Merge branch 'develop'
2 parents 49f2c57 + 6704aad commit 215321f

File tree

122 files changed

+853
-1180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+853
-1180
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dist/
1414
*.zip
1515
*.bak
1616
*.versionsBackup
17+
dependency-reduced-pom.xml
1718

1819
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
1920
hs_err_pid*

authorize/build.sh

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,60 @@
11
#!/bin/bash
22

3+
#
4+
# Purpose: Publish docker image new tag to docker hub.
5+
#
6+
# Author: Dinesh Alapati, [email protected]
7+
#
8+
# Parameters:
9+
# $1: version
10+
#
11+
312
set -ex
413

5-
CURRENT_DIR="${PWD##*/}"
6-
IMAGE_NAME="networknt/oauth-$CURRENT_DIR"
7-
TAG="${1}"
14+
VERSION=$1
15+
IMAGE_NAME="networknt/oauth2-authorize"
16+
17+
showHelp() {
18+
echo " "
19+
echo "Error: $1"
20+
echo " "
21+
echo " build.sh [VERSION]"
22+
echo " "
23+
echo " where [VERSION] version of the docker image that you want to publish (example: 0.0.1)"
24+
echo " "
25+
echo " example 1: ./build.sh 0.0.1"
26+
echo " "
27+
}
28+
29+
build() {
30+
echo "Building ..."
31+
mvn clean install
32+
echo "Successfully built!"
33+
}
34+
35+
cleanup() {
36+
if [[ "$(docker images -q $IMAGE_NAME 2> /dev/null)" != "" ]]; then
37+
echo "Removing old $IMAGE_NAME images"
38+
docker images | grep $IMAGE_NAME | awk '{print $3}' | xargs docker rmi -f
39+
echo "Cleanup completed!"
40+
fi
41+
}
42+
43+
publish() {
44+
echo "Building Docker image with version $VERSION"
45+
docker build -t $IMAGE_NAME:$VERSION -t $IMAGE_NAME:latest -f ./docker/Dockerfile . --no-cache=true
46+
docker build -t $IMAGE_NAME:$VERSION-redhat -f ./docker/Dockerfile-Redhat . --no-cache=true
47+
echo "Images built with version $VERSION"
48+
echo "Pushing image to DockerHub"
49+
docker push $IMAGE_NAME
50+
echo "Image successfully published!"
51+
}
852

9-
if docker inspect ${IMAGE_NAME} &> /dev/null; then
10-
docker rmi -f ${IMAGE_NAME}:latest
11-
docker rmi -f ${IMAGE_NAME}:${TAG}
53+
if [ -z $VERSION ]; then
54+
showHelp "[VERSION] parameter is missing"
55+
exit
1256
fi
1357

14-
docker build -t ${IMAGE_NAME} .
15-
docker tag ${IMAGE_NAME} ${IMAGE_NAME}:latest
16-
docker tag ${IMAGE_NAME} ${IMAGE_NAME}:${TAG}
17-
docker push ${IMAGE_NAME}
58+
build;
59+
cleanup;
60+
publish;

authorize/dependency-reduced-pom.xml

Lines changed: 0 additions & 77 deletions
This file was deleted.
File renamed without changes.

authorize/docker/Dockerfile-Redhat

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift
2+
3+
USER root
4+
5+
ENV APP_DIR=/app \
6+
GROUP_NAME=networknt \
7+
GROUP_ID=1000 \
8+
USER_NAME=networknt \
9+
USER_UID=1000
10+
11+
RUN groupadd -g ${GROUP_ID} -r ${GROUP_NAME} && \
12+
useradd -u ${USER_UID} -g ${GROUP_NAME} -d "${APP_DIR}" -s /sbin/nologin -c "${USER_NAME} user" ${USER_NAME}
13+
14+
# Add the jar file into the container at /app
15+
ADD target/oauth2-authorize.jar ${APP_DIR}/server.jar
16+
17+
# change permissions of app directory
18+
RUN chown -R ${USER_NAME}:${GROUP_NAME} "${APP_DIR}"
19+
20+
# Port available to the world outside of this container
21+
EXPOSE 6881
22+
23+
USER ${USER_UID}
24+
25+
# Set the working directory to /app
26+
WORKDIR ${APP_DIR}
27+
28+
CMD ["/bin/sh","-c","java -Dlight-4j-config-dir=/config -Dlogback.configurationFile=/config/logback.xml -jar server.jar"]

authorize/src/main/resources/config/service.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)