summaryrefslogtreecommitdiffstats
path: root/lib/ci-management
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2018-10-18 11:15:15 -0700
committerVictor Morales <victor.morales@intel.com>2018-10-18 11:15:15 -0700
commitb5aaafd67f2c5e7f2272a98792b39b6ec22df237 (patch)
tree4a43860aa7f207ba0392d9a95b0aded2783e1186 /lib/ci-management
parent0d41bc49d18ebf126faa9a709dbe59b2bccc8ee1 (diff)
Add ci-management script
This script collects basic instructions to setup the Jenkins Sandbox to tests changes in JJBs. Change-Id: I6821edc57e28d8ebc5b042027ba47d6d8fafc165 Signed-off-by: Victor Morales <victor.morales@intel.com> Issue-ID: INT-478
Diffstat (limited to 'lib/ci-management')
-rwxr-xr-xlib/ci-management29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/ci-management b/lib/ci-management
new file mode 100755
index 0000000..da6df14
--- /dev/null
+++ b/lib/ci-management
@@ -0,0 +1,29 @@
+#!/bin/bash
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2017-2018
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#############################################################################
+
+source /var/onap/functions
+
+# init_ci-management() - Init ci-management project
+function init_ci-management {
+ local jenkins_username=${1:-$(git config --get gitreview.username)}
+ local jenkins_api_token=$2
+
+ if [[ "$clone_repo" == "True" ]]; then
+ clone_repos "ci-management"
+ pushd ${src_folders[ci-management]}
+ git submodule update --init
+ uninstall_package python-six
+ install_python_package jenkins-job-builder
+ cp jenkins.ini.example jenkins.ini
+ sed -i "s|user=#username#|user=$jenkins_username|g" jenkins.ini
+ sed -i "s|password=#api_token#|password=$jenkins_api_token|g" jenkins.ini
+ popd
+ fi
+}