Skip to content

Configurable Stages #44

@0x46616c6b

Description

@0x46616c6b

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions