学海无涯
go,go,go

jenkins和gitlab实现自动发布项目-配置免密互通和测试环境(二)

在jenkins服务器安装高版本git,默认版本为1.83,需要升级到2.16
卸载旧版本jenkins
yum remove -y git  
git --version
yum -y install epel-release
rpm -ivh https://centos7.iuscommunity.org/ius-release.rpm
yum list git2u
yum -y install git2u
git --version

配置git的用户和邮箱
git config --global user.name yeyouqing1
git config --global user.email yeyouqing1@qq.com
git config --global color.ui true

在jenkins服务器生成sshkey
ssh-keygen -t rsa -C '此处填写git的用户'
[root@centos7 plugins]# ssh-keygen -t rsa -C 'devops'
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:1tPt9p1OXVqQvH1cACLRJw/OPcQ0vDXIWioiyVjlk/c yeyouqing1
The key's randomart image is:
+---[RSA 2048]----+
|     .. oo.=+o.  |
|    .. . .+.Oooo |
|   + .+ .o @ o+..|
|  . + .o.o=.=. =.|
|     . .S.E ..o *|
|       .   . . o+|
|              +..|
|             ...o|
|              .oo|
+----[SHA256]-----+
配置测试nginx的环境
[root@centos7 monitor]# cat /etc/nginx/nginx.conf
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
events {
    worker_connections 1024;
}
http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    access_log  /var/log/nginx/access.log  main;
    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;
    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;
    include /etc/nginx/conf.d/*.conf;
    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /web/html;
        include /etc/nginx/default.d/*.conf;
        location / {
        }
        error_page 404 /404.html;
            location = /40x.html {
        }
        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
}

赞(0) 打赏
未经允许不得转载:YYQ运维技术博客_运维的工作学习之路 » jenkins和gitlab实现自动发布项目-配置免密互通和测试环境(二)
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

运维devops

联系我们关于本博客

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏