Skip to content

Commit

Permalink
fix(docker-jans-monolith): add support for using /opt/dist/scripts (#…
Browse files Browse the repository at this point in the history
…4810)

Former-commit-id: 1473a39
  • Loading branch information
iromli authored May 5, 2023
1 parent 943324e commit 11dffd1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
9 changes: 7 additions & 2 deletions automation/startjanssenmonolithdemo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,16 @@ sudo apt-get update
sudo python3 -m pip install --upgrade pip
pip3 install setuptools --upgrade
pip3 install dockerfile-parse ruamel.yaml

# switching to version defined by JANS_BUILD_COMMIT
if [[ "$JANS_BUILD_COMMIT" ]]; then
python3 -c "from dockerfile_parse import DockerfileParser ; dfparser = DockerfileParser('/tmp/jans/docker-jans-monolith') ; dfparser.envs['JANS_SOURCE_VERSION'] = '$JANS_BUILD_COMMIT'"

# as JANS_SOURCE_VERSION is changed, allow docker compose to rebuild image on-the-fly
# and use the respective image instead of the default image
python3 -c "from pathlib import Path ; import ruamel.yaml ; compose = Path('/tmp/jans/docker-jans-monolith/jans-mysql-compose.yml') ; yaml = ruamel.yaml.YAML() ; data = yaml.load(compose) ; data['services']['jans']['build'] = '.' ; del data['services']['jans']['image'] ; yaml.dump(data, compose)"
python3 -c "from pathlib import Path ; import ruamel.yaml ; compose = Path('/tmp/jans/docker-jans-monolith/jans-postgres-compose.yml') ; yaml = ruamel.yaml.YAML() ; data = yaml.load(compose) ; data['services']['jans']['build'] = '.' ; del data['services']['jans']['image'] ; yaml.dump(data, compose)"
fi
python3 -c "from pathlib import Path ; import ruamel.yaml ; compose = Path('/tmp/jans/docker-jans-monolith/jans-mysql-compose.yml') ; yaml = ruamel.yaml.YAML() ; data = yaml.load(compose) ; data['services']['jans']['build'] = '.' ; del data['services']['jans']['image'] ; yaml.dump(data, compose)"
python3 -c "from pathlib import Path ; import ruamel.yaml ; compose = Path('/tmp/jans/docker-jans-monolith/jans-postgres-compose.yml') ; yaml = ruamel.yaml.YAML() ; data = yaml.load(compose) ; data['services']['jans']['build'] = '.' ; del data['services']['jans']['image'] ; yaml.dump(data, compose)"
# --
if [[ $JANS_PERSISTENCE == "MYSQL" ]]; then
docker compose -f /tmp/jans/docker-jans-monolith/jans-mysql-compose.yml up -d
Expand Down
2 changes: 1 addition & 1 deletion docker-jans-monolith/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ EXPOSE 443 8080 1636
# jans-linux-setup
# =====================

ENV JANS_SOURCE_VERSION=86c4feedd696db0271022e4de0a7ad8092d31738
ENV JANS_SOURCE_VERSION=461d96b9fda237c924d074f8ef2bbc98f19c429e

# cleanup
RUN rm -rf /tmp/jans
Expand Down
9 changes: 5 additions & 4 deletions docker-jans-monolith/scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ start_services() {
check_installed_jans
start_services

tail -f /opt/jans/jetty/jans-auth/logs/*.log \
-f /opt/jans/jetty/jans-config-api/logs/*.log \
-f /opt/jans/jetty/jans-fido2/logs/*.log \
-f /opt/jans/jetty/jans-scim/logs/*.log
# use -F option to follow (and retry) logs
tail -F /opt/jans/jetty/jans-auth/logs/*.log \
/opt/jans/jetty/jans-config-api/logs/*.log \
/opt/jans/jetty/jans-fido2/logs/*.log \
/opt/jans/jetty/jans-scim/logs/*.log

0 comments on commit 11dffd1

Please sign in to comment.