Skip to content

Commit

Permalink
feat: Add branches for single, multiple, and non-existent repo sources
Browse files Browse the repository at this point in the history
Signed-off-by: KangManJoo <eogns47@konkuk.ac.kr>
  • Loading branch information
eogns47 committed Oct 3, 2024
1 parent 8c8af76 commit 029bc17
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 315 deletions.
420 changes: 119 additions & 301 deletions notifications_catalog/install.yaml

Large diffs are not rendered by default.

22 changes: 20 additions & 2 deletions notifications_catalog/templates/app-deployed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@ slack:
},
{
"title": "Repository",
"value": "{{range .app.spec.sources}}{{.repoURL}} {{end}}",
"value":
{{- if .app.spec.source }}
"{{ .app.spec.source.repoURL }}"
{{- else if .app.spec.sources }}
{{- range .app.spec.sources }}
"{{ .repoURL }}"
{{- end }}
{{- else }}
"no repoURL"
{{- end }}
"short": true
},
{
Expand Down Expand Up @@ -72,6 +81,15 @@ teams:
"name":"Open Repository",
"targets":[{
"os":"default",
"uri":"{{range .app.spec.sources}}{{.repoURL | call .repo.RepoURLToHTTPS}} {{end}}"
"uri":
{{- if .app.spec.source }}
"{{ .app.spec.source.repoURL }}"
{{- else if .app.spec.sources }}
{{- range .app.spec.sources }}
"{{ .repoURL }}"
{{- end }}
{{- else }}
"no repoURL"
{{- end }}
}]
}]
22 changes: 20 additions & 2 deletions notifications_catalog/templates/app-health-degraded.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ slack:
},
{
"title": "Repository",
"value": "{{range .app.spec.sources}}{{.repoURL}} {{end}}",
"value":
{{- if .app.spec.source }}
"{{ .app.spec.source.repoURL }}"
{{- else if .app.spec.sources }}
{{- range .app.spec.sources }}
"{{ .repoURL }}"
{{- end }}
{{- else }}
"no repoURL"
{{- end }}
"short": true
}
{{range $index, $c := .app.status.conditions}}
Expand Down Expand Up @@ -64,6 +73,15 @@ teams:
"name":"Open Repository",
"targets":[{
"os":"default",
"uri":"{{range .app.spec.sources}}{{.repoURL | call .repo.RepoURLToHTTPS}} {{end}}"
"uri":
{{- if .app.spec.source }}
"{{ .app.spec.source.repoURL }}"
{{- else if .app.spec.sources }}
{{- range .app.spec.sources }}
"{{ .repoURL }}"
{{- end }}
{{- else }}
"no repoURL"
{{- end }}
}]
}]
22 changes: 20 additions & 2 deletions notifications_catalog/templates/app-sync-failed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ slack:
},
{
"title": "Repository",
"value": "{{range .app.spec.sources}}{{.repoURL}} {{end}}",
"value":
{{- if .app.spec.source }}
"{{ .app.spec.source.repoURL }}"
{{- else if .app.spec.sources }}
{{- range .app.spec.sources }}
"{{ .repoURL }}"
{{- end }}
{{- else }}
"no repoURL"
{{- end }}
"short": true
}
{{range $index, $c := .app.status.conditions}}
Expand Down Expand Up @@ -68,6 +77,15 @@ teams:
"name":"Open Repository",
"targets":[{
"os":"default",
"uri":"{{range .app.spec.sources}}{{.repoURL | call .repo.RepoURLToHTTPS}} {{end}}"
"uri":
{{- if .app.spec.source }}
"{{ .app.spec.source.repoURL }}"
{{- else if .app.spec.sources }}
{{- range .app.spec.sources }}
"{{ .repoURL }}"
{{- end }}
{{- else }}
"no repoURL"
{{- end }}
}]
}]
22 changes: 20 additions & 2 deletions notifications_catalog/templates/app-sync-running.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ slack:
},
{
"title": "Repository",
"value": "{{range .app.spec.sources}}{{.repoURL}} {{end}}",
"value":
{{- if .app.spec.source }}
"{{ .app.spec.source.repoURL }}"
{{- else if .app.spec.sources }}
{{- range .app.spec.sources }}
"{{ .repoURL }}"
{{- end }}
{{- else }}
"no repoURL"
{{- end }}
"short": true
}
{{range $index, $c := .app.status.conditions}}
Expand Down Expand Up @@ -67,6 +76,15 @@ teams:
"name":"Open Repository",
"targets":[{
"os":"default",
"uri":"{{range .app.spec.sources}}{{.repoURL | call .repo.RepoURLToHTTPS}} {{end}}"
"uri":
{{- if .app.spec.source }}
"{{ .app.spec.source.repoURL }}"
{{- else if .app.spec.sources }}
{{- range .app.spec.sources }}
"{{ .repoURL }}"
{{- end }}
{{- else }}
"no repoURL"
{{- end }}
}]
}]
33 changes: 30 additions & 3 deletions notifications_catalog/templates/app-sync-status-unknown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@ slack:
},
{
"title": "Repository",
"value": "{{range .app.spec.sources}}{{.repoURL}} {{end}}",
"value":
{{- if .app.spec.source }}
"{{ .app.spec.source.repoURL }}"
{{- else if .app.spec.sources }}
{{- range .app.spec.sources }}
"{{ .repoURL }}"
{{- end }}
{{- else }}
"no repoURL"
{{- end }}
"short": true
}
{{range $index, $c := .app.status.conditions}}
Expand All @@ -44,7 +53,16 @@ teams:
},
{
"name": "Repository",
"value": "{{range .app.spec.sources}}{{.repoURL}} {{end}}",
"value":
{{- if .app.spec.source }}
"{{ .app.spec.source.repoURL }}"
{{- else if .app.spec.sources }}
{{- range .app.spec.sources }}
"{{ .repoURL }}"
{{- end }}
{{- else }}
"no repoURL"
{{- end }}
}
{{range $index, $c := .app.status.conditions}}
,
Expand All @@ -68,6 +86,15 @@ teams:
"name":"Open Repository",
"targets":[{
"os":"default",
"uri":"{{range .app.spec.sources}}{{.repoURL | call .repo.RepoURLToHTTPS}} {{end}}"
"uri":
{{- if .app.spec.source }}
"{{ .app.spec.source.repoURL }}"
{{- else if .app.spec.sources }}
{{- range .app.spec.sources }}
"{{ .repoURL }}"
{{- end }}
{{- else }}
"no repoURL"
{{- end }}
}]
}]
33 changes: 30 additions & 3 deletions notifications_catalog/templates/app-sync-succeeded.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ slack:
},
{
"title": "Repository",
"value": "{{range .app.spec.sources}}{{.repoURL}} {{end}}",
"value":
{{- if .app.spec.source }}
"{{ .app.spec.source.repoURL }}"
{{- else if .app.spec.sources }}
{{- range .app.spec.sources }}
"{{ .repoURL }}"
{{- end }}
{{- else }}
"no repoURL"
{{- end }}
"short": true
}
{{range $index, $c := .app.status.conditions}}
Expand All @@ -44,7 +53,16 @@ teams:
},
{
"name": "Repository",
"value": "{{range .app.spec.sources}}{{.repoURL}} {{end}}",
"value":
{{- if .app.spec.source }}
"{{ .app.spec.source.repoURL }}"
{{- else if .app.spec.sources }}
{{- range .app.spec.sources }}
"{{ .repoURL }}"
{{- end }}
{{- else }}
"no repoURL"
{{- end }}
}
{{range $index, $c := .app.status.conditions}}
,
Expand All @@ -68,6 +86,15 @@ teams:
"name":"Open Repository",
"targets":[{
"os":"default",
"uri":"{{range .app.spec.sources}}{{.repoURL | call .repo.RepoURLToHTTPS}} {{end}}"
"uri":
{{- if .app.spec.source }}
"{{ .app.spec.source.repoURL | call .repo.RepoURLToHTTPS }}"
{{- else if .app.spec.sources }}
{{- range .app.spec.sources }}
"{{ .repoURL | call .repo.RepoURLToHTTPS }}"
{{- end }}
{{- else }}
"no repoURL"
{{- end }}
}]
}]

0 comments on commit 029bc17

Please sign in to comment.