https://github.com/freight-trust/actions-gitops-update
coordinated gitops
https://github.com/freight-trust/actions-gitops-update
devops git gitops gitworkflow kuberentes
Last synced: 4 months ago
JSON representation
coordinated gitops
- Host: GitHub
- URL: https://github.com/freight-trust/actions-gitops-update
- Owner: freight-trust
- License: apache-2.0
- Created: 2020-07-12T14:49:06.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-09T11:11:27.000Z (almost 5 years ago)
- Last Synced: 2025-02-20T18:18:06.133Z (4 months ago)
- Topics: devops, git, gitops, gitworkflow, kuberentes
- Language: Shell
- Homepage:
- Size: 106 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
@freight-trust/gitops-update
============================
**A GitHub Action and Workflow to update a collection of Kubernetes YAMLs for use in a GitOps-based deployment strategy**[](https://oclif.io)
[](https://npmjs.org/package/@freight-trust/gitops-update)
[](https://npmjs.org/package/@freight-trust/gitops-update)
[](https://github.com/https://github.com/freight-trust/actions-gitops-update/blob/master/package.json)- [GitOps Actions@Workflow](#gitops-actions-workflow)
* [Usage](#usage)
+ [Default Kubernetes artifacts via Helm, etc.](#default-kubernetes-artifacts-via-helm--etc)
+ [Appsody app-deploy.yaml](#appsody-app-deployyaml)
* [Parameters](#parameters)
+ [Inputs](#inputs)
* [Example](#example)
* [License](#license)
* [Usage](#usage)
* [Commands](#commands)### Usage
```sh-session
$ npm install -g @freight-trust/gitops-update
$ gitops-update COMMAND
running command...
$ gitops-update (-v|--version|version)
@freight-trust/gitops-update/1.0.5 darwin-x64 node-v10.21.0
$ gitops-update --help [COMMAND]
USAGE
$ gitops-update COMMAND
...
```# GitOps Actions@Workflow
- [GitOps Actions@Workflow](#gitops-actions-workflow)
* [Usage](#usage)
+ [Default Kubernetes artifacts via Helm, etc.](#default-kubernetes-artifacts-via-helm--etc)
+ [Appsody app-deploy.yaml](#appsody-app-deployyaml)
* [Parameters](#parameters)
+ [Inputs](#inputs)
* [Example](#example)
* [License](#license)## Usage
### Default Kubernetes artifacts via Helm, etc.
```yml
- name: Update GitOps YAMLs
id: update-gitops-yamls
uses: freight-trust/actions-update-gitops@master
with:
filePath: 'templates/deployment.yaml'
```The action expects to be run inside a working directory (by default, this is the `/github/workspace` directory in the virtual environment), with a default collection of application component deployment YAML files that have been created by `helm template` commands with the following folder structure:
```
/{component-a}/templates/deployment.yaml
/{component-a}/templates/service.yaml
/{component-b}/templates/deployment.yaml
/{component-b}/templates/service.yaml
...
/{component-n}/templates/deployment.yaml
/{component-n}/templates/service.yaml
```The action gets the latest Docker image versions from Docker Hub by searching against the image repositories used in each `deployment.yaml` and updates it inline in each file to the latest version (as defined by semantic versioning rules).
### Appsody app-deploy.yaml
```yml
- name: Update GitOps YAMLs
id: update-gitops-yamls
uses: freight-trust-cloud-architecture/actions-update-gitops@master
with:
filePath: 'appsody/app-deploy.yaml'
```The action expects to be run inside a working directory (by default, this is the `/github/workspace` directory in the virtual environment), with a collection of application component deployment YAML files that have been created by `helm template` commands with the following folder structure:
```
/{component-a}/appsody/app-deploy.yaml
/{component-b}/appsody/app-deploy.yaml
/{component-c}/appsody/app-deploy.yaml
...
/{component-n}/appsody/app-deploy.yaml
```The action gets the latest Docker image versions from Docker Hub by searching against the image repositories used in each `app-deploy.yaml` and updates it inline in each file to the latest version (as defined by semantic versioning rules).
## Parameters
### Inputs
- `filePath` is the relative path inside of each components' working directory that will be searched for Docker image version replacement. This should not start with a leading slash and must be the complete file name, uniform across all components. A single execution of the action will only scan files with same `filePath` across all components, however multiple executions with different `filePath` values can be run against the same working directory.
## Example
```yml
name: Update GitOps deployments
on: [push]
env:
DESIRED_BRANCH: gitops-yaml-branch
jobs:
update-gitops-deployments:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Checkout default sandbox branch
id: checkout-sandbox-branch
run: |
git checkout ${DESIRED_BRANCH}
- name: Update GitOps YAMLs
id: update-gitops-yamls
uses: freight-trust/actions-update-gitops@master
with:
filePath: 'templates/deployment.yaml'
- name: Commit & push modified files
id: commit-and-push-files
env:
GITHUB_TOKEN: ...
GITHUB_ACTOR: ...
run: |
...
```## License
[Apache 2.0](#)