AWSPushAndDeploy.Program.Main C# (CSharp) Method

Main() static private method

static private Main ( string args ) : void
args string
return void
        static void Main(string[] args)
        {
            var options = new Options();
            if (!Parser.Default.ParseArguments(args, options))
                Environment.Exit(1);

            var deployer = new Deployer(new AwsConfiguration
            {
                AssumeRoleTrustDocument = options.AssumeRolePolicyPath,
                IamRolePolicyDocument = options.S3AccessPolicyDocumentPath,
                Bucket = options.BucketName,
                RoleName = options.RoleName,
                CodeDeployRoleName = options.CodeDeployRoleName,
                AwsEndpoint = RegionEndpoint.GetBySystemName(options.RegionEndpoint),
                Proxy = new AwsProxy{ Host = options.ProxyHost, Port = options.ProxyPort }
            });
            var revision = deployer.PushRevision(new ApplicationSetRevision
            {
                ApplicationSetName = options.ApplicationSetName,
                StackName = options.StackName,
                Version = options.Version,
                LocalDirectory = options.BuildDirectoryPath
            });
            try
            {
                deployer.DeployRelease(revision, options.CodeDeployRoleName);
            }
            catch (Exception e)
            {
                Console.WriteLine("AWS Push And Deploy Error:");
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
                Environment.Exit(666);
            }
        }
Program