prefapp / tfm

Reusable Terraform modules
0 stars 0 forks source link

New module GitHub repository #94

Open tonirvega opened 1 month ago

tonirvega commented 1 month ago

Motivation

We would like to have a repository module, to handle the organization repositories. To start, we want to manage the following properties of the repo, the will be ignored by terraform:

Besides that, we want to install workflows via terraform. That workflows will be rendered and passed to file resource, we call it "features". The rendered data will come from a data external terraform block.

Values model

kind: TFWorkspaceClaim
lifecycle: production
name: my-repo
system: 'system:inss'
version: '1.0'
providers:
  terraform:
    name: my-repo
    tfStateKey: a1301207-4723-47d3-b0f7-da4cd7fc743d
    source: Remote
    module: git::ref
    values:
      name: my-repo
      visibility: private | public
      description: my code repo
      allow_auto_merge: true | false
      allow_merge_commit: true | false
      allow_rebase_merge: true | false
      allow_squash_merge: true | false
      allow_update_branch: true | false
      archived: true | false
      delete_branch_on_merge: true | false
      has_discussions: true | false
      has_downloads: true | false
      has_issues: true | false
      has_projects: true | false
      has_wiki: true | false
      is_template: true | false
      merge_commit_message: "Update .."
      merge_commit_title: "Update file"
      squash_merge_commit_message: "feat: .." 
      squash_merge_commit_title: "..."
      vulnerability_alerts: ?
      web_commit_signoff_required: ?
      features:
        build_and_dispatch_docker_images:
          version: 1.0.0
          settings:
            build_snapshots_on_merge_with_branch: dev
### Tasks
- [x] Create minimal module for repository
- [x] Investigate the current features rendering
- [x] Implement an example of a feature installation
- [x] For existents repos, we want to import them. Investigate how can we do it without changing the current configurations.
alambike commented 1 month ago

features object should be extended:

- name: build_and_dispatch_docker_images
  version: 1.0.0
  settings:
     build_snapshots_on_merge_with_branch: dev
     ...
tonirvega commented 1 month ago
kind: ComponentClaim
lifecycle: production
name: testspa-2
owner: group:administrators
providers:
  github:
    module: git::..
    branchStrategy: none
    defaultBranch: main
    description: This is a test (from state-github)
    name: testspa-2
    org: firestartr-test
    features:
    - name: build_images 
      version: 1.5.1
    overrides:
      additionalAdmins:
        - group:cool-people
    visibility: private
system: firestartr-test-system
type: service
version: "1.0"