shamim
shamim

Reputation: 6768

How in octopus deploy set the package version number and release that version automatically

As a new user of the Octopus Deploy needs to do many manual things, I am looking for a way to automate those things for my local windows server and clients.

Give the details of what I am doing and what I need to get done manually. Following are the steps I am following:

  1. Developer team works on vs project for changes in the code.
  2. Update the repository, write comments and commit to the changes done in the code
  3. Each one did pull/push
  4. Manually run command to create project package
  5. Manually pass that NuGet package to Octopus deploy use following command
  6. For each deployment manually create
    • Select desired Octopus project from the project menu,
    • Select “add Step” to deploy a package,
    • configure release for the new package,
    • configure deployment lifecycles etc.
  7. Manually press the Octopus deploy button and check task log.

Create package command

msbuild /t:build /p:RunOctoPack=true
 /p:OctoPackPackageVersion=1.0.0-BETA-1 /p:OctoPackReleaseNotesFile=ReleaseNotes.txt 
 /p:OctoPackPublishPackageToHttp=http://localhost/nuget/packages /p:OctoPackPublishApiKey=API-9MQWIWVDKR44YSGYROUGPPFBXX

Upvotes: 0

Views: 5265

Answers (1)

Richardissimo
Richardissimo

Reputation: 5763

I think you're asking how to configure Octopus Deploy to automatically set the Release version number based on a Package version number, and make it automatically create a Release when a new package arrives, and make it deploy that Release as soon as it is created. (But I only got that from the title of your question - there wasn't a question in the body of your question, so I hope I have understood what you wanted)

  1. Go to the Octopus Project's Settings. You can change the version number to get its version number from a Package, rather than the default value supplied by Octopus.
  2. Go to the Octopus Project's Triggers. SetUp the "Automatic Release Creation" by telling it which (one) Package to use as a trigger for creating a Release. If you have several, you must set it to be the last one given to Octopus, so if you're doing this manually, think about creating an automated build so it is repeatable.
  3. Go to the definition of the Lifecycle used by your project. Change the first environment, so that the releases are automatically deployed into it.

Now when you create a Package it will create a Release with the same version number, and deploy it to your first environment.

If you have an automated build on place, this means that just by checking in a change to your application, the new version will be deployed into your first environment without doing anything else.

So the only manual thing is the one-off costs of initially setting up the automated build and the Octopus Deploy project.

Upvotes: 4

Related Questions