-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
8 changed files
with
368 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: TaskRun | ||
metadata: | ||
generateName: step-script- | ||
spec: | ||
taskSpec: | ||
steps: | ||
- name: bash | ||
image: ubuntu | ||
env: | ||
- name: FOO | ||
value: foooooooo | ||
script: | | ||
#!/usr/bin/env bash | ||
set -euxo pipefail | ||
echo "Hello from Bash!" | ||
echo FOO is ${FOO} | ||
echo substring is ${FOO:2:4} | ||
for i in {1..10}; do | ||
echo line $i | ||
done | ||
- name: place-file | ||
image: ubuntu | ||
script: | | ||
#!/usr/bin/env bash | ||
echo "echo Hello from script file" > /workspace/hello | ||
chmod +x /workspace/hello | ||
- name: run-file | ||
image: ubuntu | ||
script: | | ||
#!/usr/bin/env bash | ||
/workspace/hello | ||
- name: node | ||
image: node | ||
script: | | ||
#!/usr/bin/env node | ||
console.log("Hello from Node!") | ||
- name: python | ||
image: python | ||
script: | | ||
#!/usr/bin/env python3 | ||
print("Hello from Python!") | ||
- name: perl | ||
image: perl | ||
script: | | ||
#!/usr/bin/perl | ||
print "Hello from Perl!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.