From b5aaafd67f2c5e7f2272a98792b39b6ec22df237 Mon Sep 17 00:00:00 2001 From: Victor Morales Date: Thu, 18 Oct 2018 11:15:15 -0700 Subject: 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 Issue-ID: INT-478 --- lib/ci-management | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 lib/ci-management (limited to 'lib/ci-management') 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 +} -- cgit 1.2.3-korg