-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #846 from openmeterio/generate-python-sdk
ci: generate python SDK using Dagger
- Loading branch information
Showing
9 changed files
with
80 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package main | ||
|
||
// Generate various artifacts. | ||
func (m *Ci) Generate() *Generate { | ||
return &Generate{ | ||
Source: m.Source, | ||
} | ||
} | ||
|
||
type Generate struct { | ||
// +private | ||
Source *Directory | ||
} | ||
|
||
// Generate the Python SDK. | ||
func (m *Generate) PythonSdk() *Directory { | ||
// We build our image as the official autorest Dockerfile is outdated | ||
// and not compatible with the latest autorest. | ||
// More specifically, the latest autorest npm package depends on | ||
// other Azure packages that require a higher node version. | ||
// Official image: https://github.com/Azure/autorest/blob/63ffe68961e24ed8aa59a2ca4c16a8019c271e45/docker/base/ubuntu/Dockerfile | ||
|
||
// Autorest is incompatible with latest node version | ||
return dag.Container(). | ||
From("node:20-alpine"). | ||
WithExec([]string{"npm", "install", "-g", "autorest"}). | ||
WithExec([]string{"apk", "add", "python3", "py3-pip"}). | ||
WithDirectory("/work", m.Source.Directory("api")). | ||
WithWorkdir("/work/client/python"). | ||
WithExec([]string{"autorest", "config.yaml"}). | ||
Directory("/work/client/python") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters