mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-14 08:53:07 -06:00
DCD-224: Inject JVM heap overrides into the product setenv script.
This commit is contained in:
@@ -45,5 +45,5 @@ atl_jdbc_ctype: "{{ lookup('env', 'ATL_JDBC_CTYPE') or 'en_US.UTF-8' }}"
|
|||||||
atl_jdbc_template: "{{ lookup('env', 'ATL_JDBC_TEMPLATE') or 'template1' }}"
|
atl_jdbc_template: "{{ lookup('env', 'ATL_JDBC_TEMPLATE') or 'template1' }}"
|
||||||
atl_jdbc_url: "jdbc:postgresql://{{ atl_db_host }}:{{ atl_db_port }}/{{ atl_jdbc_db_name }}"
|
atl_jdbc_url: "jdbc:postgresql://{{ atl_db_host }}:{{ atl_db_port }}/{{ atl_jdbc_db_name }}"
|
||||||
|
|
||||||
atl_jvm_heap: "{{ lookup('env', 'ATL_JVM_HEAP) }}"
|
atl_jvm_heap: "{{ lookup('env', 'ATL_JVM_HEAP) or '2048m' }}"
|
||||||
atl_catalina_opts: "{{ lookup('env', 'ATL_CATALINA_OPTS) }}"
|
atl_catalina_opts: "{{ lookup('env', 'ATL_CATALINA_OPTS) or '' }}"
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
atl_product_user: "jira"
|
atl_product_user: "jira"
|
||||||
atl_product_version: "7.13.2"
|
atl_product_version: "7.13.2"
|
||||||
atl_jdbc_user: 'atljira'
|
atl_jdbc_user: 'atljira'
|
||||||
|
atl_jvm_heap: 'PLACEHOLDER'
|
||||||
roles:
|
roles:
|
||||||
- role: linux_common
|
- role: linux_common
|
||||||
- role: product_common
|
- role: product_common
|
||||||
|
|||||||
@@ -6,10 +6,16 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
|||||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||||
|
|
||||||
|
|
||||||
def test_hosts_file(host):
|
def test_dbconfig_file(host):
|
||||||
f = host.file('/var/atlassian/application-data/jira/dbconfig.xml')
|
f = host.file('/var/atlassian/application-data/jira/dbconfig.xml')
|
||||||
assert f.exists
|
assert f.exists
|
||||||
assert f.user == 'jira'
|
assert f.user == 'jira'
|
||||||
assert f.contains("<driver-class>org.postgresql.Driver</driver-class>")
|
assert f.contains("<driver-class>org.postgresql.Driver</driver-class>")
|
||||||
assert f.contains("<username>atljira</username>")
|
assert f.contains("<username>atljira</username>")
|
||||||
assert f.contains("<pool-min-size>20</pool-min-size>")
|
assert f.contains("<pool-min-size>20</pool-min-size>")
|
||||||
|
|
||||||
|
def test_setenv_file(host):
|
||||||
|
f = host.file('/opt/atlassian/jira-software/current/bin/setenv.sh')
|
||||||
|
assert f.exists
|
||||||
|
assert f.contains('JVM_MINIMUM_MEMORY="PLACEHOLDER"')
|
||||||
|
assert f.contains('JVM_MAXIMUM_MEMORY="PLACEHOLDER"')
|
||||||
|
|||||||
@@ -5,3 +5,14 @@
|
|||||||
src: dbconfig.xml.j2
|
src: dbconfig.xml.j2
|
||||||
dest: "{{ atl_product_home }}/dbconfig.xml"
|
dest: "{{ atl_product_home }}/dbconfig.xml"
|
||||||
owner: "{{ atl_product_user }}"
|
owner: "{{ atl_product_user }}"
|
||||||
|
|
||||||
|
- name: Override JVM memory settings.
|
||||||
|
# Ugly but necessary as the product installs this file so we need to make the change here.
|
||||||
|
lineinfile:
|
||||||
|
path: "{{ atl_product_installation_target }}/bin/setenv.sh"
|
||||||
|
backrefs: true
|
||||||
|
regexp: "^{{ item }}="
|
||||||
|
line: "{{ item }}=\"{{ atl_jvm_heap }}\""
|
||||||
|
with_items:
|
||||||
|
- 'JVM_MINIMUM_MEMORY'
|
||||||
|
- 'JVM_MAXIMUM_MEMORY'
|
||||||
|
|||||||
Reference in New Issue
Block a user