gitops-github-action icon indicating copy to clipboard operation
gitops-github-action copied to clipboard

Configurable Stages

Open 0x46616c6b opened this issue 3 years ago • 0 comments

Feature Suggestion

At the moment three stages are hard coded and can't configured differently. This includes also the triggers when the stage should be updated. It would be a great option if the stages are configurable and more flexible for other projects with more stages or other names and other triggers.

Possible Implementation

Option 1

  • Parameter of the Action (only string can be used)
- name: GitOps (build, push and deploy a new Docker image)
  uses: Staffbase/gitops-github-action@main
  with:
    stages: |
      - name: 'dev'
        trigger: 'refs/heads/dev'
        files: ['kubernetes/namespaces/myService/dev/myService-deploy.yaml']
        path: 'spec.template.spec.containers.backend.image'
    
      - name: stage
        trigger: 'refs/heads/main'
        files: ['kubernetes/namespaces/myService/stage/myService-deploy.yaml']
        path: 'spec.template.spec.containers.backend.image'  
    
      - name: prod
        trigger: 'refs/tags/*'
        files: ['kubernetes/namespaces/myService/prod/myService-deploy.yaml']
        path: 'spec.template.spec.containers.backend.image' 
    # other options

Option 2

  • dot file in the repository, e.g .gitops or .github/gitops-github-action.yml
---
stages:
  - name: 'dev'
    trigger: 'refs/heads/dev'
    files: ['kubernetes/namespaces/myService/dev/myService-deploy.yaml']
    path: 'spec.template.spec.containers.backend.image'
  
  - name: stage
    trigger: 'refs/heads/main'
    files: ['kubernetes/namespaces/myService/stage/myService-deploy.yaml']
    path: 'spec.template.spec.containers.backend.image'  
  
  - name: prod
    trigger: 'refs/tags/*'
    files: ['kubernetes/namespaces/myService/prod/myService-deploy.yaml']
    path: 'spec.template.spec.containers.backend.image' 

Context

  • Configurable Stages for Deployment

0x46616c6b avatar Jul 12 '22 12:07 0x46616c6b