日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

JenKins使用pm2部署.net core网站

發(fā)布時間:2024/10/12 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 JenKins使用pm2部署.net core网站 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
JenKins使用pm2部署.net core網(wǎng)站 原文:JenKins使用pm2部署.net core網(wǎng)站

登錄事先準備好的 Jenkins

  • 1 新建任務

  • 2 源碼管理 git 輸入正確地址

  • 3 構建環(huán)境:
    Delete workspace before build starts
    Abort the build if it's stuck

    打勾

  • 4 安裝事先準備好的 pm2
    打開shell安裝
    參考?https://www.cnblogs.com/stulzq/p/9775973.html

sudo yum install nodejs
node -v

npm install pm2 -g

  • 5 回到Jenkins
    選擇 構建=>執(zhí)行shell

?

ls cd ./VPStest.netCore/VPStest.netCore lsdotnet publish -c Release cd bin/Release/netcoreapp2.2/publish ls pm2 start "dotnet VPStest.netCore.dll" --name testweb
  • 6 保存
  • 選擇立即構建

  • 7 查看控制臺輸出

?

Started by user www Building in workspace /var/lib/jenkins/workspace/DotCoreTest [WS-CLEANUP] Deleting project workspace... [WS-CLEANUP] Deferred wipeout is used... [WS-CLEANUP] Done No credentials specified Cloning the remote Git repository Cloning repository https://github.com/www/VPStest.git > git init /var/lib/jenkins/workspace/DotCoreTest # timeout=10 Fetching upstream changes from https://github.com/www/VPStest.git > git --version # timeout=10 > git fetch --tags --progress https://github.com/www/VPStest.git +refs/heads/*:refs/remotes/origin/* > git config remote.origin.url https://github.com/www/VPStest.git # timeout=10 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 > git config remote.origin.url https://github.com/www/VPStest.git # timeout=10 Fetching upstream changes from https://github.com/www/VPStest.git > git fetch --tags --progress https://github.com/www/VPStest.git +refs/heads/*:refs/remotes/origin/* > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 Checking out Revision 66cec8d481afee09a71ab9941e2ce25db6075485 (refs/remotes/origin/master) > git config core.sparsecheckout # timeout=10 > git checkout -f 66cec8d481afee09a71ab9941e2ce25db6075485 Commit message: "修改" > git rev-list --no-walk 66cec8d481afee09a71ab9941e2ce25db6075485 # timeout=10 [DotCoreTest] $ /bin/sh -xe /tmp/jenkins8834327214949599471.sh + ls DockerCompsoe LICENSE README.md VPStest.netCore + cd ./VPStest.netCore/VPStest.netCore + ls appsettings.Development.json appsettings.json Controllers Dockerfile Models Program.cs Startup.cs Views VPStest.netCore.csproj wwwroot + dotnet publish -c Release Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core Copyright (C) Microsoft Corporation. All rights reserved.
Restoring packages for /var/lib/jenkins/workspace/DotCoreTest/VPStest.netCore/VPStest.netCore/VPStest.netCore.csproj... Generating MSBuild file /var/lib/jenkins/workspace/DotCoreTest/VPStest.netCore/VPStest.netCore/obj/VPStest.netCore.csproj.nuget.g.props. Generating MSBuild file /var/lib/jenkins/workspace/DotCoreTest/VPStest.netCore/VPStest.netCore/obj/VPStest.netCore.csproj.nuget.g.targets. Restore completed in 1.81 sec for /var/lib/jenkins/workspace/DotCoreTest/VPStest.netCore/VPStest.netCore/VPStest.netCore.csproj. VPStest.netCore -> /var/lib/jenkins/workspace/DotCoreTest/VPStest.netCore/VPStest.netCore/bin/Release/netcoreapp2.2/VPStest.netCore.dll VPStest.netCore -> /var/lib/jenkins/workspace/DotCoreTest/VPStest.netCore/VPStest.netCore/bin/Release/netcoreapp2.2/VPStest.netCore.Views.dll VPStest.netCore -> /var/lib/jenkins/workspace/DotCoreTest/VPStest.netCore/VPStest.netCore/bin/Release/netcoreapp2.2/publish/ + cd bin/Release/netcoreapp2.2/publish + ls appsettings.Development.json appsettings.json VPStest.netCore.deps.json VPStest.netCore.dll VPStest.netCore.pdb VPStest.netCore.runtimeconfig.json VPStest.netCore.Views.dll VPStest.netCore.Views.pdb web.config wwwroot + pm2 start 'dotnet VPStest.netCore.dll' --name testweb [PM2] Starting /bin/bash in fork_mode (1 instance) [PM2] Done. ┌──────────┬────┬─────────┬──────┬───────┬────────┬─────────┬────────┬─────┬────────────┬──────┬──────────┐ │ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │ ├──────────┼────┼─────────┼──────┼───────┼────────┼─────────┼────────┼─────┼────────────┼──────┼──────────┤ │ sffweb │ 0 │ N/A │ fork │ 10209 │ online │ 0 │ 33m │ 0% │ 116.3 MB │ root │ disabled │ │ testweb │ 1 │ N/A │ fork │ 13650 │ online │ 0 │ 0s │ 0% │ 3.8 MB │ root │ disabled │ └──────────┴────┴─────────┴──────┴───────┴────────┴─────────┴────────┴─────┴────────────┴──────┴──────────┘ Use `pm2 show <id|name>` to get more details about an app Finished: SUCCESS
    • 8 開放 5000 端口

      sudo firewall-cmd --add-port=5000/tcp

    • 9 打開瀏覽器 輸入 IP:5000 成功

posted on 2019-04-03 13:17 NET未來之路 閱讀(...) 評論(...) 編輯 收藏

轉載于:https://www.cnblogs.com/lonelyxmas/p/10648197.html

總結

以上是生活随笔為你收集整理的JenKins使用pm2部署.net core网站的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內容還不錯,歡迎將生活随笔推薦給好友。