5 ### Some other ways to get build_node_ip in case you don't want to make a file on Jenkins server ###
6 #build_node_ip=$(openstack server list -c Name -c Networks -f value | egrep ${stack_name} | awk '{print $NF}')
7 #build_node_ip=$(openstack server show ${stack_name} -f value -c addresses | cut -d' ' -f2 )
9 ### Setting variables used in this script ###
10 build_node_ip=$(openstack server list -c Name -c Networks -f value | egrep ${openstack_build_stack_name} | awk '{print $NF}' | sed 's/.*=//g')
11 ssh_cmd="ssh -o StrictHostKeychecking=no -i ${ssh_key} ${remote_user}@${build_node_ip}"
12 docker_repo="https://download.docker.com/linux/centos/docker-ce.repo"
14 ####################################
15 ### PREPARATIONS FOR CENTOS ONLY ###
16 ####################################
18 ### Required by special centos docker recommended by ONAP ###
19 RESULT=$(${ssh_cmd} "sudo yum-config-manager --add-repo ${docker_repo}")
20 if [[ $? -ne 0 ]]; then
21 echo "Failed to install add repo successfully: $RESULT"
25 ### Enable epel repo for npm and jq ###
26 RESULT=$(${ssh_cmd} "sudo yum install -y epel-release")
27 if [[ $? -ne 0 ]]; then
28 echo "Failed to install epel-release successfully: $RESULT"
32 ### Install following packages ###
33 RESULT=$(${ssh_cmd} "sudo yum install -y docker-ce-18.09.5 python-pip git createrepo expect nodejs npm jq")
34 if [[ $? -ne 0 ]]; then
35 echo "Failed to install packages successfully: $RESULT"
39 ### Offline Installer is using python3 now, thus need to install python3 and pip3 ###
40 RESULT=$(${ssh_cmd} "sudo yum install -y python36 python36-pip")
41 if [[ $? -ne 0 ]]; then
42 echo "Failed to install packages: $RESULT"
46 ### Install Twine, specific version 1.15.0 used, because new version 2.0.0 breaks the installation ###
47 RESULT=$(${ssh_cmd} "sudo pip install twine==1.15.0")
48 if [[ $? -ne 0 ]]; then
49 echo "Failed to pip install twine: $RESULT"
53 ### Starting Docker Service ###
54 RESULT=$(${ssh_cmd} "sudo service docker start")
55 if [[ $? -ne 0 ]]; then
56 echo "Failed to pip install twine: $RESULT"
60 ### Clone the OFfline Installer repo ###
61 RESULT=$(${ssh_cmd} " sudo git clone https://gerrit.onap.org/r/oom/offline-installer /tmp/onap-offline")
62 if [[ $? -ne 0 ]]; then
63 echo "Failed to clone onap/offline/install repo: $RESULT"
68 ### Install the required python packages ###
69 RESULT=$(${ssh_cmd} "sudo pip3 install -r /tmp/onap-offline/build/requirements.txt")
70 if [[ $? -ne 0 ]]; then
71 echo "Failed to install: $RESULT"
74 RESULT=$(${ssh_cmd} "sudo pip3 install -r /tmp/onap-offline/build/download/requirements.txt")
75 if [[ $? -ne 0 ]]; then
76 echo "Failed to install: $RESULT"