With AppVeyor you can package application for Octopus, push package, optionally create a release and deploy it.
During “MSBuild” phase AppVeyor can automatically detect ASP.NET Web Application projects in the solution and package them with octo.exe
and save to build artifacts. To make it work, check Package Web Applications for Octopus deployment
under MSBUILD
tab in UI, or set publish_wap_octopus: true
under build
in YAML.
The following tweak environment variables can be used to customize automatic packaging process:
OCTOPUS_PACKAGE_NUGET
- set to true
to package in Nuget format, default is Zip
.OCTOPUS_PACKAGE_VERSION
- customize package version. default is AppVeyor build version. Environment variable can be used here.OCTOPUS_PACKAGE_ADVANCED
- pass additional options to octo.exe pack
.If you build your app using a script or your app is not an ASP.NET Web Application, you can package it with a script sometime after the build and before deployment (after_build
and before_deploy
stages in the build pipeline).
Packaging itself can be done with octo.exe
or 7z.exe
as both are installed on the build workers. Then you need to push the created package as an artifact:
appveyor PushArtifact <path-to-package.zip> -Type OctopusPackage
Optionally, use -DeploymentName
switch, which is handy when you refer to the artifact in deployment settings.
Or, you can simply set the whole folder to be packaged as an artifact and it will be zipped and pushed by AppVeyor:
YAML:
artifacts:
- path: dist
name: MyApp
type: OctopusPackage
More details at packaging artifacts.
By default AppVeyor publishes all .nupkg artifacts to to account/project Nuget feeds (more details). Therefore, any .nupkg
artifact of type OctopusPackage
is published account/project Nuget feeds. If this behavior is not , please set the following in YAML:
nuget:
disable_publish_octopus: true
Or if you use UI, select Do not publish Octopus Deploy .nupkg artifacts to account/project feeds
under Nuget settings.
There are 3 Octopus Deploy scenarios exposed in AppVeyor right now:
push_packages
)create_release
)deploy_release
)The following rules apply:
OctopusPackage
, NuGetPackage
or Zip
).AppVeyor UI enforces those rules. In case you use YAML and, for example, set deploy_release
without setting create_release
, the deploy_release
step will be ignored.
Octopus deploy provider settings are specified on Deployment tab of project settings or in appveyor.yml
.
server
) - Octopus server URL.api_key
) - API key. In UI, just copy-paste key in clear text. In YAML set it as secure variable or simple use Export YAML menu to export Octopus Deploy settings with encrypted API key.space
) - Optional. Space within which octo commands will be executed. The default space will be used if it is omitted.octo_timeout
) - Optional. Time, in minutes, AppVeyor waits for octo.exe
to complete operation. Default is 20 minutes.push_packages
) - when selected in UI or set to true
in YAML, AppVeyor will execute octo.exe push
.artifact
) - Optional. Artifact(s) to push. If omitted, all build artifacts of compatible type (OctopusPackage
, NuGetPackage
or Zip
) will be pushed.push_packages_advanced
) - Optional. Additional options passed to octo.exe push
.create_release
) - when selected in UI or set to true
in YAML, AppVeyor will execute octo.exe create-release
.project
) - Optional. Name of the project. Default is AppVeyor project name.release_number
) - Optional. Release number (version) to use for the new release. If omitted, Octopus will automatically determine the correct one.release_channel
) - Optional. Channel to use for the new release. If omitted, Octopus Deploy will select the best channel.create_release_advanced
) - Optional. Additional options passed to octo.exe create-release
.deploy_release
) - when selected in UI or set to true
in YAML, AppVeyor will execute octo.exe deploy-release
. As said earlier, this require Create release (create_release
).environment
) - Environment to deploy to.deploy_tenants
) - Optional. Create a deployment for specific tenant(s). For multiple tenants it can be comma or semicolon or space separated list.deploy_wait
) - Optional. When selected in UI or set to true
in YAML, octo.exe
will not exit until deployment completed.deploy_release_advanced
) - Optional. Additional options passed to octo.exe deploy-release
.