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