pub enum OutputResource {
Files {
paths: Vec<String>,
extensions: Option<Vec<String>>,
},
CmdStdout {
cmd_stdout: String,
},
}
Variants§
Files
Fields
paths: Vec<String>
Paths to files or directories.
It should be an array of strings. Each element of the array should be a path to a file or directory.
If the --clean
flag is provided to zinoma
, the files or directories specified in paths
will be deleted before running the build flow.
Example
targets:
npm_install:
input:
- paths: [package.json, package-lock.json]
output:
- paths: [node_modules]
build: npm install
In this example, as the target specifies an input
, zinoma npm_install
is incremental.
The script npm install
will be skipped until package.json
, package-lock.json
or node_modules
are modified.
Additionally:
- the command
zinoma --clean
will deletenode_modules
; - the command
zinoma --clean npm_install
will deletenode_modules
, then runnpm install
.
extensions: Option<Vec<String>>
Filter files resource by file extensions.
It should be an array of strings.
If extensions
are specified, only files matching at least one of the extensions will be included in the resource.
Example
targets:
protoc:
input:
- paths: [protos]
extensions: [proto]
output:
- paths: [protos]
extensions: [go]
build: |
cd protos
docker run -v `pwd`:/defs namely/protoc-all -d . -o . -l go
CmdStdout
Fields
cmd_stdout: String
Shell script whose output identifies the state of a resource.
It should be a string.
Example
targets:
build_docker_image:
input:
- paths: [Dockerfile, src]
- cmd_stdout: 'docker image ls base:latest --format "{{.ID}}"'
output:
- cmd_stdout: 'docker image ls webapp:latest --format "{{.ID}}"'
build: docker build -t webapp .
Trait Implementations§
source§impl Debug for OutputResource
impl Debug for OutputResource
source§impl<'de> Deserialize<'de> for OutputResource
impl<'de> Deserialize<'de> for OutputResource
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl JsonSchema for OutputResource
impl JsonSchema for OutputResource
source§fn schema_name() -> String
fn schema_name() -> String
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read more