using System; namespace Ubisoft.Hotel.Package { /// /// Class responsible for storing the values of the environment variables set by the CICD /// public class EnvironmentVariables { public static EnvironmentVariables GetEnvironmentVariables(EnvironmentVariables defaultValues) { EnvironmentVariables returnValue = new EnvironmentVariables { // Name of the branch that the pipeline job checked out before building. BranchName = Environment.GetEnvironmentVariable("BRANCH_NAME"), // Build number of the pipeline job. BuildNumber = Environment.GetEnvironmentVariable("BUILD_NUMBER") }; if (string.IsNullOrEmpty(returnValue.BranchName)) { returnValue.BranchName = defaultValues.BranchName; } if (string.IsNullOrEmpty(returnValue.BuildNumber)) { returnValue.BuildNumber = defaultValues.BuildNumber; } return returnValue; } public string BranchName { get; set; } public string BuildNumber { get; set; } } }