mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 16:33:08 -06:00
Merged in DCD-434-bb-jvm-args (pull request #8)
DCD-434: Add support for JVM parameters in BB roles. Approved-by: Ben Partridge <bpartridge@atlassian.com>
This commit is contained in:
@@ -17,6 +17,9 @@
|
|||||||
- "UMask=0027"
|
- "UMask=0027"
|
||||||
- "LimitNOFILE=4096"
|
- "LimitNOFILE=4096"
|
||||||
- "Environment=BITBUCKET_HOME={{ atl_product_home }}"
|
- "Environment=BITBUCKET_HOME={{ atl_product_home }}"
|
||||||
|
- "Environment=JVM_MAXIMUM_MEMORY={{ atl_jvm_heap }}"
|
||||||
|
- "Environment=JVM_MINIMUM_MEMORY={{ atl_jvm_heap }}"
|
||||||
|
- "Environment=JVM_SUPPORT_RECOMMENDED_ARGS={{ atl_jvm_opts }}"
|
||||||
atl_startup_exec_options:
|
atl_startup_exec_options:
|
||||||
- "-fg"
|
- "-fg"
|
||||||
- "--no-search"
|
- "--no-search"
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ atl_jdbc_query_params_for_engine:
|
|||||||
atl_jdbc_url: "jdbc:postgresql://{{ atl_db_host }}:{{ atl_db_port }}/{{ atl_jdbc_db_name }}{{ atl_jdbc_query_params_for_engine[atl_db_engine]| default('') }}"
|
atl_jdbc_url: "jdbc:postgresql://{{ atl_db_host }}:{{ atl_db_port }}/{{ atl_jdbc_db_name }}{{ atl_jdbc_query_params_for_engine[atl_db_engine]| default('') }}"
|
||||||
|
|
||||||
atl_jvm_heap: "{{ lookup('env', 'ATL_JVM_HEAP') or '2048m' }}"
|
atl_jvm_heap: "{{ lookup('env', 'ATL_JVM_HEAP') or '2048m' }}"
|
||||||
|
atl_jvm_opts: "{{ lookup('env', 'ATL_JVM_OPTS') or '' }}"
|
||||||
atl_catalina_opts: "{{ lookup('env', 'ATL_CATALINA_OPTS') or '' }}"
|
atl_catalina_opts: "{{ lookup('env', 'ATL_CATALINA_OPTS') or '' }}"
|
||||||
atl_proxy_name: "{{ lookup('env', 'ATL_PROXY_NAME') | lower }}"
|
atl_proxy_name: "{{ lookup('env', 'ATL_PROXY_NAME') | lower }}"
|
||||||
atl_proxy_port: "{{ lookup('env', 'ATL_TOMCAT_PROXYPORT') }}"
|
atl_proxy_port: "{{ lookup('env', 'ATL_TOMCAT_PROXYPORT') }}"
|
||||||
|
|||||||
14
roles/bitbucket_config/molecule/default/Dockerfile.j2
Normal file
14
roles/bitbucket_config/molecule/default/Dockerfile.j2
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# Molecule managed
|
||||||
|
|
||||||
|
{% if item.registry is defined %}
|
||||||
|
FROM {{ item.registry.url }}/{{ item.image }}
|
||||||
|
{% else %}
|
||||||
|
FROM {{ item.image }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
|
||||||
|
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
|
||||||
|
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
|
||||||
|
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
|
||||||
|
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
|
||||||
|
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi
|
||||||
36
roles/bitbucket_config/molecule/default/molecule.yml
Normal file
36
roles/bitbucket_config/molecule/default/molecule.yml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
---
|
||||||
|
dependency:
|
||||||
|
name: galaxy
|
||||||
|
driver:
|
||||||
|
name: docker
|
||||||
|
lint:
|
||||||
|
name: yamllint
|
||||||
|
platforms:
|
||||||
|
- name: amazon_linux2
|
||||||
|
image: amazonlinux:2
|
||||||
|
groups:
|
||||||
|
- aws_node_local
|
||||||
|
ulimits:
|
||||||
|
- nofile:262144:262144
|
||||||
|
- name: ubuntu_lts
|
||||||
|
image: ubuntu:bionic
|
||||||
|
groups:
|
||||||
|
- aws_node_local
|
||||||
|
ulimits:
|
||||||
|
- nofile:262144:262144
|
||||||
|
provisioner:
|
||||||
|
name: ansible
|
||||||
|
options:
|
||||||
|
skip-tags: runtime_pkg
|
||||||
|
lint:
|
||||||
|
name: ansible-lint
|
||||||
|
options:
|
||||||
|
x: ["701"]
|
||||||
|
inventory:
|
||||||
|
links:
|
||||||
|
group_vars: ../../../../group_vars/
|
||||||
|
verifier:
|
||||||
|
name: testinfra
|
||||||
|
lint:
|
||||||
|
name: flake8
|
||||||
|
enabled: false
|
||||||
19
roles/bitbucket_config/molecule/default/playbook.yml
Normal file
19
roles/bitbucket_config/molecule/default/playbook.yml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
- name: Converge
|
||||||
|
hosts: all
|
||||||
|
vars:
|
||||||
|
atl_product_family: "stash"
|
||||||
|
atl_product_edition: "bitbucket"
|
||||||
|
atl_product_user: "bitbucket"
|
||||||
|
atl_product_version: "6.3.1"
|
||||||
|
|
||||||
|
atl_product_home: "{{ atl_shared_mountpoint }}/{{ atl_product_edition }}"
|
||||||
|
|
||||||
|
atl_jdbc_user: 'bb_db_user'
|
||||||
|
atl_jdbc_password: 'molecule_password'
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- role: linux_common
|
||||||
|
- role: product_common
|
||||||
|
- role: product_install
|
||||||
|
- role: bitbucket_config
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
import testinfra.utils.ansible_runner
|
||||||
|
|
||||||
|
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||||
|
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||||
|
|
||||||
|
|
||||||
|
def test_config_file(host):
|
||||||
|
f = host.file('/media/atl/bitbucket/shared/bitbucket.properties')
|
||||||
|
assert f.exists
|
||||||
|
assert f.user == 'bitbucket'
|
||||||
|
|
||||||
|
assert f.contains("jdbc.driver=org.postgresql.Driver")
|
||||||
|
assert f.contains("jdbc.user=bb_db_user")
|
||||||
|
assert f.contains("jdbc.password=molecule_password")
|
||||||
@@ -22,3 +22,4 @@
|
|||||||
group: "root"
|
group: "root"
|
||||||
mode: "u=rwX,g=rX,o=rX"
|
mode: "u=rwX,g=rX,o=rX"
|
||||||
recurse: true
|
recurse: true
|
||||||
|
changed_when: false # For Molecule idempotence check
|
||||||
|
|||||||
@@ -13,8 +13,7 @@ def test_user_created(host):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('exe', [
|
@pytest.mark.parametrize('exe', [
|
||||||
'/usr/bin/git',
|
'/usr/bin/git'
|
||||||
'/usr/bin/psql'
|
|
||||||
])
|
])
|
||||||
def test_package_exes(host, exe):
|
def test_package_exes(host, exe):
|
||||||
assert host.file(exe).exists
|
assert host.file(exe).exists
|
||||||
|
|||||||
@@ -8,11 +8,16 @@
|
|||||||
|
|
||||||
atl_product_home: "{{ atl_shared_mountpoint }}/{{ atl_product_edition }}"
|
atl_product_home: "{{ atl_shared_mountpoint }}/{{ atl_product_edition }}"
|
||||||
atl_product_home_shared: "{{ atl_product_home }}/shared"
|
atl_product_home_shared: "{{ atl_product_home }}/shared"
|
||||||
|
atl_jvm_heap: "dummy_heap"
|
||||||
|
atl_jvm_opts: "dummy_opts"
|
||||||
|
|
||||||
atl_startup_systemd_params:
|
atl_startup_systemd_params:
|
||||||
- "UMask=0027"
|
- "UMask=0027"
|
||||||
- "LimitNOFILE=4096"
|
- "LimitNOFILE=4096"
|
||||||
- "Environment=BITBUCKET_HOME={{ atl_product_home }}"
|
- "Environment=BITBUCKET_HOME={{ atl_product_home }}"
|
||||||
|
- "Environment=JVM_MAXIMUM_MEMORY={{ atl_jvm_heap }}"
|
||||||
|
- "Environment=JVM_MINIMUM_MEMORY={{ atl_jvm_heap }}"
|
||||||
|
- "Environment=JVM_SUPPORT_RECOMMENDED_ARGS={{ atl_jvm_opts }}"
|
||||||
|
|
||||||
atl_startup_exec_options:
|
atl_startup_exec_options:
|
||||||
- "-fg"
|
- "-fg"
|
||||||
|
|||||||
@@ -12,3 +12,6 @@ def test_service_file(host):
|
|||||||
assert f.contains("^UMask=0027$")
|
assert f.contains("^UMask=0027$")
|
||||||
assert f.contains("^LimitNOFILE=4096$")
|
assert f.contains("^LimitNOFILE=4096$")
|
||||||
assert f.contains("^Environment=BITBUCKET_HOME=/media/atl/bitbucket$")
|
assert f.contains("^Environment=BITBUCKET_HOME=/media/atl/bitbucket$")
|
||||||
|
assert f.contains("^Environment=JVM_MINIMUM_MEMORY=dummy_heap$")
|
||||||
|
assert f.contains("^Environment=JVM_MAXIMUM_MEMORY=dummy_heap$")
|
||||||
|
assert f.contains("^Environment=JVM_SUPPORT_RECOMMENDED_ARGS=dummy_opts$")
|
||||||
|
|||||||
Reference in New Issue
Block a user