deno-pipeline
This module provides functions for linting, testing, building, and deployingDeno applications. It reads app configuration from `mklv.config.mts` and
builds minimal distroless containers using `deno compile`.
Installation
dagger install github.com/dmikalova/github-meta/dagger/deno@v1.4.0Entrypoint
Return Type
DenoPipeline Example
dagger -m github.com/dmikalova/github-meta/dagger/deno@c60f4cc8cc9e0ad14581b5b4b006499c91c82ed8 call \
func (m *MyModule) Example() *dagger.DenoPipeline {
return dag.
DenoPipeline()
}@function
def example() -> dagger.DenoPipeline:
return (
dag.deno_pipeline()
)@func()
example(): DenoPipeline {
return dag
.denoPipeline()
}Types
DenoPipeline 🔗
lint() 🔗
Run deno lint on the source directory
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| githubToken | Secret ! | - | No description provided |
Example
dagger -m github.com/dmikalova/github-meta/dagger/deno@c60f4cc8cc9e0ad14581b5b4b006499c91c82ed8 call \
lint --source DIR_PATH --github-token env:MYSECRETfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, githubToken *dagger.Secret) string {
return dag.
DenoPipeline().
Lint(ctx, source, githubToken)
}@function
async def example(source: dagger.Directory, github_token: dagger.Secret) -> str:
return await (
dag.deno_pipeline()
.lint(source, github_token)
)@func()
async example(source: Directory, githubToken: Secret): Promise<string> {
return dag
.denoPipeline()
.lint(source, githubToken)
}check() 🔗
Run deno check (type checking) on the source directory
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| githubToken | Secret ! | - | No description provided |
Example
dagger -m github.com/dmikalova/github-meta/dagger/deno@c60f4cc8cc9e0ad14581b5b4b006499c91c82ed8 call \
check --source DIR_PATH --github-token env:MYSECRETfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, githubToken *dagger.Secret) string {
return dag.
DenoPipeline().
Check(ctx, source, githubToken)
}@function
async def example(source: dagger.Directory, github_token: dagger.Secret) -> str:
return await (
dag.deno_pipeline()
.check(source, github_token)
)@func()
async example(source: Directory, githubToken: Secret): Promise<string> {
return dag
.denoPipeline()
.check(source, githubToken)
}test() 🔗
Run deno task test on the source directory
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| githubToken | Secret ! | - | No description provided |
Example
dagger -m github.com/dmikalova/github-meta/dagger/deno@c60f4cc8cc9e0ad14581b5b4b006499c91c82ed8 call \
test --source DIR_PATH --github-token env:MYSECRETfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, githubToken *dagger.Secret) string {
return dag.
DenoPipeline().
Test(ctx, source, githubToken)
}@function
async def example(source: dagger.Directory, github_token: dagger.Secret) -> str:
return await (
dag.deno_pipeline()
.test(source, github_token)
)@func()
async example(source: Directory, githubToken: Secret): Promise<string> {
return dag
.denoPipeline()
.test(source, githubToken)
}build() 🔗
Build a minimal container with deno compile
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| entrypoint | String ! | - | No description provided |
| githubToken | Secret ! | - | No description provided |
Example
dagger -m github.com/dmikalova/github-meta/dagger/deno@c60f4cc8cc9e0ad14581b5b4b006499c91c82ed8 call \
build --source DIR_PATH --entrypoint string --github-token env:MYSECRETfunc (m *MyModule) Example(source *dagger.Directory, entrypoint string, githubToken *dagger.Secret) *dagger.Container {
return dag.
DenoPipeline().
Build(source, entrypoint, githubToken)
}@function
def example(source: dagger.Directory, entrypoint: str, github_token: dagger.Secret) -> dagger.Container:
return (
dag.deno_pipeline()
.build(source, entrypoint, github_token)
)@func()
example(source: Directory, entrypoint: string, githubToken: Secret): Container {
return dag
.denoPipeline()
.build(source, entrypoint, githubToken)
}publish() 🔗
Publish a container to GHCR
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| container | Container ! | - | No description provided |
| name | String ! | - | No description provided |
| version | String ! | - | No description provided |
| githubToken | Secret ! | - | No description provided |
Example
dagger -m github.com/dmikalova/github-meta/dagger/deno@c60f4cc8cc9e0ad14581b5b4b006499c91c82ed8 call \
publish --container IMAGE:TAG --name string --version string --github-token env:MYSECRETfunc (m *MyModule) Example(ctx context.Context, container *dagger.Container, name string, version string, githubToken *dagger.Secret) string {
return dag.
DenoPipeline().
Publish(ctx, container, name, version, githubToken)
}@function
async def example(container: dagger.Container, name: str, version: str, github_token: dagger.Secret) -> str:
return await (
dag.deno_pipeline()
.publish(container, name, version, github_token)
)@func()
async example(container: Container, name: string, version: string, githubToken: Secret): Promise<string> {
return dag
.denoPipeline()
.publish(container, name, version, githubToken)
}migrate() 🔗
Run database migrations Fetches DATABASE_URL from Secret Manager using convention: {app-name}-database-url
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| appName | String ! | - | No description provided |
Example
dagger -m github.com/dmikalova/github-meta/dagger/deno@c60f4cc8cc9e0ad14581b5b4b006499c91c82ed8 call \
migrate --source DIR_PATH --app-name stringfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, appName string) string {
return dag.
DenoPipeline().
Migrate(ctx, source, appName)
}@function
async def example(source: dagger.Directory, app_name: str) -> str:
return await (
dag.deno_pipeline()
.migrate(source, app_name)
)@func()
async example(source: Directory, appName: string): Promise<string> {
return dag
.denoPipeline()
.migrate(source, appName)
}deploy() 🔗
Deploy to Cloud Run
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| image | String ! | - | No description provided |
| serviceName | String ! | - | No description provided |
| region | String ! | "us-west1" | No description provided |
Example
dagger -m github.com/dmikalova/github-meta/dagger/deno@c60f4cc8cc9e0ad14581b5b4b006499c91c82ed8 call \
deploy --image string --service-name string --region stringfunc (m *MyModule) Example(ctx context.Context, image string, serviceName string, region string) string {
return dag.
DenoPipeline().
Deploy(ctx, image, serviceName, region)
}@function
async def example(image: str, service_name: str, region: str) -> str:
return await (
dag.deno_pipeline()
.deploy(image, service_name, region)
)@func()
async example(image: string, serviceName: string, region: string): Promise<string> {
return dag
.denoPipeline()
.deploy(image, serviceName, region)
}ci() 🔗
Full CI pipeline: lint, check, test
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| githubToken | Secret ! | - | No description provided |
Example
dagger -m github.com/dmikalova/github-meta/dagger/deno@c60f4cc8cc9e0ad14581b5b4b006499c91c82ed8 call \
ci --source DIR_PATH --github-token env:MYSECRETfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, githubToken *dagger.Secret) string {
return dag.
DenoPipeline().
Ci(ctx, source, githubToken)
}@function
async def example(source: dagger.Directory, github_token: dagger.Secret) -> str:
return await (
dag.deno_pipeline()
.ci(source, github_token)
)@func()
async example(source: Directory, githubToken: Secret): Promise<string> {
return dag
.denoPipeline()
.ci(source, githubToken)
}cd() 🔗
Full CD pipeline: build, publish, migrate, deploy
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| entrypoint | String ! | - | No description provided |
| name | String ! | - | No description provided |
| version | String ! | - | No description provided |
| githubToken | Secret ! | - | No description provided |
Example
dagger -m github.com/dmikalova/github-meta/dagger/deno@c60f4cc8cc9e0ad14581b5b4b006499c91c82ed8 call \
cd --source DIR_PATH --entrypoint string --name string --version string --github-token env:MYSECRETfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, entrypoint string, name string, version string, githubToken *dagger.Secret) string {
return dag.
DenoPipeline().
Cd(ctx, source, entrypoint, name, version, githubToken)
}@function
async def example(source: dagger.Directory, entrypoint: str, name: str, version: str, github_token: dagger.Secret) -> str:
return await (
dag.deno_pipeline()
.cd(source, entrypoint, name, version, github_token)
)@func()
async example(source: Directory, entrypoint: string, name: string, version: string, githubToken: Secret): Promise<string> {
return dag
.denoPipeline()
.cd(source, entrypoint, name, version, githubToken)
}readConfig() 🔗
Read app configuration from mklv.config.mts Returns JSON with name, entrypoint, and runtime settings
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| githubToken | Secret ! | - | No description provided |
Example
dagger -m github.com/dmikalova/github-meta/dagger/deno@c60f4cc8cc9e0ad14581b5b4b006499c91c82ed8 call \
read-config --source DIR_PATH --github-token env:MYSECRETfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, githubToken *dagger.Secret) string {
return dag.
DenoPipeline().
ReadConfig(ctx, source, githubToken)
}@function
async def example(source: dagger.Directory, github_token: dagger.Secret) -> str:
return await (
dag.deno_pipeline()
.read_config(source, github_token)
)@func()
async example(source: Directory, githubToken: Secret): Promise<string> {
return dag
.denoPipeline()
.readConfig(source, githubToken)
}deployOnly() 🔗
Deploy only (no CI) - reads config and runs build, publish, migrate, deploy
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| version | String ! | - | No description provided |
| githubToken | Secret ! | - | No description provided |
Example
dagger -m github.com/dmikalova/github-meta/dagger/deno@c60f4cc8cc9e0ad14581b5b4b006499c91c82ed8 call \
deploy-only --source DIR_PATH --version string --github-token env:MYSECRETfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, version string, githubToken *dagger.Secret) string {
return dag.
DenoPipeline().
DeployOnly(ctx, source, version, githubToken)
}@function
async def example(source: dagger.Directory, version: str, github_token: dagger.Secret) -> str:
return await (
dag.deno_pipeline()
.deploy_only(source, version, github_token)
)@func()
async example(source: Directory, version: string, githubToken: Secret): Promise<string> {
return dag
.denoPipeline()
.deployOnly(source, version, githubToken)
}pipeline() 🔗
Full pipeline using config from mklv.config.mts (CI + CD)
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| version | String ! | - | No description provided |
| githubToken | Secret ! | - | No description provided |
Example
dagger -m github.com/dmikalova/github-meta/dagger/deno@c60f4cc8cc9e0ad14581b5b4b006499c91c82ed8 call \
pipeline --source DIR_PATH --version string --github-token env:MYSECRETfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, version string, githubToken *dagger.Secret) string {
return dag.
DenoPipeline().
Pipeline(ctx, source, version, githubToken)
}@function
async def example(source: dagger.Directory, version: str, github_token: dagger.Secret) -> str:
return await (
dag.deno_pipeline()
.pipeline(source, version, github_token)
)@func()
async example(source: Directory, version: string, githubToken: Secret): Promise<string> {
return dag
.denoPipeline()
.pipeline(source, version, githubToken)
}