shipwright-io / build

Shipwright - a framework for building container images on Kubernetes
https://shipwright.io
Apache License 2.0
639 stars 109 forks source link

Inline scripts in build strategy steps #976

Open adambkaplan opened 2 years ago

adambkaplan commented 2 years ago

Feature Request

Build strategy steps should support inline scripts, along the lines of Tekton's script instruction for task steps [1]. Most build strategies run more complex behavior by invoking bash as the base command, with args that inline a script via a heredoc. Ex - the results step of our buildpacks strategy [2].

This should probably require a SHIP for full discussion.

[1] https://tekton.dev/docs/pipelines/tasks/#running-scripts-within-steps [2] https://github.com/shipwright-io/build/blob/main/samples/buildstrategy/kaniko/buildstrategy_kaniko_cr.yaml#L53-L64

adambkaplan commented 2 years ago

/kind feature

adambkaplan commented 2 years ago

Most notable is that Tekton's script does not support its variable substitution feature. There is a TEP in the works to add this capability: https://github.com/tektoncd/community/pull/596

adambkaplan commented 2 years ago

Adding this to the general backlog - this is something we could add as a feature in a v1 API.

qu1queee commented 2 years ago

From Grooming: This might be a good candidate for v0.10.0. Having this just implies support for the script feature in TaskRuns and probably documenting this support in our strategies. This does not imply an override of existing strategies in favor of the spec.script. This requires a SHIP as it extend the strategy API.

Labelling this as a good-first-issue for both ends(writing down a SHIP + the implementation part).