summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Konstanski <ckonstanski@pippiandcarlos.com>2017-12-08 07:29:43 -0700
committerCarlos Konstanski <ckonstanski@pippiandcarlos.com>2017-12-08 07:29:43 -0700
commit85721c5bb09028974a724a43849f7291bc5f719d (patch)
treedc1b8ee2bc7516846f0f5556b23cc423324c26af
parent2bc881db007a02995d0a09ed5d1303d00d120418 (diff)
debug support integrated into jenkins
Issue: IS-44
-rw-r--r--jjb/yaml/pippiandcarlos.com/ob-ctl.yaml6
-rw-r--r--jjb/yaml/verizoncloudplatform.com/ob-ctl.yaml6
-rw-r--r--salt/openbook/ansible/files/ob-ctl.sh3
-rw-r--r--salt/openbook/ansible/files/openbook_stop_start.yaml1
-rw-r--r--salt/openbook/ansible/files/stop_start_openbook.yaml9
-rw-r--r--salt/openbook/ci/files/openbook.gentoo8
-rw-r--r--salt/openbook/ci/files/openbook.redhat3
-rw-r--r--salt/openbook/ci/files/openbook.ubuntu3
-rw-r--r--salt/openbook/ci/files/openbookctl20
9 files changed, 46 insertions, 13 deletions
diff --git a/jjb/yaml/pippiandcarlos.com/ob-ctl.yaml b/jjb/yaml/pippiandcarlos.com/ob-ctl.yaml
index 37ac158..1fd354b 100644
--- a/jjb/yaml/pippiandcarlos.com/ob-ctl.yaml
+++ b/jjb/yaml/pippiandcarlos.com/ob-ctl.yaml
@@ -55,6 +55,10 @@
- "ob-deploy-branch.*"
block_level: 'GLOBAL'
queue-scanning: 'BUILDABLE'
+ parameters:
+ - string:
+ name: OPENBOOK_JAVA_OPTS
+ description: "Command-line options to the java container docker scripts"
scm:
- git:
url: git@pippiandcarlos.com:repos/openbook-v4-installer.git
@@ -62,4 +66,4 @@
- master
builders:
- shell: |
- ./ob-ctl.sh {branch} {action}
+ ./ob-ctl.sh {branch} {action} ${{OPENBOOK_JAVA_OPTS}}
diff --git a/jjb/yaml/verizoncloudplatform.com/ob-ctl.yaml b/jjb/yaml/verizoncloudplatform.com/ob-ctl.yaml
index b12ec55..62e58b3 100644
--- a/jjb/yaml/verizoncloudplatform.com/ob-ctl.yaml
+++ b/jjb/yaml/verizoncloudplatform.com/ob-ctl.yaml
@@ -55,6 +55,10 @@
- "ob-deploy-branch.*"
block_level: 'GLOBAL'
queue-scanning: 'BUILDABLE'
+ parameters:
+ - string:
+ name: OPENBOOK_JAVA_OPTS
+ description: "Command-line options to the java container docker scripts"
scm:
- git:
url: git@github.vcp.vzwnet.com:konstca/openbook-v4-installer.git
@@ -62,4 +66,4 @@
- master
builders:
- shell: |
- ./ob-ctl.sh {branch} {action}
+ ./ob-ctl.sh {branch} {action} ${{OPENBOOK_JAVA_OPTS}}
diff --git a/salt/openbook/ansible/files/ob-ctl.sh b/salt/openbook/ansible/files/ob-ctl.sh
index 6a2a108..7e3a357 100644
--- a/salt/openbook/ansible/files/ob-ctl.sh
+++ b/salt/openbook/ansible/files/ob-ctl.sh
@@ -2,6 +2,7 @@
branch="${1}"
action="${2}"
+extra_args="${3}"
buildroot="$(pwd)"
pushd ${buildroot}/conf
@@ -10,5 +11,5 @@ rm -f env.yaml
ln -s env.yaml.openbook env.yaml
popd
pushd ${buildroot}
-ansible-playbook -i inventory_json_${branch}.rb -e "action=${action}" openbook_stop_start.yaml
+ansible-playbook -i inventory_json_${branch}.rb -e "action=${action} extra_args=${extra_args}" openbook_stop_start.yaml
popd
diff --git a/salt/openbook/ansible/files/openbook_stop_start.yaml b/salt/openbook/ansible/files/openbook_stop_start.yaml
index 045f7a9..8eb2437 100644
--- a/salt/openbook/ansible/files/openbook_stop_start.yaml
+++ b/salt/openbook/ansible/files/openbook_stop_start.yaml
@@ -4,6 +4,7 @@
#
# Required variables to be passed in the command line via -e:
# action=[stop|start|restart]
+# extra_args=<extra_args>
###
- name: "Stop/Start Openbook"
diff --git a/salt/openbook/ansible/files/stop_start_openbook.yaml b/salt/openbook/ansible/files/stop_start_openbook.yaml
index 376d1f5..c34a7ff 100644
--- a/salt/openbook/ansible/files/stop_start_openbook.yaml
+++ b/salt/openbook/ansible/files/stop_start_openbook.yaml
@@ -3,7 +3,8 @@
hosts: localhost
tasks:
- name: "Check that -e 'action=[stop|start|restart]' was passed in"
- fail: msg="The variable 'action' was not passed in with a value of 'stop', 'start' or 'restart' on the command line."
+ fail:
+ msg: "The variable 'action' was not passed in with a value of 'stop', 'start' or 'restart' on the command line."
when: action not in ["stop", "start", "restart"]
- name: "Stop Openbook"
@@ -25,4 +26,8 @@
tasks:
- name: "Start Openbook"
shell: /etc/init.d/openbook start
- when: action in ["start", "restart"]
+ when: action in ["start", "restart"] and extra_args != "debug"
+
+ - name: "Start Openbook in debug mode"
+ shell: /etc/init.d/openbook debug
+ when: action in ["start", "restart"] and extra_args == "debug"
diff --git a/salt/openbook/ci/files/openbook.gentoo b/salt/openbook/ci/files/openbook.gentoo
index 4a639d4..62dd27a 100644
--- a/salt/openbook/ci/files/openbook.gentoo
+++ b/salt/openbook/ci/files/openbook.gentoo
@@ -1,6 +1,6 @@
#!/sbin/openrc-run
-extra_commands=test_database
+extra_commands="debug test_database"
depend() {
need docker
@@ -12,6 +12,12 @@ start() {
eend $?
}
+debug() {
+ ebegin "Starting Openbook in debug mode"
+ {{ pillar["ansible"]["dirs"]["output"]["name"] }}/{{ pillar["ci"]["files"]["openbookctl"]["name"] }} debug
+ eend $?
+}
+
stop() {
ebegin "Stopping Openbook"
{{ pillar["ansible"]["dirs"]["output"]["name"] }}/{{ pillar["ci"]["files"]["openbookctl"]["name"] }} stop
diff --git a/salt/openbook/ci/files/openbook.redhat b/salt/openbook/ci/files/openbook.redhat
index 571894a..5f3f934 100644
--- a/salt/openbook/ci/files/openbook.redhat
+++ b/salt/openbook/ci/files/openbook.redhat
@@ -17,6 +17,9 @@ case $1 in
start*)
{{ pillar["ansible"]["dirs"]["output"]["name"] }}/{{ pillar["ci"]["files"]["openbookctl"]["name"] }} start
;;
+ debug*)
+ {{ pillar["ansible"]["dirs"]["output"]["name"] }}/{{ pillar["ci"]["files"]["openbookctl"]["name"] }} debug
+ ;;
stop*)
{{ pillar["ansible"]["dirs"]["output"]["name"] }}/{{ pillar["ci"]["files"]["openbookctl"]["name"] }} stop
;;
diff --git a/salt/openbook/ci/files/openbook.ubuntu b/salt/openbook/ci/files/openbook.ubuntu
index cda042d..6c50c76 100644
--- a/salt/openbook/ci/files/openbook.ubuntu
+++ b/salt/openbook/ci/files/openbook.ubuntu
@@ -13,6 +13,9 @@ case $1 in
start*)
{{ pillar["ansible"]["dirs"]["output"]["name"] }}/{{ pillar["ci"]["files"]["openbookctl"]["name"] }} start
;;
+ debug*)
+ {{ pillar["ansible"]["dirs"]["output"]["name"] }}/{{ pillar["ci"]["files"]["openbookctl"]["name"] }} debug
+ ;;
stop*)
{{ pillar["ansible"]["dirs"]["output"]["name"] }}/{{ pillar["ci"]["files"]["openbookctl"]["name"] }} stop
;;
diff --git a/salt/openbook/ci/files/openbookctl b/salt/openbook/ci/files/openbookctl
index 57aefb4..6a8aa5e 100644
--- a/salt/openbook/ci/files/openbookctl
+++ b/salt/openbook/ci/files/openbookctl
@@ -38,25 +38,25 @@ do_start() {
ensure_openbook_databases_created
{% raw %}{% endif %}{% endraw %}
{% raw %}{% if "True" == openbook_install_job_scheduler_server|string() %}{% endraw %}
- {{ pillar["ansible"]["dirs"]["output"]["name"] }}/job_scheduler_server/run.sh
+ {{ pillar["ansible"]["dirs"]["output"]["name"] }}/job_scheduler_server/run.sh ${@}
{% raw %}{% endif %}{% endraw %}
{% raw %}{% if "True" == openbook_install_workflow_server|string() %}{% endraw %}
- {{ pillar["ansible"]["dirs"]["output"]["name"] }}/workflow_server/run.sh
+ {{ pillar["ansible"]["dirs"]["output"]["name"] }}/workflow_server/run.sh ${@}
{% raw %}{% endif %}{% endraw %}
{% raw %}{% if "True" == openbook_install_admin_api_server|string() %}{% endraw %}
- {{ pillar["ansible"]["dirs"]["output"]["name"] }}/admin_api_server/run.sh
+ {{ pillar["ansible"]["dirs"]["output"]["name"] }}/admin_api_server/run.sh ${@}
{% raw %}{% endif %}{% endraw %}
{% raw %}{% if "True" == openbook_install_customer_api_server|string() %}{% endraw %}
- {{ pillar["ansible"]["dirs"]["output"]["name"] }}/customer_api_server/run.sh
+ {{ pillar["ansible"]["dirs"]["output"]["name"] }}/customer_api_server/run.sh ${@}
{% raw %}{% endif %}{% endraw %}
{% raw %}{% if "True" == openbook_install_admin_web_ui|string() %}{% endraw %}
- {{ pillar["ansible"]["dirs"]["output"]["name"] }}/admin_web_ui/run.sh
+ {{ pillar["ansible"]["dirs"]["output"]["name"] }}/admin_web_ui/run.sh ${@}
{% raw %}{% endif %}{% endraw %}
{% raw %}{% if "True" == openbook_install_customer_web_ui|string() %}{% endraw %}
- {{ pillar["ansible"]["dirs"]["output"]["name"] }}/customer_web_ui/run.sh
+ {{ pillar["ansible"]["dirs"]["output"]["name"] }}/customer_web_ui/run.sh ${@}
{% raw %}{% endif %}{% endraw %}
echo
- echo "Openbook started. All components may not be fully initialized and available."
+ echo "Openbook started."
}
do_stop() {
@@ -82,11 +82,14 @@ do_stop() {
docker stop {{ pillar["database"]["container_name"] }}
{% raw %}{% endif %}{% endraw %}
docker container prune -f
+ echo
+ echo "Openbook stopped."
}
do_help() {
echo "Usage:"
echo " $0 start"
+ echo " $0 debug"
echo " $0 stop"
{% raw %}{% if "True" == openbook_install_database|string() %}{% endraw %}
echo " $0 test_database"
@@ -97,6 +100,9 @@ case $1 in
start*)
do_start
;;
+ debug*)
+ do_start debug
+ ;;
stop*)
do_stop
;;