All the repository is getting deployed

Hi,

I’m trying to do some tests and am using Azure DevOps, Octopus Cloud and a free AWS VM.

I’ve created three pipelines; a console app, a Windows service and an IIS web app. All of them are different projects in the same solution. The problem I’m having is that whenever it goes to deploy to the VM, what gets physically put on disk is not the published solution but the whole repository every time.

What am I doing wrong?

Here’s my YAML for the console app:

.NET Desktop

trigger:
branches:
include:
- master
paths:
include:
- HelloWorld/HelloWorld/*

pool:
vmImage: ‘windows-latest’

variables:
solution: ‘**/*.sln’
buildPlatform: ‘Any CPU’
buildConfiguration: ‘Release’

steps:

  • task: NuGetToolInstaller@1

  • task: NuGetCommand@2
    inputs:
    restoreSolution: ‘$(solution)’

  • task: VSBuild@1
    inputs:
    solution: ‘$(solution)’
    platform: ‘$(buildPlatform)’
    configuration: ‘$(buildConfiguration)’

  • task: VSTest@2
    inputs:
    platform: ‘$(buildPlatform)’
    configuration: ‘$(buildConfiguration)’

  • task: OctopusPack@4
    inputs:
    PackageId: ‘HelloWorld’
    PackageFormat: ‘NuPkg’
    PackageVersion: ‘$(Build.BuildNumber)’
    SourcePath: ‘$(Build.SourcesDirectory)’
    OutputPath: ‘$(Build.ArtifactStagingDirectory)’

  • task: PublishBuildArtifacts@1
    inputs:
    PathtoPublish: ‘$(Build.ArtifactStagingDirectory)’
    ArtifactName: ‘drop’
    publishLocation: ‘Container’

  • task: OctopusPush@4
    inputs:
    OctoConnectedServiceName: ‘Ahdem please’
    Space: ‘Spaces-1’
    Package: ‘$(Build.ArtifactStagingDirectory)\HelloWorld.$(Build.BuildNumber).nupkg’
    Replace: ‘false’

  • task: OctopusCreateRelease@4
    inputs:
    OctoConnectedServiceName: ‘Ahdem please’
    Space: ‘Spaces-1’
    ProjectName: ‘Projects-1’
    ReleaseNumber: ‘$(Build.BuildNumber)’
    Channel: ‘Channels-1’
    DeployToEnvironment: ‘Environments-1’
    DeploymentProgress: true

Hi Mark,

Welcome to the Octopus Boards!

I think the problem is you may be missing some subdirectories in your parameters. Can you take a look at this example of a multi-project solution yaml and see if you can adapt the logic to your build?

Please let me know if it works or if you need more help with it.

multiyaml.txt (5.2 KB)

Thanks,
Jeremy

That worked like a charm! Thanks!
Do you have an example for an ASP.NET web application which needs to be published and uploaded please (.NET Framework)?

Hey Mark,

I’m glad you got it going. We have a section with end to end guides over here: https://octopus.com/docs/guides

This one may be able to help you. It’s ASP.NET, Azure Dev Ops, Git, Octopus, Azure Website

Please let me know if that guide covers what you needed.

Thanks,
Jeremy

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.