add yardstick iruya 9.0.0 release notes
[yardstick.git] / tools / virt_ci_rampup.sh
1 #!/usr/bin/env bash
2 # Copyright (c) 2018 Intel Corporation.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 env_http_proxy=$(sed -ne "s/^http_proxy=[\"\']\(.*\)[\"\']/\1/p" /etc/environment)
17 if [[ -z ${http_proxy} ]] && [[ ! -z ${env_http_proxy} ]]; then
18     export http_proxy=${env_http_proxy}
19 fi
20 env_https_proxy=$(sed -ne "s/^https_proxy=[\"\']\(.*\)[\"\']/\1/p" /etc/environment)
21 if [[ -z ${https_proxy} ]] && [[ ! -z ${env_https_proxy} ]]; then
22     export https_proxy=${env_https_proxy}
23 fi
24 env_ftp_proxy=$(sed -ne "s/^ftp_proxy=[\"\']\(.*\)[\"\']/\1/p" /etc/environment)
25 if [[ -z ${ftp_proxy} ]] && [[ ! -z ${env_ftp_proxy} ]]; then
26     export ftp_proxy=${env_ftp_proxy}
27 fi
28 if [[ ! -z ${http_proxy} ]] || [[ ! -z ${https_proxy} ]]; then
29     export no_proxy="${no_proxy}"
30     extra_args="${extra_args} -e @/tmp/proxy.yml "
31     cat <<EOF > /tmp/proxy.yml
32 ---
33 proxy_env:
34   http_proxy: ${http_proxy}
35   https_proxy: ${https_proxy}
36   ftp_proxy: ${ftp_proxy}
37   no_proxy: ${no_proxy}
38 EOF
39 fi
40 ANSIBLE_SCRIPTS="${0%/*}/../ansible"
41
42 cd ${ANSIBLE_SCRIPTS} && \
43 sudo -EH ansible-playbook \
44          -e RS_FILE='../etc/infra/infra_deploy_two.yaml' -e CLEAN_UP=False ${extra_args} \
45          -i inventory.ini infra_deploy.yml