aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ci-management
blob: da6df14feb763589d47d4cc8311447f28ae0e449 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
}