Code Q & A
  • index
  • Java
  • python
  • javascript
No Result
View All Result
Code Q & A
  • index
  • Java
  • python
  • javascript
No Result
View All Result
Code Q & A
No Result
View All Result

MSDeploy gulp build package

08/05/2022
in gulp, msdeploy
Reading Time: 2 mins read

Is it possible to deploy a Single Page App project build using grunt to IIS using MSDeploy from TeamCity? The project is not any kind of Visual Studio solution and doesn't get built using MSBuild.

My Command parameters which are not working are:

-source:package='%teamcity.build.checkoutDir%\Dist.%build.number%.zip' -dest:auto,computerName="%system.MsDeployServiceUrl%",userName="%system.UserName%",password="%system.Password%",authtype="basic",includeAcls="False"
-verb:sync -setParamFile:"%teamcity.build.checkoutDir%\Dist.%build.number%.zip.SetParameters.xml"
-AllowUntrusted -setParam:"IIS Web Application Name"="%system.WebSiteName%" -verbose

The error I am getting is:

[11:47:31][Step 3/3] Error Code: ERROR_EXCEPTION_WHILE_CREATING_OBJECT
[11:47:31][Step 3/3] More Information: Object of type 'package' and
path 'D:\TeamCity\buildAgent\work\e2b0015b49d87e90\Dist.30.zip' cannot
be created. Learn more at:
.
[11:47:31][Step 3/3] Error: The Zip package
'D:\TeamCity\buildAgent\work\e2b0015b49d87e90\Dist.30.zip' could not
be loaded. [11:47:31][Step 3/3] Error: Could not find file
'D:\TeamCity\buildAgent\work\e2b0015b49d87e90\Dist.30.zip'.
[11:47:31][Step 3/3] Error count: 1. [11:47:31][Step 3/3] Process
exited with code -1 [11:47:31][Step 3/3] Step Deploy (Command Line)
failed

My build process is working as I end up with the correct artefacts, I just don't seem to be able to deploy my generated artefacts using MSDeploy

This is a screenshot of my artefacts:
artefacts

I managed to get this working by changing my parameters to the following:

-source:iisapp='%teamcity.build.checkoutDir%\dist' -dest:iisapp='C:\www\xxxx-website',computerName="%system.MsDeployServiceUrl%",userName="%system.UserName%",password="%system.Password%",authtype="basic",includeAcls="False"
-verb:sync -AllowUntrusted -verbose

And changing my user to an admin user rather than an IIS user. Note use of iisapp - the key was to read the MSDeploy api using msdeploy -help

FYI - a good test is to use the intended command against msdeploy.exe in console and check output errors then push command into teamcity when it's working.

I created a grunt and gulp plugin to do just what you are looking to do. gulp-mswebdeploy-package and grunt-mswebdeploy-package will create a ms webdeploy package from any folder and do not require your build to be running on windows.

Tags: gulpmsdeploy
ShareTweetPin

Related Posts

c#-4.0

TeamCity ".Net Process Runner" hangs

We have started migrating our one of several projects to team city as part of CI. Below is how we...

iis-7

MSDeploy IIS7 Sync Web Servers

I am using the following MSDeploy command to pull content and settings from a production server to a staging server...

azure

VSO/VSTS: Azure Powershell - The specified credentials cannot be used with the authentication scheme 'Basic'

I have the following build step which runs a script in Azure Powershell. The script basically publishes files to the...

.net

Auto deploy .Net application to Local machine IIS using Jenkins

I am trying to build and deploy a .NET application to my local machine IIS. I am using Jenkins for...

Next Post

Website deployment using jenkins

Hot tags

.net Algorithm amazon-web-services android Apache ASP.NET c# css django docker eclipse email google-app-engine google-cloud-platform hadoop Hive html ios iphone java javascript kubernetes linux macos maven mysql node.js oracle php postgresql python Python 3.X R ruby ruby-on-rails sockets spring spring boot SQL SQL SERVER TensorFlow unit-testing windows xcode 爬虫

    © 2022 Websitedic.com.

    No Result
    View All Result
    • index
    • Java
    • python
    • javascript