美文网首页
Jenkins 自动化部署

Jenkins 自动化部署

作者: 忘记_3a6a | 来源:发表于2019-11-17 16:17 被阅读0次

*前提安装好Java JDK,Maven

  • 安装maven 命令

wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo

yum -y install apache-maven
  • 下载
    地址:[Jenkins](https://jenkins.io/
    image.png
  • 以Linux环境为例,执行如下代码
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
yum install jenkins
  • 启动
 systemctl start jenkins
service jenkins start

  • 页面打开
localhost:8080
image.png
  • 获取密码
cat /var/lib/jenkins/secrets/initialAdminPassword
  • 安装插件
image.png

稍等片刻


image.png
  • 设置密码
  • 安装插件
    系统管理>插件管理>可选插件--Rebuilder 插件|safe restart插件
  • 配置全局安全性


    配置全局安全性
    授权策略
  • 添加用户


    image.png
    image.png

安装Git

  • 安装
yum install git

git version
  • 将Git初始化并生成授信证书
git config --global user.name "用户名"
git config --global user.email "邮箱"
ssh-keygen -t rsa -C "邮箱"
  • 检查证书是否生成成功
[root@iz2zef0icee8u4xk3qp2o8z ~]# cd ~/.ssh
[root@iz2zef0icee8u4xk3qp2o8z .ssh]# ls
私钥:id_rsa 公钥:  id_rsa.pub
  • 将Git证书配置到GitHub上,保证LInux服务器与GitHub之间可连通


    image.png
    image.png
  • 验证Git配置是否成功
[root@iz2zef0icee8u4xk3qp2o8z .ssh]# ssh git@github.com

Hixxx! You've successfully authenticated, but GitHub does not provide shell access

相关文章

网友评论

      本文标题:Jenkins 自动化部署

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