Search code examples
configurationballerina

Missing Config.toml and Cloud.toml in Ballerina templates pushed to Ballerina Central


I have created a Ballerina template with the following configurations in the Ballerina.toml file.

[package]
org = "wso2ohtest"
name = "fhir.api"
version = "0.1.4"
authors=["WSO2"]
distribution = "2201.1.2"
template = true

[build-options]
observabilityIncluded = true

Inside this Ballerina template project, it includes the Config.toml and Cloud.toml files.

I packed the project with the bal pack command and pushed it to Ballerina Central with the bal push command. However, when I try to pull the pushed template project from Ballerina Central using bal new new-fhir-api -t <template_name:version>, the aforementioned .toml files are missing.

Is there anything I am missing?


Solution

  • From 2201.2.0 onwards files and directories that need to be packed inside the bala can be specified using the field include under the package table in the Ballerina.toml file.

    [package]
    # removed for brevity
    include=["Cloud.toml", "Config.toml"]
    

    Note that you have to provide the path from the root of the package.

    From Update 3 onwards, it is also possible to specify wildcard patterns similar to .gitignore patterns.

    As an example,

    [package]
    # removed for brevity
    include=["*.toml"]
    

    This will pack all the files that has the extention .toml in the bala.

    Please refer the documentation include-field