Skip to content

Commit

Permalink
chore(api): fix dagger generate (#2122)
Browse files Browse the repository at this point in the history
  • Loading branch information
tothandras authored Jan 20, 2025
1 parent 4507023 commit 547d905
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .dagger/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (m *Generate) Openapicloud() *dagger.File {
func typespecBase(source *dagger.Directory) *dagger.Container {
return dag.Container().
From("node:22.8.0-alpine3.20").
WithExec([]string{"npm", "install", "-g", "pnpm"}).
WithExec([]string{"corepack", "enable"}).
WithDirectory("/work", source).
WithWorkdir("/work").
WithExec([]string{"pnpm", "install", "--frozen-lockfile"})
Expand All @@ -72,7 +72,7 @@ func (m *Generate) PythonSdk() *dagger.Directory {

// Autorest is incompatible with latest node version
return dag.Container().
From("node:22.5.1-slim").
From("node:22.8.0-alpine3.20").
WithExec([]string{"apt", "update"}).
WithExec([]string{"apt", "install", "-y", "python3", "python3-pip", "python3-venv"}).
WithExec([]string{"npm", "install", "-g", "autorest"}).
Expand All @@ -86,7 +86,7 @@ func (m *Generate) PythonSdk() *dagger.Directory {
func (m *Generate) NodeSdk() *dagger.Directory {
return dag.Container().
From("node:20.15.1-alpine3.20").
WithExec([]string{"npm", "install", "-g", "pnpm"}).
WithExec([]string{"corepack", "enable"}).
WithDirectory("/work", m.Source.Directory("api")).
WithWorkdir("/work/client/node").
WithExec([]string{"pnpm", "install", "--frozen-lockfile"}).
Expand All @@ -101,7 +101,7 @@ func (m *Generate) NodeSdk() *dagger.Directory {
func (m *Generate) WebSdk() *dagger.Directory {
return dag.Container().
From("node:20.15.1-alpine3.20").
WithExec([]string{"npm", "install", "-g", "pnpm"}).
WithExec([]string{"corepack", "enable"}).
WithDirectory("/work", m.Source.Directory("api")).
WithWorkdir("/work/client/web").
WithExec([]string{"pnpm", "install", "--frozen-lockfile"}).
Expand Down
4 changes: 2 additions & 2 deletions .dagger/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ func (m *Openmeter) publishWebSdk(ctx context.Context, version string, npmToken

func (m *Openmeter) publishToNpm(ctx context.Context, pkg string, version string, npmToken *dagger.Secret) error {
_, err := dag.Container().
From("node:20.15.1-alpine3.20").
WithExec([]string{"npm", "install", "-g", "pnpm"}).
From("node:22.8.0-alpine3.20").
WithExec([]string{"corepack", "enable"}).
WithExec([]string{"sh", "-c", "echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > /root/.npmrc"}).
WithSecretVariable("NPM_TOKEN", npmToken).
WithDirectory("/work", m.Source.Directory("api")).
Expand Down

0 comments on commit 547d905

Please sign in to comment.