Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pipeline show subcommand #799

Closed
SoManyHs opened this issue Mar 30, 2020 · 5 comments · Fixed by #940
Closed

Add pipeline show subcommand #799

SoManyHs opened this issue Mar 30, 2020 · 5 comments · Fixed by #940
Assignees
Labels
area/pipeline Issues about pipelines to release applications. WIP Pull requests that are being modified now.

Comments

@SoManyHs
Copy link
Contributor

SoManyHs commented Mar 30, 2020

Experience

The help menu

$ ecs-preview pipeline show -h
Show details of the pipeline associated with your project.

Usage
  ecs-preview pipeline show [flags]

Flags
      -h,  --help                    Help for command.
      -p, --project string  Name of the project.
      --json            Optional. Output in JSON format.
      --resources       Optional. Resources of your environment.

Examples
  $ ecs-preview pipeline show

Output

**About**
  Name           backend-pipeline-backend-SoManyHs-aws-reinvent-trivia-2019-backend
  Region         us-west-2
  AccountID    xxxxxxxxxx

**Stages**

  Name                  Provider             Details
  ----------           -----------        ----------       
 Source               GitHub                 Repo:  https://github.com/SoManyHs/aws-reinvent-trivia-2019- backend
 Build                   CodeBuild           Project name: backend-pipeline-backend-SoManyHs-aws-reinvent-trivia-2019-backend-BuildProject
 DeployTo-test       Cloudformation   Stack name: backend-test-myapp
 DeployTo-prod      Cloudformation  Stack name: backend-prod-myapp


**Resources**

AWS::IAM::Role                             backend-hotdog-brownies-CustomResourceRole-1BLCINGWXTAJQ
AWS::IAM::Role                             backend-hotdog-brownies-ExecutionRole-1BGL72COFIILB
AWS::CodeBuild::Project              ...
AWS::CodePipeline::Pipeline        ... 

etc

JSON:

$ ecs-preview pipeline show --json

[
  {
    "Project": "my-project",
    "Account": "1234567890"
    "Stages": [
            {
                "name": "Source",
                "actions": [
                    {
                        "inputArtifacts": [],
                        "name": "SourceCodeFor-backend",
                        "actionTypeId": {
                            "category": "Source",
                            "owner": "ThirdParty",
                            "version": "1",
                            "provider": "GitHub"
                        },
                        "outputArtifacts": [
                            {
                                "name": "SCCheckoutArtifact"
                            }
                        ],
                        "configuration": {
                            "Owner": "SoManyHs",
                            "Repo": "aws-reinvent-trivia-2019-backend",
                            "Branch": "master",
                            "OAuthToken": "****"
                        },
                        "runOrder": 1
                    }
                ]
            },
            {
                "name": "Build",
                "actions": [
                    {
                        "inputArtifacts": [
                            {
                                "name": "SCCheckoutArtifact"
                            }
                        ],
                        "name": "Build",
                        "actionTypeId": {
                            "category": "Build",
                            "owner": "AWS",
                            "version": "1",
                            "provider": "CodeBuild"
                        },
                        "outputArtifacts": [
                            {
                                "name": "BuildOutput"
                            }
                        ],
                        "configuration": {
                            "ProjectName": "backend-pipeline-backend-SoManyHs-aws-reinvent-trivia-2019-backend-BuildProject"
                        },
                        "runOrder": 1
                    }
                ]
            },
            {
                "name": "DeployTo-staging",
                "actions": [
                    {
                        "inputArtifacts": [
                            {
                                "name": "BuildOutput"
                            }
                        ],
                        "name": "CreateOrUpdate-ducky-staging",
                        "roleArn": "arn:aws:iam::xxxxxxxxxx:role/backend-staging-EnvManagerRole",
                        "actionTypeId": {
                            "category": "Deploy",
                            "owner": "AWS",
                            "version": "1",
                            "provider": "CloudFormation"
                        },
                        "outputArtifacts": [],
                        "configuration": {
                            "ActionMode": "CREATE_UPDATE",
                            "ChangeSetName": "backend-staging-ducky",
                            "RoleArn": "arn:aws:iam::xxxxxxxx:role/backend-staging-CFNExecutionRole",
                            "Capabilities": "CAPABILITY_NAMED_IAM",
                            "StackName": "backend-staging-ducky",
                            "TemplateConfiguration": "BuildOutput::infrastructure/ducky-staging.params.json",
                            "TemplatePath": "BuildOutput::infrastructure/ducky.stack.yml"
                        },
                        "region": "us-east-2",
                        "runOrder": 2
                    }
                ]
            },
            {
                "name": "DeployTo-hotdog",
                "actions": [
                    {
                        "inputArtifacts": [
                            {
                                "name": "BuildOutput"
                            }
                        ],
                        "name": "CreateOrUpdate-ducky-hotdog",
                        "roleArn": "arn:aws:iam::xxxxxx:role/backend-hotdog-EnvManagerRole",
                        "actionTypeId": {
                            "category": "Deploy",
                            "owner": "AWS",
                            "version": "1",
                            "provider": "CloudFormation"
                        },
                        "outputArtifacts": [],
                        "configuration": {
                            "ActionMode": "CREATE_UPDATE",
                            "ChangeSetName": "backend-hotdog-ducky",
                            "RoleArn": "arn:aws:iam::xxxxxxx:role/backend-hotdog-CFNExecutionRole",
                            "Capabilities": "CAPABILITY_NAMED_IAM",
                            "StackName": "backend-hotdog-ducky",
                            "TemplateConfiguration": "BuildOutput::infrastructure/ducky-hotdog.params.json",
                            "TemplatePath": "BuildOutput::infrastructure/ducky.stack.yml"
                        },
                        "region": "us-east-2",
                        "runOrder": 2
                    }
                ]
            }
        ]
}

Related: #632

@SoManyHs SoManyHs created this issue from a note in Sprint 🏃‍♀️ (Backlog) Mar 30, 2020
@SoManyHs SoManyHs added the area/pipeline Issues about pipelines to release applications. label Apr 1, 2020
@iamhopaul123
Copy link
Contributor

What is the "Details" section for the human output?

@SoManyHs
Copy link
Contributor Author

SoManyHs commented Apr 1, 2020

@iamhopaul123 depends on the stage. I figured for source, it makes sense to show the github repo name, for build, the name of the build project, etc. Since it's not the same for each stage though not sure if there's a better way to display that information, or what else to potentially include that wouldn't be overkill

@iamhopaul123
Copy link
Contributor

@SoManyHs how about another nested structure in "stages" so that we can flatten the "configuration" field? Not sure either if that will be very verbose.

@SoManyHs
Copy link
Contributor Author

SoManyHs commented Apr 1, 2020

Good idea.

Think we need a flag for project or nah?

@iamhopaul123
Copy link
Contributor

Yeah I think we still need a flag for project.

@SoManyHs SoManyHs moved this from Backlog to In progress in Sprint 🏃‍♀️ Apr 5, 2020
@SoManyHs SoManyHs self-assigned this Apr 5, 2020
@SoManyHs SoManyHs added the WIP Pull requests that are being modified now. label Apr 5, 2020
@mergify mergify bot closed this as completed in #940 May 21, 2020
Sprint 🏃‍♀️ automation moved this from In progress to Pending release May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/pipeline Issues about pipelines to release applications. WIP Pull requests that are being modified now.
Projects
Sprint 🏃‍♀️
  
Pending release
Development

Successfully merging a pull request may close this issue.

2 participants