github.com/RyanSiu1995/gcb-visualizer@v1.0.2-0.20211121083050-f618fa372726/README.md (about)

     1  # Google Cloud Build Pipeline Visualizer
     2  
     3  [![build](https://github.com/RyanSiu1995/gcb-visualizer/workflows/Go/badge.svg)](https://github.com/RyanSiu1995/gcb-visualizer/workflows/Go/badge.svg) [![codecov](https://codecov.io/gh/RyanSiu1995/gcb-visualizer/branch/master/graph/badge.svg?token=6QAXYRV25Z)](https://codecov.io/gh/RyanSiu1995/gcb-visualizer)
     4  
     5  For the current version of Google cloud build, it supports the async process with the variable `waitFor`. With the growth of complexity of your pipeline, it will be hard to maintain the async flow. Unlike Jenkins and CircleCI, there is no visualizer for your pipeline. This application aims at visualize the pipeline and help the developers to debug their cloud build.
     6  
     7  ## Current features
     8  * YAML format cloud build definition digestion
     9  * Temporary graph rendering
    10  * Save graph as dot, png, jpg or jpeg
    11  * JSON format support
    12  
    13  ## Rule of cloud build async process
    14  From the Google [docs](https://cloud.google.com/cloud-build/docs/configuring-builds/configure-build-step-order), there are a few rules for the async process.
    15  1. If no values are provided for waitFor, the build step waits for all prior build steps in the build request to complete successfully before running.
    16  1. A step is dependent on every id in its waitFor and will not launch until each dependency has completed successfully.
    17  1. By declaring that a step depends only on `-`, the step runs immediately when the build starts.
    18  
    19  ## How to install
    20  1. Through `go get` (Recommended)
    21  
    22     You can install the binary through the following command.
    23     ```bash
    24     go get -u github.com/RyanSiu1995/gcb-visualizer
    25     ```
    26  1. Install the pre-built binary
    27  
    28     You can download the pre-built binary in [release page](https://github.com/RyanSiu1995/gcb-visualizer/releases) of this repo. Because of the C binding in the Graphviz library, there is a difficulty in building binary based on different common OS and Arch. The current pre-built binaries are built under 64 bit. If you are an user with 32 bits system, please use other approach. If the pre-built binary does not work. Please report on the issue.
    29  1. Use pre-built docker image
    30  
    31     You can use docker image released to execute the gcb-visualizer without considering the OS and Arch. Please follow this instruction to setup the command alias.
    32     ```bash
    33     docker pull ryansiu1995/gcb-visualizer:latest
    34     alias gcb-visualizer="docker run -v $(pwd):/app ryansiu1995/gcb-visualizer:latest"
    35     ```
    36     or this command in powershell
    37     ```powershell
    38     docker pull ryansiu1995/gcb-visualizer:latest
    39     Set-Alias gcb-visualizer "docker run -v $(pwd):/app ryansiu1995/gcb-visualizer:latest"
    40     ```
    41     You can put the alias to your profile in order to create a permanent alias.
    42  
    43  ## How to use
    44  You can visualize your pipeline with the following command.
    45  ```bash
    46  gcb-visualizer visualize <your-cloudbuild-yaml-or-json-file>
    47  ```
    48  If you want to output the graph into other formats, you can use the output flag as the following.
    49  ```bash
    50  gcb-visualizer visualize --output my-pipeline.jpg <your-cloudbuild-yaml>
    51  ```
    52  The current supported output formats are jpg, jpeg, dot and png.
    53  
    54  ## Example Output
    55  Given an example input of something like the [Google Cloud integration test example](https://github.com/GoogleCloudPlatform/cloudbuild-integration-testing/blob/master/cloudbuild.compose.yaml)
    56  you should get an output that looks something like this
    57  
    58  ![Go Builder output](./example/example.png)
    59  
    60  ## Future features
    61  * Cloudbuild definition linting and checking
    62  * Multiple OS and Arch binary building
    63  * Brew, Apt and Chocolatey support
    64  * Quick installation script
    65  * More beautiful generated graph
    66  
    67  ## Contributing
    68  Please feel free to submit a pull request or open an issue for the application improvement. Before creating the pull request, please kindly run the follow command to test the program
    69  ```bash
    70  make tests
    71  ```
    72  
    73  ## License
    74  This project is licensed under the MIT License - see the [LICENSE.md](./LICENSE.md) file for details