Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

#pin version : Pinning package version for a particular release in project.json

Suhas Joshi edited this page May 21, 2015 · 3 revisions

Goal

  • Pin the packages in project.json for all repos for a particular release so that the customers can build projects with fixed version of dependent packages.
  • Revert project.json in the future to use a particular version of packages.

Overview

A new target is added in the makefile.shade named pin-version that can be run to pin the version of ASP.NET and CoreCLR packages for all projects in each of the repos in Universe. Prior to running the target we need to set up few environmental variables that are used by the target.

NOTE: To make the necessary updates, it is highly important to get the old and new release monikers for ASP.NET, CORE CLR and Roslyn packages. These have to either set directly in the makefile or as Environmental variables.

Environment variables

  • BUILD_BRANCH : The branch to push the changes to. Each repo is cloned via github and this branch is checked out and used. If not defined defaults then updated fails
  • OLD_RELEASE : the release moniker in the project.json of current branch. For example if working on the master branch, this value can be 'beta4'. If kept empty then it is considered that the versions are in the form "-*". It is important that this is correct since the expression uses this value to search and replace.
  • NEW_RELEASE : the release moniker for the new release. For example if the working on release 'beta4', then the packages will be in the form '-beta4-*'. If the current branch is a stable branch then the wildcard is removed
  • CORECLR_RELEASE_BUILD_OLD : The build number of CoreCLR packages that are in the current project.json for the branch. All CLR packages have the same build version.
  • CORECLR_RELEASE_BUILD_NEW : The build number of CoreCLR packages for the current release. All CLR packages have the same build version.
  • OLD_CORECLR_RELEASE : Old release moniker of CLR packages that are in the project.json before running the process
  • NEW_CORECLR_RELEASE : New target Core CLR release moniker
  • OLD_ROSLYN_RELEASE : Old release moniker of Roslyn packages that are in the project.json before running the process
  • NEW_ROSLYN_RELEASE : New target Roslyn release moniker
  • BUILDCMD_RELEASE : Release version of Korebuild and DNX to use which is used in the build.cmd of each repo

To summarize the target does the following changes

  • Copies the new build.cmd file which can pull in fixed version of KoreBuild and DNX
  • Replaces wildcards for ASP.NET versions in project.json of each project in each repo with the one based on the release.For example for ASP.NET packages, if the old version is not defined then it is assumed that the current branch has "-" as the wildcard version for packages. If the new version release moniker is defined then after update it is updated to "-{release}-". So if the current release is beta5, all the project.json entries will be updated to "-beta5-*". If the branch is a stable one, then the wildcard is removed. Hence the final version is "-beta5".
  • For CoreCLR packages, if the new release is defined, the new build has to be defined too since CoreCLR packages are in the fixed for "-{release}-{buildNumber}"
  • Compile project to create project.lock.json files
  • Set 'locked=true' in each of the lock files

Include the project.json and project.lock.json files and commit