• jenkins 相关


    一、安装

    wget -O /etc/yum.repos.d/jenkins.repo 
        https://pkg.jenkins.io/redhat-stable/jenkins.repo
    rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
    yum upgrade
    yum install jenkins java-1.8.0-openjdk-devel (就算安装失败也可以先运行下,可以自动安装需要的依赖)
    启动 systemctl start jenkins
    如果启动失败可以尝试 systemctl restart jenkins 重启一下
    因为yum安装jenkins非常慢所以可以直接下载rmp文件进行安装,在yum安装的时候只安装java就可以(yum install java-1.8.0-openjdk-devel)
    https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat/ 下载最新的rmp文件
    rpm -ivh jenkins-2.253-1.1.noarch.rpm 这里替换成下载的rmp文件

     二、配置插件选择自定义,然后更换为清华源

    系统管理>>管理插件>>高级
    将 [升级站点] 更换为
    https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/current/update-center.json

    在安装插件,推荐插件列表如下

    三、发布php项目

       1、所需插件 publish over ssh、Git client、Git Parameter、Role-based Authorization(权限插件)

       2、配置git拉取ssh-key

           Jenkins-->系统管理-->凭据-->系统-->全局凭据-->添加凭据

           

      3、配置远程服务器

         Jenkins-->系统管理-->系统配置-->Publish over SSH

         

       4、创建发布任务

        

      这里需要勾选丢弃旧的构建,保持2个就可以,太大的垃圾太多

      

        源码这里我们使用git

        

        构建后操作

       

       5、选择指定分支发布

       添加一个版本选择的参数

       

       在源码管理里面指定分支填写上面的名称

       

       6、配置根据tag回滚

         添加操作类型和tag选择的两个参数

        

         构建里面添加执行shell

         

    cd $WORKSPACE
    if [ $mode == "deploy" ];then
        git checkout $branch
    else
        git reset --hard $tag
    fi

    构建后操作-->Git Publisher

     发布选择界面

    四、问题整理

      1、构建后操作里面在远端服务器执行重启服务,运行时卡主直到超,勾选exec in pty就可以解决

      

      2、git打tag提交失败,提示

       git config --global user.email "you@example.com"
       git config --global user.name "Your Name"

       

      在源码管理里面添加上用户和邮箱就可以

    五、备份

      安装插件 thinbackup

      进入settings设置Backup directory 备份目录

      点击backup now就可以备份

  • 相关阅读:
    [RxJS] ReplaySubject
    [React Fundamentals] Composable Components
    [Webpack] Use the Webpack Dashboard to Monitor Webpack Operations
    [RxJS] AsyncSubject
    [React Fundamentals] Component Lifecycle
    [React Fundamentals] Component Lifecycle
    [React Fundamentals] Component Lifecycle
    [RxJS] Subject basic
    [React Fundamentals] Using Refs to Access Components
    文档管理系统二——文档扫描与图片编辑
  • 原文地址:https://www.cnblogs.com/whlives/p/13305568.html
Copyright © 2020-2023  润新知