Skip to content

Commit

Permalink
Merge pull request #1064 from JanssenProject/jans-linux-setup-enhance…
Browse files Browse the repository at this point in the history
…ments

feat: jans-linux-setup enhancements
  • Loading branch information
devrimyatar authored Mar 17, 2022
2 parents e26e826 + b16b77d commit cefc170
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import argparse

from setup_app.version import __version__
from setup_app.utils import base

parser_description='''Use setup.py to configure your Jans Server and to add initial data required for
Expand All @@ -8,6 +9,7 @@
'''

parser = argparse.ArgumentParser(description=parser_description)
parser.add_argument('--version', action='version', version='%(prog)s ' + __version__)
parser.add_argument('-c', help="Use command line instead of tui", action='store_true')
parser.add_argument('-d', help="Installation directory")
parser.add_argument('-n', help="No interactive prompt before install starts", action='store_true')
Expand Down
16 changes: 16 additions & 0 deletions jans-linux-setup/jans_setup/setup_app/installers/jans.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import re
import requests
import zipfile
import site

from pathlib import Path

Expand Down Expand Up @@ -468,3 +469,18 @@ def post_install_tasks(self):
cron_service = 'crond' if base.os_type in ['centos', 'red', 'fedora'] else 'cron'
self.restart(cron_service)


# if we are running inside shiv package, copy site pacakages to /opt/dist/jans-setup-packages and add to sys path

gluu_site_dir = '/opt/dist/jans-setup-packages'

for p in sys.path:
ps = str(p)
if '/.shiv/' in ps and ps.endswith('site-packages'):
if not gluu_site_dir in sys.path:
if not os.path.exists(site.USER_SITE):
os.makedirs(site.USER_SITE)
with open(os.path.join(site.USER_SITE, 'jans_setup_site.pth'), 'w') as site_file:
site_file.write(gluu_site_dir)
self.logIt("Copying site packages to {}".format(gluu_site_dir))
shutil.copytree(p, gluu_site_dir, dirs_exist_ok=True)
2 changes: 2 additions & 0 deletions jans-linux-setup/jans_setup/setup_app/utils/arg_parser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import argparse

from setup_app.version import __version__
from setup_app.utils import base

parser_description='''Use this script to configure your Jans Server and to add initial data required for
Expand All @@ -8,6 +9,7 @@
'''

parser = argparse.ArgumentParser(description=parser_description)
parser.add_argument('--version', action='version', version='%(prog)s ' + __version__)
parser.add_argument('-c', help="Use command line instead of tui", action='store_true')
parser.add_argument('-d', help="Installation directory")
parser.add_argument('-f', help="Specify setup.properties file")
Expand Down

0 comments on commit cefc170

Please # to comment.