Jenkins基础配置

选择安装jenkins插件

选择安装推荐的插件

Jenkins基础配置插图

如果现实中 jenkins 已离线 ,将以下文件中的更新检查地址改成国内清华大学地址,然后重启 jenkins 即可:https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json

[root@ubuntu1804 ~]#cat /var/lib/jenkins/hudson.model.UpdateCenter.xml
<?xml version='1.1' encoding='UTF-8'?>
<sites>
  <site>
    <id>default</id>
    <url>https://updates.jenkins.io/update-center.json</url>
  </site>
</sites>

离线状态

Jenkins基础配置插图(1)

插件安装过程中

选择安装推荐的插件,进入下面页面,安装插件很慢,可以通过下面方法解决

Jenkins基础配置插图(2)

为了解决插件安装慢的解决方式 ,利用清华的jenkins源通过 Nginx 进行 rewrite 或者反向代理,如下:

#在jenkins服务器上修改/etc/hosts 指向nginx服务器
[root@ubuntu1804 ~]#vim /etc/hosts
10.0.0.102 updates.jenkins-ci.org

#在另一台主机安装nginx,并修改配置
[root@ubuntu1804 ~]#apt -y install nginx
[root@ubuntu1804 ~]#dpkg -L nginx-common
/.
/etc
/etc/default
/etc/default/nginx
/etc/init.d
/etc/init.d/nginx
/etc/logrotate.d
/etc/logrotate.d/nginx
/etc/nginx
/etc/nginx/conf.d
/etc/nginx/fastcgi.conf
/etc/nginx/fastcgi_params
/etc/nginx/koi-utf
/etc/nginx/koi-win
/etc/nginx/mime.types
/etc/nginx/modules-available
/etc/nginx/modules-enabled
/etc/nginx/nginx.conf
/etc/nginx/proxy_params
/etc/nginx/scgi_params
/etc/nginx/sites-available
/etc/nginx/sites-available/default
/etc/nginx/sites-enabled
/etc/nginx/snippets
/etc/nginx/snippets/fastcgi-php.conf
/etc/nginx/snippets/snakeoil.conf
/etc/nginx/uwsgi_params
/etc/nginx/win-utf
/etc/ufw
/etc/ufw/applications.d
/etc/ufw/applications.d/nginx
/lib
/lib/systemd
/lib/systemd/system
/lib/systemd/system/nginx.service
/usr
/usr/share
/usr/share/apport
/usr/share/apport/package-hooks
/usr/share/apport/package-hooks/source_nginx.py
/usr/share/doc
/usr/share/doc/nginx-common
/usr/share/doc/nginx-common/NEWS.Debian.gz
/usr/share/doc/nginx-common/README.Debian
/usr/share/doc/nginx-common/changelog.Debian.gz
/usr/share/doc/nginx-common/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/nginx-common
/usr/share/nginx
/usr/share/nginx/html
/usr/share/nginx/html/index.html
/usr/share/vim
/usr/share/vim/addons
/usr/share/vim/addons/ftdetect
/usr/share/vim/addons/ftdetect/nginx.vim
/usr/share/vim/addons/ftplugin
/usr/share/vim/addons/ftplugin/nginx.vim
/usr/share/vim/addons/indent
/usr/share/vim/addons/indent/nginx.vim
/usr/share/vim/addons/syntax
/usr/share/vim/addons/syntax/nginx.vim
/usr/share/vim/registry
/usr/share/vim/registry/nginx.yaml
/var
/var/lib
/var/lib/nginx
/var/log
/var/log/nginx
/var/www
/var/www/html
/usr/share/nginx/modules
[root@ubuntu1804 ~]#vim /etc/nginx/sites-enabled/default
#加下面行
location /download/plugins {
    proxy_set_header Host mirrors.tuna.tsinghua.edu.cn;
    proxy_set_header X-Real-IP remote_addr;
    proxy_set_header X-Forwarded-Forproxy_add_x_forwarded_for;
    rewrite /download/plugins(.*) /jenkins/plugins/$1 break;
    proxy_pass http://mirrors.tuna.tsinghua.edu.cn;
}
[root@ubuntu1804 ~]#systemctl restart nginx

插件安装过程中,如果因为某种原因导致有有安装失败的插件,没有关系,可以后期再单独安装

Jenkins基础配置插图(3)

创建jenkins管理员

Jenkins基础配置插图(4)

配置jenkins URL

Jenkins基础配置插图(5)

配置完成并登陆jenkins

Jenkins基础配置插图(6)

登陆 jenkins界面

Jenkins基础配置插图(7)

本文链接:http://www.yunweipai.com/35724.html

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/courses/52607.html

(0)
上一篇 2021年8月6日 16:39
下一篇 2021年8月6日 16:39

相关推荐

发表回复

登录后才能评论