Ejemplo n.º 1
0
 protected virtual bool GetChanges(CloudRuntimePackage package, out Dictionary <string, string> changes)
 {
     changes = new Dictionary <string, string>();
     changes[Resources.RuntimeTypeKey] = package.Runtime.ToString().ToLower();
     changes[Resources.RuntimeUrlKey]  = package.PackageUri.ToString();
     return(true);
 }
Ejemplo n.º 2
0
        public virtual void ApplyRuntime(CloudRuntimePackage package, WorkerRole workerRole)
        {
            Dictionary <string, string> changes;

            if (this.GetChanges(package, out changes))
            {
                ApplyRoleXmlChanges(changes, workerRole);
            }

            ApplyScaffoldingChanges(package);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Create a cloud runtime application, essentialy this is a tuple of runtime X package X role
        /// </summary>
        /// <param name="cloudRuntime">The runtime in the tuple</param>
        /// <param name="cloudRuntimePackage">The package in the tuple</param>
        /// <param name="role">The role to apply the package to</param>
        /// <returns>The tuple, use the apply method to apply the runtime as specified</returns>
        public static CloudRuntimeApplicator CreateCloudRuntimeApplicator(CloudRuntime cloudRuntime, CloudRuntimePackage cloudRuntimePackage, WorkerRole role)
        {
            CloudRuntimeApplicator applicator = new CloudRuntimeApplicator
            {
                Runtime = cloudRuntime,
                Package = cloudRuntimePackage,
                WorkerRole = role
            };

            return applicator;
        }
Ejemplo n.º 4
0
        public virtual bool ValidateMatch(CloudRuntimePackage runtime, out string warningText)
        {
            warningText = null;
            bool result = this.Match(runtime);

            if (!result)
            {
                warningText = this.GenerateWarningText(runtime);
            }

            return(result);
        }
        /// <summary>
        /// Create a cloud runtime application, essentialy this is a tuple of runtime X package X role
        /// </summary>
        /// <param name="cloudRuntime">The runtime in the tuple</param>
        /// <param name="cloudRuntimePackage">The package in the tuple</param>
        /// <param name="role">The role to apply the package to</param>
        /// <returns>The tuple, use the apply method to apply the runtime as specified</returns>
        public static CloudRuntimeApplicator CreateCloudRuntimeApplicator(CloudRuntime cloudRuntime, CloudRuntimePackage cloudRuntimePackage, WorkerRole role)
        {
            CloudRuntimeApplicator applicator = new CloudRuntimeApplicator
            {
                Runtime    = cloudRuntime,
                Package    = cloudRuntimePackage,
                WorkerRole = role
            };

            return(applicator);
        }
Ejemplo n.º 6
0
        public virtual bool ValidateMatch(CloudRuntimePackage runtime, out string warningText)
        {
            warningText = null;
            bool result = this.Match(runtime);
            if (!result)
            {
                warningText = this.GenerateWarningText(runtime);
            }

            return result;
        }
Ejemplo n.º 7
0
 protected override bool GetChanges(CloudRuntimePackage package, out Dictionary <string, string> changes)
 {
     changes = null;
     return(false);
 }
Ejemplo n.º 8
0
        public virtual void ApplyRuntime(CloudRuntimePackage package, WorkerRole workerRole)
        {
            Dictionary<string, string> changes;
            if (this.GetChanges(package, out changes))
            {
                ApplyRoleXmlChanges(changes, workerRole);
            }

            ApplyScaffoldingChanges(package);
        }
Ejemplo n.º 9
0
 protected abstract string GenerateWarningText(CloudRuntimePackage package);
Ejemplo n.º 10
0
 public override bool Match(CloudRuntimePackage runtime)
 {
     return(true);
 }
Ejemplo n.º 11
0
 protected abstract string GenerateWarningText(CloudRuntimePackage package);
Ejemplo n.º 12
0
 public abstract bool Match(CloudRuntimePackage runtime);
Ejemplo n.º 13
0
 protected override string GenerateWarningText(CloudRuntimePackage package)
 {
     return null;
 }
Ejemplo n.º 14
0
 protected override bool GetChanges(CloudRuntimePackage package, out Dictionary<string, string> changes)
 {
     changes = null;
     return false;
 }
Ejemplo n.º 15
0
 public override bool Match(CloudRuntimePackage runtime)
 {
     return true;
 }
Ejemplo n.º 16
0
            protected override bool GetChanges(CloudRuntimePackage package, out Dictionary<string, string> changes)
            {
                base.GetChanges(package, out changes);

                Debug.Assert(changes.ContainsKey(Resources.RuntimeTypeKey), "Cache runtime should be added before calling this method");
                Debug.Assert(changes.ContainsKey(Resources.RuntimeUrlKey), "Cache runtime should be added before calling this method");

                changes[Resources.CacheRuntimeVersionKey] = package.Version;

                return true;
            }
Ejemplo n.º 17
0
 protected virtual bool GetChanges(CloudRuntimePackage package, out Dictionary<string, string> changes)
 {
     changes = new Dictionary<string, string>();
     changes[Resources.RuntimeTypeKey] = package.Runtime.ToString().ToLower();
     changes[Resources.RuntimeUrlKey] = package.PackageUri.ToString();
     return true;
 }
Ejemplo n.º 18
0
 public abstract bool Match(CloudRuntimePackage runtime);
Ejemplo n.º 19
0
 public override bool Match(CloudRuntimePackage runtime)
 {
     // here is where we would put in semver semantics
     return(string.Equals(this.Version, runtime.Version, StringComparison.OrdinalIgnoreCase));
 }
Ejemplo n.º 20
0
 protected abstract void ApplyScaffoldingChanges(CloudRuntimePackage package);
Ejemplo n.º 21
0
 public override bool Match(CloudRuntimePackage runtime)
 {
     return(this.Version.Equals(runtime.Version, StringComparison.OrdinalIgnoreCase));
 }
Ejemplo n.º 22
0
 public override bool Match(CloudRuntimePackage runtime)
 {
     return this.Version.Equals(runtime.Version, StringComparison.OrdinalIgnoreCase);
 }
Ejemplo n.º 23
0
 protected virtual void ApplyScaffoldingChanges(CloudRuntimePackage package)
 {
 }
Ejemplo n.º 24
0
 protected override void ApplyScaffoldingChanges(CloudRuntimePackage package)
 {
 }
Ejemplo n.º 25
0
 protected override string GenerateWarningText(CloudRuntimePackage package)
 {
     return string.Format(Resources.PHPVersionWarningText, package.Version, this.RoleName,
         this.Version);
 }
Ejemplo n.º 26
0
 protected override void ApplyScaffoldingChanges(CloudRuntimePackage package)
 {
     JavaScriptPackageHelpers.EnsurePackageJsonExists(this.FilePath, this.RoleName);
     JavaScriptPackageHelpers.TrySetEngineVersion(this.FilePath, GetEngineKey(), package.Version);
 }
Ejemplo n.º 27
0
 protected override bool GetChanges(CloudRuntimePackage package, out Dictionary<string, string> changes)
 {
     bool succeed = base.GetChanges(package, out changes);
     changes[Resources.RuntimeVersionPrimaryKey] = package.Version;
     return succeed;
 }
Ejemplo n.º 28
0
 protected override string GenerateWarningText(CloudRuntimePackage package)
 {
     return(string.Format(Resources.PHPVersionWarningText, package.Version, this.RoleName,
                          this.Version));
 }
Ejemplo n.º 29
0
 public override bool Match(CloudRuntimePackage runtime)
 {
     // here is where we would put in semver semantics
     return string.Equals(this.Version, runtime.Version, StringComparison.OrdinalIgnoreCase);
 }
Ejemplo n.º 30
0
 protected override string GenerateWarningText(CloudRuntimePackage package)
 {
     return(null);
 }
Ejemplo n.º 31
0
 protected override void ApplyScaffoldingChanges(CloudRuntimePackage package)
 {
     JavaScriptPackageHelpers.EnsurePackageJsonExists(this.FilePath, this.RoleName);
     JavaScriptPackageHelpers.TrySetEngineVersion(this.FilePath, GetEngineKey(), package.Version);
 }
Ejemplo n.º 32
0
 protected override void ApplyScaffoldingChanges(CloudRuntimePackage package)
 {
 }
Ejemplo n.º 33
0
 protected abstract void ApplyScaffoldingChanges(CloudRuntimePackage package);