Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement step scripts #1432

Merged
merged 1 commit into from
Oct 22, 2019
Merged

Implement step scripts #1432

merged 1 commit into from
Oct 22, 2019

Conversation

imjasonh
Copy link
Member

@imjasonh imjasonh commented Oct 16, 2019

Fixes #781

This adds a Script field to the Step type which, when specified, results in a temporary generated executable script file being invoked containing the specified script contents.

The result is an easy-to-use scripting option for users who just want to invoke simple scripts inside containers. Details of generated scripts should be considered an implementation detail, and should not be relied upon by users.

This implementation is based on feedback from @skaegi to generate files and invoke them, rather than hijacking the step's args to run the script using sh.

Changes

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

Release Notes

Support step scripts for easier scripting inside container executions

@tekton-robot tekton-robot requested review from dibyom and a user October 16, 2019 18:43
@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Oct 16, 2019
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 16, 2019
@imjasonh
Copy link
Member Author

/hold
(Holding until 0.8 is cut)

/assign @sbwsg
/assign @dlorenc

@tekton-robot tekton-robot assigned dlorenc and ghost Oct 16, 2019
@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 16, 2019
@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1alpha1/task_validation.go 79.9% 80.8% 1.0
pkg/reconciler/taskrun/resources/pod.go 89.7% 91.2% 1.5

@ghost
Copy link

ghost commented Oct 16, 2019

This is great. Needs some words in the Task doc I think to describe its usage but otherwise the PR lgtm!

@imjasonh
Copy link
Member Author

This is great. Needs some words in the Task doc I think to describe its usage but otherwise the PR lgtm!

Added! https://github.com/ImJasonH/pipeline/blob/script2/docs/tasks.md

@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1alpha1/task_validation.go 79.9% 80.8% 1.0
pkg/reconciler/taskrun/resources/pod.go 89.7% 91.2% 1.5

docs/tasks.md Outdated Show resolved Hide resolved
@ghost
Copy link

ghost commented Oct 16, 2019

:shipit:

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2019
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2019
@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1alpha1/task_validation.go 79.9% 80.8% 1.0
pkg/reconciler/taskrun/resources/pod.go 89.7% 91.2% 1.5

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@imjasonh Looks good, just one question

pkg/reconciler/taskrun/resources/pod.go Show resolved Hide resolved
docs/tasks.md Show resolved Hide resolved
@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1alpha1/task_validation.go 79.9% 81.2% 1.3
pkg/reconciler/taskrun/resources/pod.go 89.7% 91.2% 1.5

@ghost
Copy link

ghost commented Oct 17, 2019

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2019
@imjasonh
Copy link
Member Author

/hold cancel

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 21, 2019
This adds a `Script` field to the `Step` type which, when specified,
results in a temporary generated executable script file being invoked
containing the specified script contents.

The result is an easy-to-use scripting option for users who just want
to invoke simple scripts inside containers. Details of generated scripts
should be considered an implementation detail, and should not be relied
upon by users.
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 21, 2019
@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1alpha1/task_validation.go 79.9% 81.2% 1.3
pkg/reconciler/taskrun/resources/pod.go 89.7% 91.2% 1.5

@ghost
Copy link

ghost commented Oct 21, 2019

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 21, 2019
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
@imjasonh let's create that follow-up PR then 😉

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 22, 2019
@tekton-robot tekton-robot merged commit 9873614 into tektoncd:master Oct 22, 2019
imjasonh added a commit that referenced this pull request Oct 23, 2019
tekton-robot pushed a commit that referenced this pull request Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC: "Script Mode" for task steps
9 participants