美文网首页
拉取gitlab的静态资源

拉取gitlab的静态资源

作者: IT男的假智慧 | 来源:发表于2020-04-02 08:51 被阅读0次

#!/bin/bash

#version: 1.0

#by: summer

giturl="http://ip:9989/Youngjae/txjh-pc.git" #这里加git clone的地址

dirname=`echo "$giturl" |awk -F '/' '{print $NF}'|awk -F '.' '{print $1}'`

username="gitlab用户名" #这里加用户名

passwd="密码" #这里加密码

nowpath=`pwd`

#获取信息

#get_info(){

#read -p "please enter the giturl > " gurl

#giturl=$gurl

#read -p "please enter the gits username > " gname

#username=$gname

#read -p "please enter the gits passwd > " gpswd

#passwd=$gpswd

#dirname=`echo "$giturl" |awk -F '/' '{print $NF}'|awk -F '.' '{print $1}'`

#filename="$dirname.jar"

#}

git_pull(){

if [ ! -d $nowpath/$dirname ];then

/usr/bin/expect <<EOF

set timeout 30

spawn git clone $giturl

expect "Username for 'http://60.190.243.100:9989':"

send "$username\n"

expect "Password for 'http://$username@60.190.243.100:9989':"

send "$passwd\n"

expect eof

EOF

else

rm -rf ./$dirname

/usr/bin/expect <<EOF

set timeout 30

spawn git clone $giturl

expect "Username for 'http://gitip:9989':"

send "$username\n"

expect "Password for 'http://$username@ip:9989':"

send "$passwd\n"

expect eof

EOF

fi

}

#get_info

git_pull

相关文章

网友评论

      本文标题:拉取gitlab的静态资源

      本文链接:https://www.haomeiwen.com/subject/fsetphtx.html