Skip to content

Commit 4112903

Browse files
authored
Merge pull request #4 from mocbotau/add-helmfile-diff
feat: add helmfile diff workflow, move repo name to build/publish function
2 parents 146cd65 + 85504db commit 4112903

5 files changed

Lines changed: 22 additions & 9 deletions

File tree

.dagger/main.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ const (
1313
)
1414

1515
type MacroservicesInvoiceRenderer struct {
16-
// Repository name
17-
// +private
18-
RepoName string
1916
// Source code directory
2017
// +private
2118
Source *dagger.Directory
@@ -24,15 +21,13 @@ type MacroservicesInvoiceRenderer struct {
2421
}
2522

2623
func New(
27-
repoName string,
2824
// Source code directory
2925
// +defaultPath="."
3026
source *dagger.Directory,
3127
// Infisical client secret
3228
infisicalClientSecret *dagger.Secret,
3329
) *MacroservicesInvoiceRenderer {
3430
return &MacroservicesInvoiceRenderer{
35-
RepoName: repoName,
3631
Source: source,
3732
InfisicalClientSecret: infisicalClientSecret,
3833
}
@@ -81,19 +76,20 @@ func (m *MacroservicesInvoiceRenderer) BuildAndPush(
8176
ctx context.Context,
8277
// +default="prod"
8378
env string,
79+
repoName string,
8480
) error {
8581
g, ctx := errgroup.WithContext(ctx)
8682

8783
g.Go(func() error {
88-
_, err := dag.Docker(m.Source.Directory("backend"), m.InfisicalClientSecret, m.RepoName+"-backend", dagger.DockerOpts{
84+
_, err := dag.Docker(m.Source.Directory("backend"), m.InfisicalClientSecret, repoName+"-backend", dagger.DockerOpts{
8985
Environment: env,
9086
}).Build().Publish(ctx)
9187

9288
return err
9389
})
9490

9591
g.Go(func() error {
96-
_, err := dag.Docker(m.Source.Directory("frontend"), m.InfisicalClientSecret, m.RepoName+"-frontend", dagger.DockerOpts{
92+
_, err := dag.Docker(m.Source.Directory("frontend"), m.InfisicalClientSecret, repoName+"-frontend", dagger.DockerOpts{
9793
Environment: env,
9894
}).Build().Publish(ctx)
9995

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ on:
55

66
jobs:
77
checks:
8-
uses: mocbotau/infra-workflows/.github/workflows/generic-ci.yaml@main
8+
uses: mocbotau/infra-workflows/.github/workflows/generic-ci.yaml@v0.3.0
99
secrets: inherit

.github/workflows/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
deploy:
10-
uses: mocbotau/infra-workflows/.github/workflows/generic-deploy.yaml@v0.1.1
10+
uses: mocbotau/infra-workflows/.github/workflows/generic-deploy.yaml@v0.3.0
1111
with:
1212
event-name: ${{ github.event_name }}
1313
environment: "prod"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Helmfile Diff
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
helmfile-diff:
8+
uses: mocbotau/infra-workflows/.github/workflows/generic-helmfile-diff.yaml@v0.3.0
9+
with:
10+
environment: "prod"
11+
secrets: inherit
12+
13+
permissions:
14+
contents: read
15+
pull-requests: write

helmfile.yaml.gotmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ helmDefaults:
1414
atomic: true
1515
cleanupOnFail: true
1616
createNamespace: true
17+
suppressOutputLineRegex:
18+
- "version"
1719
timeout: 60
1820
wait: true
1921
waitForJobs: true

0 commit comments

Comments
 (0)