Setting up TeamCity Build Configuration

In this blog, I will go through setting up TeamCity project and adding the minimum needed build steps to rebuild and create the package that will be used through the Octopus server to deploy.

So, here we go:
Start by creating the project and set the VCS root
  1. Let us start by navigating to the Administration on the upper right corner. Click on + Create Project.

  2. Insert the General Setting. Project name and ID, you can leave other information as it is
  3. Setup the VCS root (I already have a created root. If you want to create one click on Create VCS root)
  4. Start by inserting type of VCS, root name, fetch URL and the branch you want to use for the deployment
  5. Specify the Authentication method and insert the needed credentials
  6. Now test the information inserted and credential by clicking on Test Connection. Then save

Next we will create the build steps. Remember that there is a large number of Runner Types that can be added to configure the sequence of build steps to be executed, here is a simple configuration.
  1. Scroll down to the Build Configuration (I already have 2 which i will illustrate using them).
    To add a new Build Configuration click on + Create build configuration
  2. Now set the Name, ID, Build number format as in the image

  3. Now the Artifacts (Those are the files that get produced after the build step is completed and they represent the files needed for the deployment or in other words they are the ones that gets deployed after they are collected in zip file)
    Artifacts can be specified by Source Path => Destination Path
  4. Set the VCS root
  5. Save and click on Build Steps from the left side navigation (here i already have 2 active build steps and 1 I kept as disabled). To add a build step click on + Add build step
  6. First build step will be NuGet Installer, this will install and update missing packages. Set the information needed as in the image and last thing for this step is to set the package source.
    Since I am using Sitecore one of the package sources will be https://sitecore.myget.org/F/sc-packages/api/v3/index.json
  7. Second build step will be MSBuild, set the step name, MSBuild version, command-line parameter.
    Set the connection to Octopus in Octopus Packaging section, package version, ID, Octopus URL and API key (this is the Key that we got when we set up Octopus)
  8. Let's now add a second Build Configuration, which will be responsible for deploying to Octopus. Give it a name, ID, type, build number format
  9. First build step will be OctopusDeplo: Pack. Set package ID and version to the same ID and version specified in step 6 above
  10. Second build step will be OctopusDeploy: Push Packages. Set Octopus URL, API Key and final package path
  11. A trigger can be set for this build, to be run after the first build is done



Next, will finish up by configuring the environment, project and deployment steps in Octopus

Comments

Popular posts from this blog

Sitecore 9.0.2 SXA 1.7.1 search load more

Less than a year with Sitecore, so far so good.