一、配置gitlab凭证
1、jenkins 插件准备
系统管理->插件管理 :GitLab ,Publish Over SSH
2、系统管理->系统设置
GitLab这里要添加的凭证是 GitLab API token,而这个API token又是从哪里来的呢?
很显然,这里是要为了连接GitLab,而API token就是从GitLab那里复制来的.
3、登录gitlab获取token
创建token:二、配置节点slave凭证
有两种方式:配置'用户/密码' 或者是 '用户/私钥'(推荐)
1、jenkisn配置节点 ‘用户/私钥’的凭证(推荐)
系统管理->插件管理 :Publish Over SSH
生成ssh:私钥、公钥 Linux生成SSH密钥方式
1.1 生成:authorized_keys 并授权
[root@VM_0_6_centos ~]# cd .ssh
[root@VM_0_6_centos .ssh]# ls
id_rsa id_rsa.pub known_hosts
[root@VM_0_6_centos .ssh]# cat id_rsa.pub > authorized_keys
[root@VM_0_6_centos .ssh]# ls
authorized_keys id_rsa id_rsa.pub known_hosts
[root@VM_0_6_centos .ssh]# chmod 700 authorized_keys
1.2 jenkins配置节点slave凭证
注意:使用节点的凭证为’用户/ssh‘的,选 Manually trusted keyVerification Strategy
2、jenkisn配置节点 ‘用户/密码’的凭证
2.1 jenkins配置节点slave凭证
创建节点凭证:用户/密码注意:使用节点的凭证为’用户/密码’的,选 Non verifying Verfication Strategy
三、配置tomcat凭证
1、设置tomcat用户 并配置权限
打开 apache-tomcat-8.5.29-8085\conf\tomcat-users.xml
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="admin-gui"/>
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-status"/>
<user username="tomcat" password="tomcat" roles="tomcat,role1,admin-gui,manager,manager-gui,manager-script,manager-status"/>