diff --git a/.dagger/main.go b/.dagger/main.go index 951e73c..539664e 100644 --- a/.dagger/main.go +++ b/.dagger/main.go @@ -13,9 +13,6 @@ const ( ) type MacroservicesInvoiceRenderer struct { - // Repository name - // +private - RepoName string // Source code directory // +private Source *dagger.Directory @@ -24,7 +21,6 @@ type MacroservicesInvoiceRenderer struct { } func New( - repoName string, // Source code directory // +defaultPath="." source *dagger.Directory, @@ -32,7 +28,6 @@ func New( infisicalClientSecret *dagger.Secret, ) *MacroservicesInvoiceRenderer { return &MacroservicesInvoiceRenderer{ - RepoName: repoName, Source: source, InfisicalClientSecret: infisicalClientSecret, } @@ -81,11 +76,12 @@ func (m *MacroservicesInvoiceRenderer) BuildAndPush( ctx context.Context, // +default="prod" env string, + repoName string, ) error { g, ctx := errgroup.WithContext(ctx) g.Go(func() error { - _, err := dag.Docker(m.Source.Directory("backend"), m.InfisicalClientSecret, m.RepoName+"-backend", dagger.DockerOpts{ + _, err := dag.Docker(m.Source.Directory("backend"), m.InfisicalClientSecret, repoName+"-backend", dagger.DockerOpts{ Environment: env, }).Build().Publish(ctx) @@ -93,7 +89,7 @@ func (m *MacroservicesInvoiceRenderer) BuildAndPush( }) g.Go(func() error { - _, err := dag.Docker(m.Source.Directory("frontend"), m.InfisicalClientSecret, m.RepoName+"-frontend", dagger.DockerOpts{ + _, err := dag.Docker(m.Source.Directory("frontend"), m.InfisicalClientSecret, repoName+"-frontend", dagger.DockerOpts{ Environment: env, }).Build().Publish(ctx) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6690bff..66a3242 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,5 +5,5 @@ on: jobs: checks: - uses: mocbotau/infra-workflows/.github/workflows/generic-ci.yaml@main + uses: mocbotau/infra-workflows/.github/workflows/generic-ci.yaml@v0.3.0 secrets: inherit diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index db47a12..5411853 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -7,7 +7,7 @@ on: jobs: deploy: - uses: mocbotau/infra-workflows/.github/workflows/generic-deploy.yaml@v0.1.1 + uses: mocbotau/infra-workflows/.github/workflows/generic-deploy.yaml@v0.3.0 with: event-name: ${{ github.event_name }} environment: "prod" diff --git a/.github/workflows/helmfile-diff.yaml b/.github/workflows/helmfile-diff.yaml new file mode 100644 index 0000000..cb551f9 --- /dev/null +++ b/.github/workflows/helmfile-diff.yaml @@ -0,0 +1,15 @@ +name: Helmfile Diff + +on: + pull_request: + +jobs: + helmfile-diff: + uses: mocbotau/infra-workflows/.github/workflows/generic-helmfile-diff.yaml@v0.3.0 + with: + environment: "prod" + secrets: inherit + +permissions: + contents: read + pull-requests: write diff --git a/helmfile.yaml.gotmpl b/helmfile.yaml.gotmpl index a1da030..4e1d2f4 100644 --- a/helmfile.yaml.gotmpl +++ b/helmfile.yaml.gotmpl @@ -14,6 +14,8 @@ helmDefaults: atomic: true cleanupOnFail: true createNamespace: true + suppressOutputLineRegex: + - "version" timeout: 60 wait: true waitForJobs: true