blob: c084a5227774edfac637d72d717789f795528434 [file] [log] [blame]
Dennis Dmitriev3ec2e532018-06-08 04:33:34 +03001#!/bin/bash
2
3# Source file to set access credentials to Jenkins API on salt-master node (day01 deployment steps)
4# Requires:
5# - ENV_NAME
6# Example usage:
7# $> . ./tcp_tests/utils/env_salt
8# $> . ./tcp_tests/utils/env_jenkins_day01
9# $> ./tcp_tests/utils/run_jenkins_job.py --verbose --job-name=deploy_openstack --job-parameters="{... json ...}"
10
11CURRENT_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
12export PYTHONPATH=${CURRENT_DIR}/../..
13
14SALT_MASTER_IP=${SALT_MASTER_IP:-$(for node in $(dos.py slave-ip-list --address-pool-name admin-pool01 ${ENV_NAME}); do echo $node|grep cfg01|cut -d',' -f2; done)}
15
16if [ -z "$SALT_MASTER_IP" ]; then
17 echo "SALT_MASTER_IP not found in the environment '${ENV_NAME}'"
18 unset JENKINS_URL
19 unset JENKINS_USER
20 unset JENKINS_PASS
21 unset JENKINS_START_TIMEOUT
22 unset JENKINS_BUILD_TIMEOUT
23else
24 # For run_jenkins_job.py
25 export JENKINS_URL=http://${SALT_MASTER_IP}:8081
26 export JENKINS_USER=admin
27 export JENKINS_PASS=r00tme
28 export JENKINS_START_TIMEOUT=60
29 export JENKINS_BUILD_TIMEOUT=1800
30fi
31
32echo "export JENKINS_URL='$JENKINS_URL' # Jenkins API URL"
33echo "export JENKINS_USER='${JENKINS_USER}' # Jenkins API username"
34echo "export JENKINS_PASS='${JENKINS_PASS}' # Jenkins API password or token"
35echo "export JENKINS_START_TIMEOUT='${JENKINS_START_TIMEOUT}' # Timeout waiting for job in queue to start building"
36echo "export JENKINS_BUILD_TIMEOUT='${JENKINS_BUILD_TIMEOUT}' # Timeout waiting for building job to complete"