ci-module
All container images are resolved from globalconfig.yaml.Each function is called as an individual Woodpecker step.
Installation
dagger install github.com/saiharsha-plivo/ci-module@d93849535b54a50638cbc1e3663a4f0d2068055fEntrypoint
Return Type
CiModule Example
dagger -m github.com/saiharsha-plivo/ci-module@d93849535b54a50638cbc1e3663a4f0d2068055f call \
func (m *MyModule) Example() *dagger.CiModule {
return dag.
CiModule()
}@function
def example() -> dagger.CiModule:
return (
dag.ci_module()
)@func()
example(): CiModule {
return dag
.ciModule()
}Types
CiModule 🔗
CiModule is the main Dagger module entrypoint.
build() 🔗
Build runs a language-specific build command inside the buildContainer from globalconfig.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | No description provided |
| globalConfig | File ! | - | No description provided |
| repoConfig | File ! | - | No description provided |
| language | String ! | - | No description provided |
| buildCommand | String | "" | No description provided |
Example
dagger -m github.com/saiharsha-plivo/ci-module@d93849535b54a50638cbc1e3663a4f0d2068055f call \
build --src DIR_PATH --global-config file:path --repo-config file:path --language stringfunc (m *MyModule) Example(ctx context.Context, src *dagger.Directory, globalConfig *dagger.File, repoConfig *dagger.File, language string) string {
return dag.
CiModule().
Build(ctx, src, globalConfig, repoConfig, language)
}@function
async def example(src: dagger.Directory, global_config: dagger.File, repo_config: dagger.File, language: str) -> str:
return await (
dag.ci_module()
.build(src, global_config, repo_config, language)
)@func()
async example(src: Directory, globalConfig: File, repoConfig: File, language: string): Promise<string> {
return dag
.ciModule()
.build(src, globalConfig, repoConfig, language)
}debug() 🔗
Debug logs the full merged build context — config, parameters, images, ECR URLs, commands. Mirrors Jenkins debug stage. Use to verify config resolution before running the pipeline.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | No description provided |
| globalConfig | File ! | - | No description provided |
| repoConfig | File ! | - | No description provided |
| language | String | "" | No description provided |
| branch | String | "" | No description provided |
| commitSha | String | "" | No description provided |
| repoParams | File | - | No description provided |
Example
dagger -m github.com/saiharsha-plivo/ci-module@d93849535b54a50638cbc1e3663a4f0d2068055f call \
debug --src DIR_PATH --global-config file:path --repo-config file:pathfunc (m *MyModule) Example(ctx context.Context, src *dagger.Directory, globalConfig *dagger.File, repoConfig *dagger.File) string {
return dag.
CiModule().
Debug(ctx, src, globalConfig, repoConfig)
}@function
async def example(src: dagger.Directory, global_config: dagger.File, repo_config: dagger.File) -> str:
return await (
dag.ci_module()
.debug(src, global_config, repo_config)
)@func()
async example(src: Directory, globalConfig: File, repoConfig: File): Promise<string> {
return dag
.ciModule()
.debug(src, globalConfig, repoConfig)
}deploy() 🔗
Deploy triggers a deployment based on the deploy method in the repo config.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| globalConfig | File ! | - | No description provided |
| repoConfig | File ! | - | No description provided |
| deployEnv | String ! | - | No description provided |
| version | String ! | - | No description provided |
| branch | String | "" | No description provided |
Example
dagger -m github.com/saiharsha-plivo/ci-module@d93849535b54a50638cbc1e3663a4f0d2068055f call \
deploy --global-config file:path --repo-config file:path --deploy-env string --version stringfunc (m *MyModule) Example(ctx context.Context, globalConfig *dagger.File, repoConfig *dagger.File, deployEnv string, version string) string {
return dag.
CiModule().
Deploy(ctx, globalConfig, repoConfig, deployEnv, version)
}@function
async def example(global_config: dagger.File, repo_config: dagger.File, deploy_env: str, version: str) -> str:
return await (
dag.ci_module()
.deploy(global_config, repo_config, deploy_env, version)
)@func()
async example(globalConfig: File, repoConfig: File, deployEnv: string, version: string): Promise<string> {
return dag
.ciModule()
.deploy(globalConfig, repoConfig, deployEnv, version)
}dockerBuild() 🔗
DockerBuild builds a Docker image and exports it as a tarball. This runs before ImageScan and Push — build once, scan, then push.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | No description provided |
| dockerfile | String | "Dockerfile" | No description provided |
Example
dagger -m github.com/saiharsha-plivo/ci-module@d93849535b54a50638cbc1e3663a4f0d2068055f call \
docker-build --src DIR_PATHfunc (m *MyModule) Example(src *dagger.Directory) *dagger.Container {
return dag.
CiModule().
DockerBuild(src)
}@function
def example(src: dagger.Directory) -> dagger.Container:
return (
dag.ci_module()
.docker_build(src)
)@func()
example(src: Directory): Container {
return dag
.ciModule()
.dockerBuild(src)
}dockerfileLint() 🔗
DockerfileLint runs dockerfile linting using dockerfileLintContainer from globalconfig.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | No description provided |
| globalConfig | File ! | - | No description provided |
| dockerfile | String | "Dockerfile" | No description provided |
Example
dagger -m github.com/saiharsha-plivo/ci-module@d93849535b54a50638cbc1e3663a4f0d2068055f call \
dockerfile-lint --src DIR_PATH --global-config file:pathfunc (m *MyModule) Example(ctx context.Context, src *dagger.Directory, globalConfig *dagger.File) string {
return dag.
CiModule().
DockerfileLint(ctx, src, globalConfig)
}@function
async def example(src: dagger.Directory, global_config: dagger.File) -> str:
return await (
dag.ci_module()
.dockerfile_lint(src, global_config)
)@func()
async example(src: Directory, globalConfig: File): Promise<string> {
return dag
.ciModule()
.dockerfileLint(src, globalConfig)
}imageScan() 🔗
ImageScan is kept for backward compatibility — use ScanImage instead. This scans a remote image reference (useful for scanning already-pushed images).
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| globalConfig | File ! | - | No description provided |
| imageRef | String ! | - | No description provided |
| trivyBypass | Boolean | false | No description provided |
Example
dagger -m github.com/saiharsha-plivo/ci-module@d93849535b54a50638cbc1e3663a4f0d2068055f call \
image-scan --global-config file:path --image-ref stringfunc (m *MyModule) Example(ctx context.Context, globalConfig *dagger.File, imageRef string) string {
return dag.
CiModule().
ImageScan(ctx, globalConfig, imageRef)
}@function
async def example(global_config: dagger.File, image_ref: str) -> str:
return await (
dag.ci_module()
.image_scan(global_config, image_ref)
)@func()
async example(globalConfig: File, imageRef: string): Promise<string> {
return dag
.ciModule()
.imageScan(globalConfig, imageRef)
}lint() 🔗
Lint runs language-specific linting inside the buildContainer from globalconfig.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | No description provided |
| globalConfig | File ! | - | No description provided |
| repoConfig | File ! | - | No description provided |
| language | String ! | - | No description provided |
Example
dagger -m github.com/saiharsha-plivo/ci-module@d93849535b54a50638cbc1e3663a4f0d2068055f call \
lint --src DIR_PATH --global-config file:path --repo-config file:path --language stringfunc (m *MyModule) Example(ctx context.Context, src *dagger.Directory, globalConfig *dagger.File, repoConfig *dagger.File, language string) string {
return dag.
CiModule().
Lint(ctx, src, globalConfig, repoConfig, language)
}@function
async def example(src: dagger.Directory, global_config: dagger.File, repo_config: dagger.File, language: str) -> str:
return await (
dag.ci_module()
.lint(src, global_config, repo_config, language)
)@func()
async example(src: Directory, globalConfig: File, repoConfig: File, language: string): Promise<string> {
return dag
.ciModule()
.lint(src, globalConfig, repoConfig, language)
}misconfigScan() 🔗
MisconfigScan runs trivy misconfiguration scanning using trivyContainer from globalconfig.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | No description provided |
| globalConfig | File ! | - | No description provided |
Example
dagger -m github.com/saiharsha-plivo/ci-module@d93849535b54a50638cbc1e3663a4f0d2068055f call \
misconfig-scan --src DIR_PATH --global-config file:pathfunc (m *MyModule) Example(ctx context.Context, src *dagger.Directory, globalConfig *dagger.File) string {
return dag.
CiModule().
MisconfigScan(ctx, src, globalConfig)
}@function
async def example(src: dagger.Directory, global_config: dagger.File) -> str:
return await (
dag.ci_module()
.misconfig_scan(src, global_config)
)@func()
async example(src: Directory, globalConfig: File): Promise<string> {
return dag
.ciModule()
.misconfigScan(src, globalConfig)
}notify() 🔗
Notify sends a Slack notification about the pipeline status.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| globalConfig | File ! | - | No description provided |
| repoConfig | File ! | - | No description provided |
| status | String ! | - | No description provided |
| deployEnv | String | "" | No description provided |
| failedStage | String | "" | No description provided |
| slackWebhookUrl | String | "" | No description provided |
Example
dagger -m github.com/saiharsha-plivo/ci-module@d93849535b54a50638cbc1e3663a4f0d2068055f call \
notify --global-config file:path --repo-config file:path --status stringfunc (m *MyModule) Example(ctx context.Context, globalConfig *dagger.File, repoConfig *dagger.File, status string) string {
return dag.
CiModule().
Notify(ctx, globalConfig, repoConfig, status)
}@function
async def example(global_config: dagger.File, repo_config: dagger.File, status: str) -> str:
return await (
dag.ci_module()
.notify(global_config, repo_config, status)
)@func()
async example(globalConfig: File, repoConfig: File, status: string): Promise<string> {
return dag
.ciModule()
.notify(globalConfig, repoConfig, status)
}push() 🔗
Push builds and pushes a Docker image to ECR registries based on parent/service routing. Should only run after ScanImage passes.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | No description provided |
| globalConfig | File ! | - | No description provided |
| repoConfig | File ! | - | No description provided |
| branch | String ! | - | No description provided |
| commitSha | String ! | - | No description provided |
| dockerfile | String | "Dockerfile" | No description provided |
| version | String | "" | No description provided |
Example
dagger -m github.com/saiharsha-plivo/ci-module@d93849535b54a50638cbc1e3663a4f0d2068055f call \
push --src DIR_PATH --global-config file:path --repo-config file:path --branch string --commit-sha stringfunc (m *MyModule) Example(ctx context.Context, src *dagger.Directory, globalConfig *dagger.File, repoConfig *dagger.File, branch string, commitSha string) string {
return dag.
CiModule().
Push(ctx, src, globalConfig, repoConfig, branch, commitSha)
}@function
async def example(src: dagger.Directory, global_config: dagger.File, repo_config: dagger.File, branch: str, commit_sha: str) -> str:
return await (
dag.ci_module()
.push(src, global_config, repo_config, branch, commit_sha)
)@func()
async example(src: Directory, globalConfig: File, repoConfig: File, branch: string, commitSha: string): Promise<string> {
return dag
.ciModule()
.push(src, globalConfig, repoConfig, branch, commitSha)
}scanImage() 🔗
ScanImage builds the Docker image and scans it with trivy before pushing. Fails the pipeline if HIGH/CRITICAL vulnerabilities are found.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | No description provided |
| globalConfig | File ! | - | No description provided |
| dockerfile | String | "Dockerfile" | No description provided |
| trivyBypass | Boolean | false | No description provided |
Example
dagger -m github.com/saiharsha-plivo/ci-module@d93849535b54a50638cbc1e3663a4f0d2068055f call \
scan-image --src DIR_PATH --global-config file:pathfunc (m *MyModule) Example(ctx context.Context, src *dagger.Directory, globalConfig *dagger.File) string {
return dag.
CiModule().
ScanImage(ctx, src, globalConfig)
}@function
async def example(src: dagger.Directory, global_config: dagger.File) -> str:
return await (
dag.ci_module()
.scan_image(src, global_config)
)@func()
async example(src: Directory, globalConfig: File): Promise<string> {
return dag
.ciModule()
.scanImage(src, globalConfig)
}secretScan() 🔗
SecretScan runs trivy secret scanning using trivyContainer from globalconfig.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | No description provided |
| globalConfig | File ! | - | No description provided |
Example
dagger -m github.com/saiharsha-plivo/ci-module@d93849535b54a50638cbc1e3663a4f0d2068055f call \
secret-scan --src DIR_PATH --global-config file:pathfunc (m *MyModule) Example(ctx context.Context, src *dagger.Directory, globalConfig *dagger.File) string {
return dag.
CiModule().
SecretScan(ctx, src, globalConfig)
}@function
async def example(src: dagger.Directory, global_config: dagger.File) -> str:
return await (
dag.ci_module()
.secret_scan(src, global_config)
)@func()
async example(src: Directory, globalConfig: File): Promise<string> {
return dag
.ciModule()
.secretScan(src, globalConfig)
}semgrep() 🔗
Semgrep runs a semgrep scan using the semgrep image from globalconfig.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | No description provided |
| globalConfig | File ! | - | No description provided |
| rulesPath | String | "" | No description provided |
Example
dagger -m github.com/saiharsha-plivo/ci-module@d93849535b54a50638cbc1e3663a4f0d2068055f call \
semgrep --src DIR_PATH --global-config file:pathfunc (m *MyModule) Example(ctx context.Context, src *dagger.Directory, globalConfig *dagger.File) string {
return dag.
CiModule().
Semgrep(ctx, src, globalConfig)
}@function
async def example(src: dagger.Directory, global_config: dagger.File) -> str:
return await (
dag.ci_module()
.semgrep(src, global_config)
)@func()
async example(src: Directory, globalConfig: File): Promise<string> {
return dag
.ciModule()
.semgrep(src, globalConfig)
}test() 🔗
Test runs language-specific unit tests inside the buildContainer from globalconfig.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | No description provided |
| globalConfig | File ! | - | No description provided |
| repoConfig | File ! | - | No description provided |
| language | String ! | - | No description provided |
Example
dagger -m github.com/saiharsha-plivo/ci-module@d93849535b54a50638cbc1e3663a4f0d2068055f call \
test --src DIR_PATH --global-config file:path --repo-config file:path --language stringfunc (m *MyModule) Example(ctx context.Context, src *dagger.Directory, globalConfig *dagger.File, repoConfig *dagger.File, language string) string {
return dag.
CiModule().
Test(ctx, src, globalConfig, repoConfig, language)
}@function
async def example(src: dagger.Directory, global_config: dagger.File, repo_config: dagger.File, language: str) -> str:
return await (
dag.ci_module()
.test(src, global_config, repo_config, language)
)@func()
async example(src: Directory, globalConfig: File, repoConfig: File, language: string): Promise<string> {
return dag
.ciModule()
.test(src, globalConfig, repoConfig, language)
}