Hi, so I am trying to reverse engineer my YAML what was built for Azure DevOps Pipelines. It simply ran a PowerShell script to stamp some PowerShell scripts, package the selected file into a NuGet package and pushed to Octopus.
How it was built in Azure DevOps was multiple pipelines calling a single YAML. This enabled me to pass in different variables, aka the script's name for the NuGet package, and I could also trigger the single script overbuilding everything every time.
Is there any way to replicate this in Bitbucket?
This is the Azure DevOps YAML.
variables:
NuGetPackageID: 'Infrastructure-$(ProjectName)'
NuGetPackageVersionNumber: '$(VersionNumber)-$(CodeChangeID)-$(Build.BuildNumber)'
jobs:
- job: BuildProject
displayName: Build and create package
continueOnError: false
workspace:
clean: resources
steps:
- task: DevOps-StampVersionDetails.DevOps.StampVersionDetails.DevOps.StampVersionDetails@1
displayName: 'Stamp Version Details '
inputs:
InputSourceControlType: GIT
InputVersionStyle: 9
InputProductType: CloudFormation
InputProject: '$(ProjectName)'
InputStampAssembly: false
InputStampSQL: false
InputStampCsproj: true
InputStampCsprojCustom: true
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- task: CopyFiles@2
displayName: 'Copy CloudFormation file to artifact staging director'
inputs:
SourceFolder: '$(Build.SourcesDirectory)\'
Contents: '**\*-$(ProjectName).yml'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
- task: octopusdeploy.octopus-deploy-build-release-tasks.octopus-pack.OctopusPack@4
displayName: 'Package $(ProjectName) into NuGet package'
inputs:
PackageId: '$(NuGetPackageID)'
PackageVersion: '$(NuGetPackageVersionNumber)'
SourcePath: '$(Build.ArtifactStagingDirectory)'
OutputPath: '$(Build.ArtifactStagingDirectory)'
NuGetAuthor: 'Company Name'
NuGetTitle: '$(NuGetPackageID)'
NuGetDescription: 'Created by build: $(Build.BuildNumber)'
Include: |
*.yml
- task: octopusdeploy.octopus-deploy-build-release-tasks.octopus-metadata.OctopusMetadata@4
displayName: 'Push Package Build Information to Octopus'
inputs:
OctoConnectedServiceName: 'Octopus'
Space: Default
PackageId: '$(NuGetPackageID)'
PackageVersion: '$(NuGetPackageVersionNumber)'
Replace: true
- task: DeleteFiles@1
displayName: 'Clean artifact staging directory before publishing'
inputs:
SourceFolder: '$(Build.ArtifactStagingDirectory)'
Contents: |
*-$(ProjectName).yml
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: $(Build.BuildNumber)'
inputs:
ArtifactName: '$(Build.BuildNumber)'