mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-14 11:03:09 +02:00
011ba40f87
* adding arguments * splitting strings into args and checking position * addtional check on adding arguments * unit testing * refactoring code * unit test clean up * add unit test for multiple params in multiple scripts * unit test name Co-authored-by: anilkeshav27 <you@example.com>
52 lines
2.0 KiB
YAML
52 lines
2.0 KiB
YAML
metadata:
|
|
name: shellExecute
|
|
description: Step executes defined script
|
|
longDescription: Step executes defined script provided in the 'sources' parameter
|
|
spec:
|
|
inputs:
|
|
secrets:
|
|
- name: githubTokenCredentialsId
|
|
description: Jenkins credentials ID containing the github token.
|
|
type: jenkins
|
|
params:
|
|
- name: sources
|
|
type: "[]string"
|
|
scope:
|
|
- PARAMETERS
|
|
- STAGES
|
|
- STEPS
|
|
description: Scripts paths that must be present in the current workspace or https links to scripts.
|
|
Only https urls from github are allowed and must be in the format :https://{githubBaseurl}/api/v3/repos/{owner}/{repository}/contents/{path to script}
|
|
Authentication for the download is only supported via the 'githubToken' param. Make sure the script has the necessary execute permissions.
|
|
- name: githubToken
|
|
description: "GitHub personal access token as per
|
|
https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line"
|
|
scope:
|
|
- GENERAL
|
|
- PARAMETERS
|
|
- STAGES
|
|
- STEPS
|
|
type: string
|
|
secret: true
|
|
aliases:
|
|
- name: access_token
|
|
resourceRef:
|
|
- name: githubTokenCredentialsId
|
|
type: secret
|
|
- type: vaultSecret
|
|
default: github
|
|
name: githubVaultSecretName
|
|
- name: scriptArguments
|
|
type: "[]string"
|
|
scope:
|
|
- PARAMETERS
|
|
- STAGES
|
|
- STEPS
|
|
description: scriptArguments that are needed to be passed to scripts. the scriptArguments list is a flat list and has a positional relationship to the `sources` param.
|
|
For e.g. The scriptArguments string at position 1 will be considered as the argument(s) for script at position 1 in `sources` list
|
|
mandatory: false
|
|
containers:
|
|
- name: shell
|
|
image: node:lts-stretch
|
|
workingDir: /home/node
|