예제 #1
0
        public async Task BuildCodePipelinelevel_1And2(int level, string oAuthToken)
        {
            var helper = new CloudFormationHelper(
                GlobalVariables.Enviroment, GlobalVariables.Region, GlobalVariables.Color);

            var sa_parameters = new List <KeyValuePair <string, string> >();

            sa_parameters.Add(new KeyValuePair <string, string>("Environment", GlobalVariables.Enviroment.ToString()));
            sa_parameters.Add(new KeyValuePair <string, string>("OAuthToken", oAuthToken));

            string stackName = $"{GlobalVariables.Enviroment}-level-{level}";

            if (level == 2)
            {
                sa_parameters.Add(new KeyValuePair <string, string>("Color", GlobalVariables.Color));
                stackName += $"-{GlobalVariables.Color}";
            }

            await helper.CreateStack
            (
                ConfigurationManager.AppSettings["InfraFileFolder"],
                stackName,
                ReadCodePipelineConfigs(level),
                sa_parameters
            );

            LogServices.WriteLog($"{GlobalVariables.Enviroment}-level-{level}-{GlobalVariables.Color} is created.",
                                 LogType.Information, GlobalVariables.Enviroment.ToString());
        }
예제 #2
0
        //No color for now.
        public async Task SetDNS()
        {
            var helper = new CloudFormationHelper(
                GlobalVariables.Enviroment, GlobalVariables.Region, GlobalVariables.Color);

            var sa_parameters = new List <KeyValuePair <string, string> >();

            sa_parameters.Add(new KeyValuePair <string, string>("Environment", GlobalVariables.Enviroment.ToString()));
            sa_parameters.Add(new KeyValuePair <string, string>("Color", GlobalVariables.Color));
            string stackName = $"{GlobalVariables.Enviroment}-DNS";

            await helper.CreateStack
            (
                ConfigurationManager.AppSettings["InfraFileFolder"],
                stackName,
                ReadCodePipelineConfigs(4),
                sa_parameters
            );
        }
예제 #3
0
        public async Task BuildCodePipelinelevel_3(List <string> apps)
        {
            var helper = new CloudFormationHelper(
                GlobalVariables.Enviroment, GlobalVariables.Region, GlobalVariables.Color);

            foreach (string app in apps)
            {
                var sa_parameters = new List <KeyValuePair <string, string> >();
                sa_parameters.Add(new KeyValuePair <string, string>("Environment", GlobalVariables.Enviroment.ToString()));
                sa_parameters.Add(new KeyValuePair <string, string>("Color", GlobalVariables.Color));
                sa_parameters.Add(new KeyValuePair <string, string>("Application", app));

                await helper.CreateStack
                (
                    ConfigurationManager.AppSettings["InfraFileFolder"],
                    $"{GlobalVariables.Enviroment}-level-3-{app}-{GlobalVariables.Color}",
                    ReadCodePipelineConfigs(3),
                    sa_parameters
                );

                LogServices.WriteLog($"{GlobalVariables.Enviroment}-level-3-{GlobalVariables.Color}-{app} is created.",
                                     LogType.Information, GlobalVariables.Enviroment.ToString());
            }
        }