1、Docker,Docker私有仓库配置和Jenkins环境配置

2、全局环境配置

1、系统设置->全局工具配置

image.png

2、查找NodeJs安装

image.png

3、配置nodejs

image.png

1、可以选择低版本的

  • nodes17版本以上感觉容易出问题
  • 可以选择14版本 ```shell

    WARN “baseUrl” option in vue.config.js is deprecated now, please use “publicPath” instead.

  • Building for production… Error: error:0308010C:digital envelope routines::unsupported

    1. <a name="kMavM"></a>
    2. # 3、添加构建任务
    3. <a name="ENm6T"></a>
    4. ## 1、创建一个自由风格任务
    5. ![image.png](https://cdn.nlark.com/yuque/0/2022/png/12971636/1645154026607-fbbabeec-bc9e-43b1-8050-435fac58fe26.png#clientId=u089f6ea0-9d88-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=583&id=ud42cd6b3&margin=%5Bobject%20Object%5D&name=image.png&originHeight=1166&originWidth=2174&originalType=binary&ratio=1&rotation=0&showTitle=false&size=276169&status=done&style=none&taskId=ub8edae0b-e386-4952-84ae-f0a61f65c3e&title=&width=1087)
    6. <a name="A2yXX"></a>
    7. ## 2、有需要添加构建丢弃
    8. ![image.png](https://cdn.nlark.com/yuque/0/2022/png/12971636/1645154054959-3cb39add-1e20-4283-8c5a-7311398fd6b9.png#clientId=u089f6ea0-9d88-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=481&id=uffd67ffd&margin=%5Bobject%20Object%5D&name=image.png&originHeight=962&originWidth=2078&originalType=binary&ratio=1&rotation=0&showTitle=false&size=130679&status=done&style=none&taskId=u741d2d82-a3d9-42b6-a44f-d5525dbb274&title=&width=1039)
    9. <a name="wi2rn"></a>
    10. ## 3、添加git仓库地址
    11. ![image.png](https://cdn.nlark.com/yuque/0/2022/png/12971636/1645154093686-06ae605c-7404-4ce2-a7b2-f0352078c9a3.png#clientId=u089f6ea0-9d88-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=440&id=ub98d6112&margin=%5Bobject%20Object%5D&name=image.png&originHeight=880&originWidth=2152&originalType=binary&ratio=1&rotation=0&showTitle=false&size=112691&status=done&style=none&taskId=u1a658fa1-3570-4e44-ab61-4b3d55ab166&title=&width=1076)
    12. <a name="kKLed"></a>
    13. ## 4、选择分支
    14. ![image.png](https://cdn.nlark.com/yuque/0/2022/png/12971636/1645154108004-55962e00-4018-4fc2-a1c3-59fe6fb1b19b.png#clientId=u089f6ea0-9d88-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=250&id=u395ecbf3&margin=%5Bobject%20Object%5D&name=image.png&originHeight=500&originWidth=2030&originalType=binary&ratio=1&rotation=0&showTitle=false&size=54571&status=done&style=none&taskId=u216ce113-4165-4a3e-97f8-82380ab6982&title=&width=1015)
    15. <a name="bSyki"></a>
    16. ## 5、选择构建环境
    17. ![image.png](https://cdn.nlark.com/yuque/0/2022/png/12971636/1645154652829-875d8a8c-e078-4ec9-9538-8139aa23045d.png#clientId=u089f6ea0-9d88-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=600&id=ud571e941&margin=%5Bobject%20Object%5D&name=image.png&originHeight=1200&originWidth=2094&originalType=binary&ratio=1&rotation=0&showTitle=false&size=206677&status=done&style=none&taskId=uaf915518-5a4b-4cb1-97d4-9d4599dabfa&title=&width=1047)
    18. <a name="bckB4"></a>
    19. ## 6、添加构建步骤
    20. ![image.png](https://cdn.nlark.com/yuque/0/2022/png/12971636/1645170966214-5c0e2b13-a8be-41c7-9238-2d8f6cdf57b0.png#clientId=uaec438de-a87d-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=308&id=u4311e4e5&margin=%5Bobject%20Object%5D&name=image.png&originHeight=616&originWidth=850&originalType=binary&ratio=1&rotation=0&showTitle=false&size=66615&status=done&style=none&taskId=ua5162418-f2d5-4c93-aae7-c67e07cd4f8&title=&width=425)
    21. <a name="lPRZd"></a>
    22. ## 7、进行shell脚本编写
    23. ```shell
    24. cd lanyue-manager-vue/
    25. node --version
    26. npm install
    27. rm -rf ./dist/*
    28. npm run build

    8、拷贝编译出来的文件丢给目标路径

    SourcePath='/data/*'
    cd /seat/admin_html
    rm -rf *
    cp -r ${SourcePath} ./
    

    4、nginx代理静态页面admin_html

    1、配置如下

    
           #监听80端口对http转发到https上
     server
     {
          listen 80;#监听端口
         server_name 域名;#域名
         rewrite ^/(.*) https://$server_name$request_uri? permanent;
      }
     #监听443端口
     server 
     {
         listen 443;
         server_name 域名;
         ssl on;
         #配置证书的路径
         ssl_certificate /seat/cert/admin/7269313_admin.com.pem; #证书路径
         ssl_certificate_key /seat/cert/admin/7269313.com.key; #证书路径
         #ssl_session_cache shared:SSL:1m;
         ssl_session_timeout 5m;
         ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
         ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
         ssl_prefer_server_ciphers on;
         fastcgi_param HTTPS on;
         fastcgi_param HTTP_SCHEME https;
         location / {
             root /seat/admin_html;
           index index.html htmlindex.php /index.php;
           try_files $uri $uri/ /index.html;
         }
     }