提交 4c5165bd 编写于 作者: T TommyLike 提交者: Gitee

!20 update jenkins slave script

Merge pull request !20 from TommyLike/feature/last_jekins_test
#!/usr/bin/env bash
disk_name=$1
frontend_host=$2
backend_host=$3
if [[ ! -e ${disk_name} ]]; then
echo "disk ${disk_name} not existed"
......@@ -12,13 +14,48 @@ if [[ ! -e ~/.ssh/authorized_keys ]]; then
exit 1
fi
if [[ ! -e /etc/yum.repos.d/OSC.repo ]]; then
curl -o /etc/yum.repos.d/OSC.repo http://download.opensuse.org/repositories/openSUSE:/Tools/CentOS_7/openSUSE:Tools.repo
fi
# install required tools
sudo yum install -y java-1.8.0-openjdk
sudo yum install -y git
sudo yum install -y expect
sudo yum install -y osc
#update osc config file
if [[ ! -d /root/.config/osc ]];then
mkdir -p /root/.config/osc
fi
if [[ -e /root/.config/osc/oscrc ]];then
rm /root/.config/osc/oscrc
fi
cd /root/.config/osc
curl -o oscrc https://openeuler.obs.cn-south-1.myhuaweicloud.com:443/infrastructure/oscrc
sed -i "s/#no_verify = 1/no_verify = 1/g" /root/.config/osc/oscrc
# update /etc/hosts
echo "Updating the cluster hosts info"
# update hosts info:
# 1. <frontend_host> build.openeuler.org
if ! grep -q "build.openeuler.org" /etc/hosts; then
echo "${frontend_host} build.openeuler.org" >> /etc/hosts
else
sed -i -e "s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\} build.openeuler.org/${frontend_host} build.openeuler.org/g" /etc/hosts
fi
if ! grep -q "backend.openeuler.org" /etc/hosts; then
echo "${backend_host} backend.openeuler.org" >> /etc/hosts
else
sed -i -e "s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\} backend.openeuler.org/${backend_host} backend.openeuler.org/g" /etc/hosts
fi
# prepare disk
mkfs.ext4 ${disk_name}
mkdir /jenkins_home
mount ${disk_name} /jenkins_home
if [[ ! -d /jenkins_home ]]; then
mkfs.ext4 ${disk_name}
mkdir /jenkins_home
mount ${disk_name} /jenkins_home
fi
chmod 600 ~/.ssh/authorized_keys
#!/usr/bin/env bash
disk_name=$1
frontend_host=$2
backend_host=$3
if [[ ! -e ${disk_name} ]]; then
echo "disk ${disk_name} not existed"
......@@ -15,10 +17,42 @@ fi
# install required tools
zypper install -y java-1_8_0-openjdk
zypper install -y git
zypper install -y osc
zypper install -y expect
#update osc config file
if [[ ! -d /root/.config/osc ]];then
mkdir -p /root/.config/osc
fi
if [[ -e /root/.config/osc/oscrc ]];then
rm /root/.config/osc/oscrc
fi
cd /root/.config/osc
curl -o oscrc https://openeuler.obs.cn-south-1.myhuaweicloud.com:443/infrastructure/oscrc
sed -i "s/#no_verify = 1/no_verify = 1/g" /root/.config/osc/oscrc
# update /etc/hosts
echo "Updating the cluster hosts info"
# update hosts info:
# 1. <frontend_host> build.openeuler.org
if ! grep -q "build.openeuler.org" /etc/hosts; then
echo "${frontend_host} build.openeuler.org" >> /etc/hosts
else
sed -i -e "s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\} build.openeuler.org/${frontend_host} build.openeuler.org/g" /etc/hosts
fi
if ! grep -q "backend.openeuler.org" /etc/hosts; then
echo "${backend_host} backend.openeuler.org" >> /etc/hosts
else
sed -i -e "s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\} backend.openeuler.org/${backend_host} backend.openeuler.org/g" /etc/hosts
fi
# prepare disk
mkfs.ext4 ${disk_name}
mkdir /jenkins_home
mount ${disk_name} /jenkins_home
if [[ ! -d /jenkins_home ]]; then
mkfs.ext4 ${disk_name}
mkdir /jenkins_home
mount ${disk_name} /jenkins_home
fi
chmod 600 ~/.ssh/authorized_keys
......@@ -4,6 +4,8 @@
script_name=$1
ip_address=$2
disk_name=$3
frontend_name=$4
backend_name=$5
scp ./authorized_keys root@${ip_address}:~/.ssh/
scp ./${script_name} root@${ip_address}:~/
ssh root@${ip_address} "chmod +x ~/${script_name} && ~/${script_name} ${disk_name}"
\ No newline at end of file
ssh root@${ip_address} "chmod +x ~/${script_name} && ~/${script_name} ${disk_name} ${frontend_name} ${backend_name}"
......@@ -123,7 +123,7 @@ Worker6: 172.16.1.195
Worker7: 172.16.1.127
Worker8: 172.16.1.12
Worker9: 172.16.1.14
Worker10: 172.16.1.157
Worker10: 172.16.1.57
```
## download full fedora packages
......
......@@ -657,7 +657,7 @@
<project path="openEuler/perl-Text-Balanced" name="euleros/third_party/open_source/userspace/perl-Text-Balanced" revision=""/>
<project path="openEuler/perl-Text-Diff" name="euleros/third_party/open_source/userspace/perl-Text-Diff" revision=""/>
<project path="openEuler/perl-Text-ParseWords" name="euleros/third_party/open_source/userspace/perl-Text-ParseWords" revision=""/>
<project path="openEuler/perl-Text-Tabs+Wrap" name="euleros/third_party/open_source/userspace/perl-Text-Tabs+Wrap" revision=""/>
<project path="openEuler/perl-Text-Tabs-Wrap" name="euleros/third_party/open_source/userspace/perl-Text-Tabs+Wrap" revision=""/>
<project path="openEuler/perl-Thread-Queue" name="euleros/third_party/open_source/userspace/perl-Thread-Queue" revision=""/>
<project path="openEuler/perl-threads" name="euleros/third_party/open_source/userspace/perl-threads" revision=""/>
<project path="openEuler/perl-threads-shared" name="euleros/third_party/open_source/userspace/perl-threads-shared" revision=""/>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册