Deployment 如何使用Jenkins将更新部署到OpenShift Mono应用程序?

Deployment 如何使用Jenkins将更新部署到OpenShift Mono应用程序?,deployment,jenkins,mono,openshift,Deployment,Jenkins,Mono,Openshift,我使用社区盒带在OpenShift上创建了一个mono应用程序 现在,我正在阅读有关如何通过jenkins建立连续构建的内容 默认的mono应用程序似乎没有任何必要的脚本来构建、恢复NuGet软件包等。相反,git repo中似乎有DLL二进制文件,这似乎是不可持续的 在开放式轮班中部署mono的最佳方法是什么?我将在它工作时/如果我让它工作的话完善这个答案 您是否在OpenShift应用程序页面上单击墨盒下方的“持续集成-启用Jenkins”链接开始 一旦我这样做了,我的git push输出就

我使用社区盒带在OpenShift上创建了一个mono应用程序

现在,我正在阅读有关如何通过jenkins建立连续构建的内容

默认的mono应用程序似乎没有任何必要的脚本来构建、恢复NuGet软件包等。相反,git repo中似乎有DLL二进制文件,这似乎是不可持续的


在开放式轮班中部署mono的最佳方法是什么?

我将在它工作时/如果我让它工作的话完善这个答案

您是否在OpenShift应用程序页面上单击墨盒下方的“持续集成-启用Jenkins”链接开始

一旦我这样做了,我的
git push
输出就从:

remote: CLIENT_MESSAGE: Stopping Apache+mod_mono HTTPD server
remote: Waiting for stop to finish
remote: Waiting for stop to finish
remote: Stopping Postgres cartridge
remote: Building git ref 'master', commit 8da79f2
remote: Preparing build for deployment
remote: Deployment id is 05e8d1d8
remote: Activating deployment
remote: Starting Postgres cartridge
remote: Postgres started
remote: CLIENT_MESSAGE: Starting Apache+mod_mono HTTPD server
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success
致:

但是,如果我从源代码中删除
bin
目录,那么即使构建“成功”,网站也不再工作。因此很明显,它只是盲目地将文件从git中复制出来

因此,接下来我在Package Manager控制台中执行了一个
更新包-重新安装-ProjectName OpenShift
,然后右键单击解决方案并选择“Enable NuGet Package restore”,然后提交/推送这些更改

在Jeninks管理器中,我去配置构建,并在“执行shell”区域的
gear build
行之后添加了
xbuild OpenShift.sln

现在它实际上尝试进行真正的构建,但失败了,出现了以下错误:

+ xbuild OpenShift.sln
XBuild Engine Version 3.0.7.0
Mono, Version 3.0.7.0
Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2011.

Build started 01/13/2015 20:56:29.
__________________________________________________
/var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.sln:  warning : /var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.csproj: /var/lib/openshift/[my ID]/mono/mono/lib/mono/xbuild/Microsoft/VisualStudio/v10.0/WebApplications/Microsoft.WebApplication.targets: Project file could not be imported, it was being imported by /var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.csproj: Access to the path "/var" is denied.
Project "/var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.sln" (default target(s)):
    Target ValidateSolutionConfiguration:
        Building solution configuration "Debug|Any CPU".
    Target Build:
/var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.csproj: error : /var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.csproj: /var/lib/openshift/[my ID]/mono/mono/lib/mono/xbuild/Microsoft/VisualStudio/v10.0/WebApplications/Microsoft.WebApplication.targets: Project file could not be imported, it was being imported by /var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.csproj: Access to the path "/var" is denied.
    Task "MSBuild" execution -- FAILED
    Done building target "Build" in project "/var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.sln".-- FAILED
Done building project "/var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.sln".-- FAILED

Build FAILED.
看起来可能是这样的,所以我对OpenShift.csproj进行了以下手动区分:

-   <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
-   <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
+   <Import Project="$(SolutionDir)\MSBuild\Microsoft\VisualStudio\v12.0\WebApplications\Microsoft.WebApplication.targets" />
看起来运行NuGet.exe时出现问题-可能是

-   <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
-   <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
+   <Import Project="$(SolutionDir)\MSBuild\Microsoft\VisualStudio\v12.0\WebApplications\Microsoft.WebApplication.targets" />
Project "/var/lib/openshift/[my id]/app-root/runtime/repo/OpenShift.sln" (default target(s)):
    Target ValidateSolutionConfiguration:
        Building solution configuration "Debug|Any CPU".
    Target Build:
        Project "/var/lib/openshift/54b5dc8efcf933bb7300001f/app-root/runtime/repo/OpenShift.csproj" (default target(s)):
            Target RestorePackages:
                Executing: mono --runtime=v4.0.30319 "/var/lib/openshift/[my id]/app-root/runtime/repo/.nuget/NuGet.exe" install "/var/lib/openshift/[my id]/app-root/runtime/repo/packages.config" -source ""   -RequireConsent -solutionDir "/var/lib/openshift/[my id]/app-root/runtime/repo/"
                Cannot open assembly '/var/lib/openshift/[my id]/app-root/runtime/repo/.nuget/NuGet.exe': File does not contain a valid CIL image.