#!/usr/bin/python3 -B

from entrypoint_helpers import env, gen_cfg, str2bool, start_app

RUN_USER = env['run_user']
RUN_GROUP = env['run_group']
CONFLUENCE_INSTALL_DIR = env['confluence_install_dir']
CONFLUENCE_HOME = env['confluence_home']

gen_cfg('server.xml.j2', f'{CONFLUENCE_INSTALL_DIR}/conf/server.xml')
gen_cfg(
    'seraph-config.xml.j2',
    f'{CONFLUENCE_INSTALL_DIR}/confluence/WEB-INF/classes/seraph-config.xml')
gen_cfg(
    'confluence-init.properties.j2',
    f'{CONFLUENCE_INSTALL_DIR}/confluence/WEB-INF/classes/confluence-init.properties'
)
gen_cfg('confluence.cfg.xml.j2',
        f'{CONFLUENCE_HOME}/confluence.cfg.xml',
        user=RUN_USER,
        group=RUN_GROUP,
        overwrite=False)

start_app(f'{CONFLUENCE_INSTALL_DIR}/bin/start-confluence.sh -fg',
          CONFLUENCE_HOME,
          name='Confluence')
Exemple #2
0
#!/usr/bin/python3

from entrypoint_helpers import env, gen_cfg

print("Python is running!")

CATALINA_HOME = env['catalina_home']

print("Generating server.xml file")
gen_cfg('server.xml.j2', f'{CATALINA_HOME}/conf/server.xml')
#!/usr/bin/python3

from entrypoint_helpers import env, gen_cfg

HOME = env["HOME"]

# Setting Logging Format
gen_cfg("license-manager-log4j2.xml.j2", "{}/conf/license-manager/log4j2.xml".format(HOME))
gen_cfg("solution-manager-log4j2.xml.j2", "{}/conf/solution-manager/log4j2.xml".format(HOME))
gen_cfg("db-tools-log4j2.xml.j2", "{}/conf/db-tools/log4j2.xml".format(HOME))
gen_cfg("vdp-log4j2.xml.j2", "{}/conf/vdp/log4j2.xml".format(HOME))
gen_cfg("denodo-sso-log4j2.xml.j2", "{}/resources/apache-tomcat/webapps/sso/WEB-INF/classes/log4j2.xml".format(HOME))
gen_cfg("solution-manager-web-tool-log4j2.xml.j2", "{}/resources/apache-tomcat/webapps/solution-manager-web-tool/WEB-INF/classes/log4j2.xml".format(HOME))
gen_cfg("denodo-design-studio-log4j2.xml.j2", "{}/resources/apache-tomcat/webapps/denodo-design-studio/WEB-INF/classes/log4j2.xml".format(HOME))
gen_cfg("diagnostic-monitoring-tool-log4j2.xml.j2", "{}/resources/apache-tomcat/webapps/diagnostic-monitoring-tool/WEB-INF/classes/log4j2.xml".format(HOME))
gen_cfg("denodo-scheduler-admin-log4j2.xml.j2", "{}/resources/apache-tomcat/webapps/webadmin#denodo-scheduler-admin/WEB-INF/classes/log4j2.xml".format(HOME))
gen_cfg("apache-tomcat-log4j2.xml.j2", "{}/resources/apache-tomcat/lib/log4j2.xml".format(HOME))
gen_cfg("apache-tomcat-logging.properties.j2", "{}/resources/apache-tomcat/conf/logging.properties".format(HOME))
#!/usr/bin/python3

import shutil
from entrypoint_helpers import env, gen_cfg

SSO_ENABLED = env['sso_enabled']

print("Checking for SSO env variable")
if SSO_ENABLED.lower() == 'true':
    print("Copying SSO related files")
    gen_cfg('login.ftl.j2', '/opt/atlassian/bamboo/atlassian-bamboo/login.ftl')
    shutil.copyfile("/opt/atlassian/sso/seraph-config.xml",
                    "/opt/atlassian/bamboo/atlassian-bamboo/WEB-INF/classes/seraph-config.xml")
    shutil.copyfile("/opt/atlassian/sso/crowd.properties",
                    "/var/atlassian/application-data/bamboo/xml-data/configuration/crowd.properties")

BAMBOO_INSTALL_DIR = env['bamboo_install_dir']

print("Generating server.xml file")
gen_cfg('server.xml.j2', f'{BAMBOO_INSTALL_DIR}/conf/server.xml')
Exemple #5
0
    shutil.copyfile(PG_SSL_KEY_FILE, f'{PG_CONFIG_DIR}/server.key')
    shutil.copyfile(PG_SSL_CERT_FILE, f'{PG_CONFIG_DIR}/server.crt')
    shutil.copyfile(PG_SSL_CA_FILE, f'{PG_CONFIG_DIR}/root.crt')

    set_perms(f'{PG_CONFIG_DIR}/server.key',
              user=RUN_USER,
              group=RUN_GROUP,
              mode=0o600)
    set_perms(f'{PG_CONFIG_DIR}/server.crt',
              user=RUN_USER,
              group=RUN_GROUP,
              mode=0o600)
    set_perms(f'{PG_CONFIG_DIR}/root.crt',
              user=RUN_USER,
              group=RUN_GROUP,
              mode=0o600)
except:
    print("no certificate")

set_ownership(f'{PG_CONFIG_DIR}', user=RUN_USER, group=RUN_GROUP)
set_ownership(f'{PG_DATA}', user=RUN_USER, group=RUN_GROUP)
set_ownership('/var/log/patroni', user=RUN_USER, group=RUN_GROUP)

gen_cfg('patroni.yml.j2',
        f'{PG_CONFIG_DIR}/patroni.yml',
        user=RUN_USER,
        group=RUN_GROUP,
        mode=0o640,
        overwrite=False)

start_app(f'patroni {PG_CONFIG_DIR}/patroni.yml', PG_DATA, 'patroni')
Exemple #6
0
from entrypoint_helpers import env, gen_cfg, gen_container_id, str2bool, start_app

RUN_USER = env['run_user']
RUN_GROUP = env['run_group']
JIRA_INSTALL_DIR = env['jira_install_dir']
JIRA_HOME = env['jira_home']

# Getting the current pod IP and assign it to an ENV variable
current_pod_ip = sp.getoutput('hostname -i')

gen_container_id()
if os.stat('/etc/container_id').st_size == 0:
    gen_cfg('container_id.j2',
            '/etc/container_id',
            user=RUN_USER,
            group=RUN_GROUP,
            overwrite=True)
gen_cfg('server.xml.j2', f'{JIRA_INSTALL_DIR}/conf/server.xml')
gen_cfg('dbconfig.xml.j2',
        f'{JIRA_HOME}/dbconfig.xml',
        user=RUN_USER,
        group=RUN_GROUP,
        overwrite=False)
if str2bool(env.get('clustered')):
    gen_cfg('cluster.properties.j2',
            f'{JIRA_HOME}/cluster.properties',
            user=RUN_USER,
            group=RUN_GROUP,
            overwrite=True)
Exemple #7
0
            shutil.copytree(other_pod_home_path, home_dir_path)
        else:
            os.makedirs(home_dir_path)

    add_cluster_file(home_dir_name, home_dir_path)
    if os.path.exists(os.path.join(home_dir_path, jira_home_lock_file_name)):
        os.remove(os.path.join(home_dir_path, jira_home_lock_file_name))

    return home_dir_path


JIRA_HOME = select_home_dir()
os.environ["jira_home"] = JIRA_HOME
os.environ["JIRA_HOME"] = JIRA_HOME
gen_container_id()
if os.stat('/etc/container_id').st_size == 0:
    gen_cfg('container_id.j2', '/etc/container_id',
            user=RUN_USER, group=RUN_GROUP, overwrite=True)
gen_cfg('server.xml.j2', f'{JIRA_INSTALL_DIR}/conf/server.xml')
gen_cfg('seraph-config.xml.j2',
        f'{JIRA_INSTALL_DIR}/atlassian-jira/WEB-INF/classes/seraph-config.xml')
gen_cfg('dbconfig.xml.j2', f'{JIRA_HOME}/dbconfig.xml',
        user=RUN_USER, group=RUN_GROUP, overwrite=False)
# if str2bool(env.get('clustered')):
#gen_cfg('cluster.properties.j2', f'{JIRA_HOME}/cluster.properties', user=RUN_USER, group=RUN_GROUP, overwrite=False)
#os.system('sh /var/atlassian/application-data/jira-main-home.sh')
#os.system('sh /var/atlassian/application-data/mkdir-home3.sh')
#os.system('sh /var/atlassian/application-data/mkdir-home.sh')

start_app(f'{JIRA_INSTALL_DIR}/bin/start-jira.sh -fg', JIRA_HOME, name='Jira')
Exemple #8
0
#!/usr/bin/python3

import os

from entrypoint_helpers import env, gen_cfg, gen_container_id, str2bool, start_app


RUN_USER = env['run_user']
RUN_GROUP = env['run_group']
CROWD_INSTALL_DIR = env['crowd_install_dir']
CROWD_HOME = env['crowd_home']

gen_cfg('server.xml.j2', f'{CROWD_INSTALL_DIR}/apache-tomcat/conf/server.xml')
gen_cfg('crowd-init.properties.j2', f'{CROWD_INSTALL_DIR}/crowd-webapp/WEB-INF/classes/crowd-init.properties')

start_app(f'{CROWD_INSTALL_DIR}/start-crowd.sh -fg', CROWD_HOME, name='Crowd')
Exemple #9
0
#!/usr/bin/python3

import shutil
from entrypoint_helpers import env, gen_cfg, str2bool, start_app

SSO_ENABLED = env['sso_enabled']

print("Checking for SSO env variable")
if SSO_ENABLED.lower() == 'true':
    print("Copying SSO related files")
    gen_cfg('login.soy.j2', '/opt/atlassian/bitbucket/app/static/bitbucket/internal/page/login/login.soy')
    shutil.copyfile("/opt/atlassian/sso/bitbucket.properties",
                    "/var/atlassian/application-data/bitbucket/shared/bitbucket.properties")
else:
    # Bitbucket seems to enable SSO when Crowd directory is configured.
    # I'm going to leave the enabled properties file just in-case Atlassian breaks it later.
    shutil.copyfile("/opt/atlassian/sso/bitbucket_sso_disabled.properties",
                    "/var/atlassian/application-data/bitbucket/shared/bitbucket.properties")

RUN_USER = env['run_user']
RUN_GROUP = env['run_group']
BITBUCKET_INSTALL_DIR = env['bitbucket_install_dir']
BITBUCKET_HOME = env['bitbucket_home']

start_cmd = f"{BITBUCKET_INSTALL_DIR}/bin/start-bitbucket.sh -fg"
if str2bool(env['elasticsearch_enabled']) is False or env['application_mode'] == 'mirror':
    start_cmd += ' --no-search'

start_app(start_cmd, BITBUCKET_HOME, name='Bitbucket Server')
#!/usr/bin/python3

from entrypoint_helpers import env, gen_cfg, gen_container_id, start_app

RUN_USER = env['run_user']
RUN_GROUP = env['run_group']
CROWD_INSTALL_DIR = env['crowd_install_dir']
CROWD_HOME = env['crowd_home']

gen_cfg('server.xml.j2', f'{CROWD_INSTALL_DIR}/apache-tomcat/conf/server.xml')

start_app(f'{CROWD_INSTALL_DIR}/start_crowd.sh -fg', CROWD_HOME, name='Crowd')
Exemple #11
0
#!/usr/bin/python3

from entrypoint_helpers import env, gen_cfg, gen_container_id, str2bool, start_app


RUN_USER = env['run_user']
RUN_GROUP = env['run_group']
FISHEYE_INSTALL_DIR = env['fisheye_install_dir']
FISHEYE_HOME = env['fisheye_inst']

gen_cfg('config.xml.j2', f'{FISHEYE_HOME}/config.xml', user=RUN_USER, group=RUN_GROUP, overwrite=False)

start_app(f"{FISHEYE_INSTALL_DIR}/bin/fisheyectl.sh run", FISHEYE_HOME, name='Fisheye Server')
#!/usr/bin/python2

from entrypoint_helpers import env, gen_cfg, set_props

HOME = env["HOME"]

gen_cfg("SolutionManager.properties.j2",
        "{}/conf/SolutionManager.properties".format(HOME))
gen_cfg("VDBConfiguration.properties.j2",
        "{}/conf/vdp/VDBConfiguration.properties".format(HOME))
gen_cfg("SchedulerConfigurationParameters.properties.j2",
        "{}/conf/scheduler/ConfigurationParameters.properties".format(HOME))
gen_cfg("SchedulerIndexConfigurationParameters.properties.j2",
        "{}/conf/arn-index/ConfigurationParameters.properties".format(HOME))
gen_cfg("tomcat.properties.j2",
        "{}/resources/apache-tomcat/conf/tomcat.properties".format(HOME))
gen_cfg("server.xml.j2",
        "{}/resources/apache-tomcat/conf/server.xml".format(HOME))