Jenkins是基于java开发的。
GitHub Git (熟练使用)
Doocker (了解)
Jenkins (熟练使用)
Django (熟练使用)
Angularjs (了解)
Sentry (了解)
Mysql
Jenkins修改端口号2222。
Jenkins安装python和GIT插件。系统要安装python环境。Jenkins全局配置pytton环境变量配置。
jenkins是一个开放源代码的CI服务器。
安装(ubuntu)
wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
备份数据库python脚本:
#数据库的备份
home_path = os.path.expanduser("~") + "/"
mysqldump_output_file_name = home_path + "mysql_backup/"
@snitch("mysqldump", "OK")
def mysqldump(host, user, password, database_name, port=, skipdata=False):
try:
skipdata_string = ''
if skipdata:
skipdata_string = '-d'
output_file = mysqldump_output_file_name + database_name + str(datetime.datetime.now().strftime("%Y-%m-%d")) + '.sql'
mysqldump_string = "mysqldump --lock-tables=false -C -P{0} -h{1} -u{2} -p{3} {4} {5} > {6}".format(port,host,user,password,skipdata_string,database_name,output_file )
os.system(mysqldump_string)
except:
traceback.print_exc()
#700天的文件复制到/home/jie/xxdata_backup/
def backup_xxdata():
shell_str = 'find /home/jie/xxdata -name "*.zip" -mtime -700 | xargs -I {} scp {} /home/jie/xxdata_backup/'
os.system(shell_str)
def run():
backup_xxdata()
mysqldump("127.0.0.1", "root", "admin", "monitoring") #定期备份数据
if __name__ == '__main__':
run()
判断csdn的状态python脚本:
#判断csdn网站的状态
WEB_URL = 'http://www.csdn.net/'
@snitch_with_return
def check_csdn(status, message=None):
return {"status": status,
"messaage": message}
def run():
try:
page = requests.get(WEB_URL)
if page.status_code == and page.content.decode("utf-8").find('<title>CSDN.NET - 全球最大中文IT社区,为IT专业技术人员提供最全面的信息传播和服务平台</title>'): #并且判断title
print("CSDN is working great :)")
check_csdn("OK")
else:
print("It looks like CSDN is having trouble, some one please take a look at it")
check_csdn("OK")
sys.exit(-)
except:
print("It looks like CSDN is having trouble, some one please take a look at it")
check_csdn(status="CRITICAL", message=str(traceback.print_exc()))
sys.exit(-)
if __name__ == '__main__':
run()