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

TER-408 add git workflow doc #165

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Automaton flows on repository

The Terrarium repo has various automation flows in place. Mainly there are three events that trigger the automation in this repo:

1. New Pull request
1. Merge to the base branch (main)
1. Create new release tag (v*)

## 1. New pull request

The intent of automation pipelines here is to validate the changes coming from the pull requests.

```mermaid
flowchart LR
Code --> PR --> CH["Checks\nGitHub Action"]
PR --> CLI["CLI test automation\nCode Pipes"]
PR --> API["API test automation\nAZP"]
CH --> UT["Unit Test"]
CH --> ST["Smoke test\nAPI health-check & harvest flow"]
```

## 2. Merge to the base branch (main)

There are two automation intents that run on merge to master:

### 1. Validation

This is same as the PR checks, but is important here to ensure sanity of the code merge.

### 2. Build container images and deploy to staging

The terrarium repo produces two docker images:

- **docker.io/cldcvr/terrarium-api** - Terrarium API image is used to deploy the API server. It is based on alpine and contains the go binary for server.
- **docker.io/cldcvr/terrarium-farm-harvester** - Terrarium Harvester image is based on terraform image and contains Terrarium CLI binary built in along with a Makefile that contains sequence of running the terraform harvest commands.

```mermaid
flowchart LR
Code --> Main --> H["Push harvester image\nGitHub Action\ncldcvr/terrarium-farm-harvester:latest,\ncldcvr/terrarium-farm-harvester:commit_sha"]
H --> F["Used in farm repo"]
Main --> API["Push API Image\nCode Pipes App Integration\ncldcvr/terrarium-api:latest,\ncldcvr/terrarium-api:commit_sha"]
API --> D["Deploy to Staging"]
Main --> C["Unit tests and integration test pipelines"]
```

## 3. Create new release tag (v*)

The release process currently deals with releasing the new version of Terrarium CLI binary. The Terrarium API doesn't have a Prod release (or deployment) setup currently.
kanaksinghal marked this conversation as resolved.
Show resolved Hide resolved

```mermaid
flowchart TD
Code --> PR["Create pre-release\neg tag v1.0.0"]
PR --> A["Build CLI binaries for multiple platforms\nGitHub Action pipeline"]
A --> U["Upload binaries to the GitHub Release"]
U --> GHL["Mark the GitHub release as latest"]
U --> HBL["Update the latest version on Homebrew-tap"]
```
2 changes: 1 addition & 1 deletion .github/workflows/build-n-push.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Push to DockerHub
name: Push Harvester Image

on:
push:
Expand Down