Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .dagger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ const (
)

type MacroservicesInvoiceRenderer struct {
// Repository name
// +private
RepoName string
// Source code directory
// +private
Source *dagger.Directory
Expand All @@ -24,15 +21,13 @@ type MacroservicesInvoiceRenderer struct {
}

func New(
repoName string,
// Source code directory
// +defaultPath="."
source *dagger.Directory,
// Infisical client secret
infisicalClientSecret *dagger.Secret,
) *MacroservicesInvoiceRenderer {
return &MacroservicesInvoiceRenderer{
RepoName: repoName,
Source: source,
InfisicalClientSecret: infisicalClientSecret,
}
Expand Down Expand Up @@ -81,19 +76,20 @@ 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)

return err
})

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)

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/helmfile-diff.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions helmfile.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ helmDefaults:
atomic: true
cleanupOnFail: true
createNamespace: true
suppressOutputLineRegex:
- "version"
timeout: 60
wait: true
waitForJobs: true
Expand Down