github.com/azunymous/cdx@v0.0.0-20201122180449-fbb46cc4d252/README.md (about)

     1  # cdx - Continuous Deployment Tooling
     2  
     3  ![Github Actions](https://github.com/azunymous/cdx/workflows/Build/badge.svg?branch=master)
     4  
     5  ## Useful utilities for continuous integration and deployment pipelines
     6  - Semantically versioning via Git tags
     7  - Promoting versions of applications or modules
     8  - Getting the latest version or the latest promoted version from Git tags
     9  
    10  ## Install binary release (Mac or Linux)
    11  Download the [latest release](https://github.com/azunymous/cdx/releases/latest) 
    12  binary for your platform. Make it executable (`chmod +x <binary name>`) and
    13  move it somewhere on your `PATH`
    14  
    15  ## Install with Go
    16  ```shell script
    17  GO111MODULE=on go get github.com/azunymous/cdx/cmd/cdx
    18  ```
    19  
    20  ## `cdx tag` commands
    21  
    22  `cdx tag` allows you to manage your tags for versioning easily. It can be used for
    23  both manual and automated releasing of new versions.
    24  
    25  This is designed for multiple versioned applications in a single repository. The format of 
    26  the tag is:
    27  
    28  ```
    29  <module/app name>-<semantic version>
    30  ```
    31  
    32  e.g `my-app-1.0.0`
    33  
    34  `cdx` can be used to mark successful test runs or production candidates. 
    35  This results in a tag like the following: 
    36  
    37  ```
    38  <module/app name>-<semantic version>+<promotion-stage>
    39  ```
    40  
    41  e.g `my-app-1.0.0+passed-extended-tests`
    42  
    43  These are currently lightweight tags.
    44  
    45  ### Release - `cdx tag release -n <app name>` 
    46  The `release` command increments the version of the provided application.
    47  
    48  `cdx tag release -n my-app` on a repository with previously tagged
    49   version `my-app-0.1.0` for example will bump the version 
    50   from `my-app-0.1.0` to `my-app-0.2.0` for the currently checked out 
    51   commit.
    52  
    53  The semantic version field to be bumped can be configured with `--increment` 
    54  e.g 
    55  ```
    56  cdx tag release -n my-app --increment major
    57  ```
    58  
    59  ### Promote - `cdx tag promote -n <app name> <promotion stage>`
    60  
    61  This will promote the current commit to the provided stage for the provided
    62  application/module.
    63  
    64  e.g if the current commit is tagged `my-app-0.1.0`.
    65  
    66  ```
    67  cdx tag promote -n my-app production
    68  ```
    69  Will tag the checked out commit with `my-app-0.1.0+production`
    70  
    71  ### Latest - `cdx tag latest -n <app name> [promotion stage]`
    72  
    73  The `latest` command returns the highest version of the application/module. 
    74  If you provide a promotion stage, cdx returns the highest version of that module which has been
    75   promoted to that stage instead.
    76   
    77  To get only tags of the current commit you can use the `--head` flag.
    78  
    79  ## Build 
    80  
    81  You can build `cdx` with `go build ./cmd/cdx` at the root of this repository. 
    82  You need Go installed with support for Go modules. 
    83  
    84  ## Notes
    85  - cdx uses lightweight tags for versioning. Currently `latest` can detect annotated 
    86  tags, but cdx does not support versioning with them.
    87  - The `--push` flag delegates to `git push`, other commands use the go-git library and have no
    88  dependencies
    89  - `cdx tag` does not enforce ordered tagging. If you run `cdx tag release` from a branch or on an
    90  untagged commit, it will search for the highest version across all references. The exception to this
    91  is if the `--push` flag is used, which makes sure the current commit is on `origin/master`.
    92  - Pre-releases are currently ignored. `my-app-1.0.0-rc1+passed-extended-tests` is ignored and
    93  the latest version for the `passed-extended-tests` stage is `my-app-0.999.0+passed-extended-tests`
    94  for example. The same applies for finding the latest tag in general: `0.1.0` vs `0.2.0-RC1`, 
    95  `0.1.0` would be returned as the latest version.