1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
sap-jenkins-library/resources/metadata/shellExecute.yaml
Anil Keshav 2bd49fbe19
feat (shellExecute) extend sources param to download scripts. (#3674)
* first version to download script from git

* unit test adjust

* adding git token

* info messages

* removing extra info message

* changing file permission for scrtips

* modying sources to handle https download

* adding script downloads

* commenting the file permission change

* changing persmission

* adding header to download file

* adding perimssions

* adding perimssions

* not touching file permissions

* adding to pipeline

* return file name

* changing script name

* adding file permission changes

* adding file permission changes

* using current directory

* file permission

* downloading in .pipeline folder

* removing permission handeling

* improving the step docu

* improving the step docu

* unit test and code cleaning

* fix typo

* adding read execute permission

* fix unit test

* fix unit test

* removing negative test

Co-authored-by: anilkeshav27 <you@example.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-03-31 18:18:20 +02:00

43 lines
1.5 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
containers:
- name: shell
image: node:lts-stretch
workingDir: /home/node