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@0d2e86d1caf691a1fec7716cf62a6f189fb80f0cEntrypoint
Return Type
CiModule Example
dagger -m github.com/saiharsha-plivo/ci-module@0d2e86d1caf691a1fec7716cf62a6f189fb80f0c 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@0d2e86d1caf691a1fec7716cf62a6f189fb80f0c 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@0d2e86d1caf691a1fec7716cf62a6f189fb80f0c 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@0d2e86d1caf691a1fec7716cf62a6f189fb80f0c 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)
}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@0d2e86d1caf691a1fec7716cf62a6f189fb80f0c 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 runs trivy vulnerability scanning on a Docker image using trivyContainer from globalconfig.
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@0d2e86d1caf691a1fec7716cf62a6f189fb80f0c 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@0d2e86d1caf691a1fec7716cf62a6f189fb80f0c 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@0d2e86d1caf691a1fec7716cf62a6f189fb80f0c 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@0d2e86d1caf691a1fec7716cf62a6f189fb80f0c 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 a Docker image and pushes to ECR based on parent/service routing 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 |
| 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@0d2e86d1caf691a1fec7716cf62a6f189fb80f0c 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)
}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@0d2e86d1caf691a1fec7716cf62a6f189fb80f0c 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@0d2e86d1caf691a1fec7716cf62a6f189fb80f0c 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@0d2e86d1caf691a1fec7716cf62a6f189fb80f0c 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)
}