简体   繁体   中英

Deploying Multiple Sites in Single Solution by FTP in Visual Studio Team Services / Azure DevOps

I have a Visual Studio solution which has various class libraries and several ASP.NET website projects. The website projects reference the class library projects, so for ease of working they need to be in the same solution.

The whole solution is version controlled through Visual Studio Team Services (now Azure DevOps).

When the solution is committed to VSTS, the solution is automatically built by VSTS.

I also want to use continuous integration and deploy the website projects in the solution to various web servers via FTP (FTP is the only option for this, MSDeploy etc is not available). The releases will be triggered by the build on commit.

The problem is that I need to publish the actual website files via FTP during a release triggered by the build, but the build artifact only contains .zip files.

For example, if the solution has a website project called 'MyWebsite' the build artifact has a zip called Mywebsite.zip, but no files are accessible. As such, I can deploy a zip file to the web server, but not the actual website files.

How can I deploy these files?

Furthermore, I don't want to deploy all of the files in the website project. I want to deploy a release version (similar to what is published using Visual Studio 2017's Publish tool), which the zip file seems to contain.

VSTS/Azure Dev Ops has Tasks built in to Extract Files and FTP Upload . The release pipeline also has a variables which you can access via release tasks and powershell. $(System.DefaultWorkingDirectory) is where artifacts(built code) are downloaded to. An Agent Job with two tasks should be able to accomplish what you are looking for.

Tasks 任务 Details 提取文件详细信息 在此处输入图片说明

Azure Dev Ops Release Variables

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM