Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jenkins #319

Open
xlearns opened this issue May 31, 2023 · 0 comments
Open

jenkins #319

xlearns opened this issue May 31, 2023 · 0 comments

Comments

@xlearns
Copy link
Owner

xlearns commented May 31, 2023

下载

安装java

sudo apt update
sudo apt-get -y install openjdk-11-jdk
java -version

安装jenkins

curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins
sudo systemctl enable jenkins
sudo systemctl start jenkins
jenkins --version

修改默认端口

  • 停止Jenkins服务
    • sudo service jenkins stop
  • 修改Jenkins配置文件
    • vi /usr/lib/systemd/system/jenkins.service
    • Environment="JENKINS_PORT=17174"
    • systemctl daemon-reload
  • 启动Jenkins服务
    • sudo service jenkins start

查看占用端口

  • netstat -tunlp

一些插件

  • Git Parameter
    • Git branches、tags 或 revisions 作为启动作业或管道的参数
  • gitlab
  • mailer
    • 邮件
  • Qy Wechat Notification Plugin
    • 企业微信通知

流水线

  • 创建gitlab的访问令牌
    image
  • 创建流水线项目
    image
    image
  • 构建触发器: Build when a change is pushed to GitLab. GitLab webhook URL 【获取url】
  • jenkins: 配置gitlab的连接
    image
  • jenkins: 配置gitlab的凭证【第一步的令牌】
    image
    image
  • 再gitlab中设置->集成->配置webhook【根据上面获得的url】
    image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant