Skip to content

Commit

Permalink
feat: update file permissions for npx compatibility (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
pritamstyz4ever authored Mar 5, 2024
1 parent 21964b2 commit 2a1ce4c
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 47 deletions.
97 changes: 50 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Example `screwdriver.yaml`:

```yaml
shared:
image: node:6
image: node:18
jobs:
main:
requires: [~pr, ~commit]
Expand All @@ -47,7 +47,7 @@ Example `screwdriver.yaml` with validation and publishing:
```yaml
shared:
image: node:6
image: node:18
jobs:
main:
requires: [~pr, ~commit]
Expand Down Expand Up @@ -76,7 +76,7 @@ Example `screwdriver.yaml` with validation and publishing, and template removal

```yaml
shared:
image: node:6
image: node:18
jobs:
main:
requires: [~pr, ~commit]
Expand Down Expand Up @@ -110,7 +110,7 @@ Example `screwdriver.yaml` with validation, publishing and tagging, and version
```yaml
shared:
image: node:6
image: node:18
steps:
- init: npm install screwdriver-template-main
jobs:
Expand Down Expand Up @@ -138,7 +138,7 @@ Example `screwdriver.yaml` with validation and publishing and tagging:

```yaml
shared:
image: node:6
image: node:18
jobs:
main:
requires: [~pr, ~commit]
Expand Down Expand Up @@ -169,7 +169,7 @@ Example `screwdriver.yaml` with validation, publishing and tagging, and tag remo
```yaml
shared:
image: node:6
image: node:18
steps:
- init: npm install screwdriver-template-main
jobs:
Expand Down Expand Up @@ -202,7 +202,7 @@ Example `screwdriver.yaml` with validation, publishing and tagging, and getting

```yaml
shared:
image: node:6
image: node:18
steps:
- init: npm install screwdriver-template-main
jobs:
Expand Down Expand Up @@ -230,13 +230,12 @@ Example `screwdriver.yaml`:

```yaml
shared:
image: node:6
image: node:18
jobs:
main:
requires: [~pr, ~commit]
steps:
- install: npm install screwdriver-template-main
- validate: ./node_modules/.bin/pipeline-template-validate
- validate: npx -y -p screwdriver-template-main pipeline-template-validate
environment:
SD_TEMPLATE_PATH: ./path/to/pipeline-template.yaml
```
Expand All @@ -247,6 +246,12 @@ jobs:
$ ./node_modules/.bin/pipeline-template-validate --json
{"valid":true}
```
Usage with npx
```
$ npx -y -p screwdriver-template-main pipeline-template-validate
{"valid":true}
```
### Publishing a pipeline template
Expand All @@ -256,18 +261,16 @@ Example `screwdriver.yaml` with validation and publishing:
```yaml
shared:
image: node:6
image: node:18
jobs:
main:
requires: [~pr, ~commit]
steps:
- install: npm install screwdriver-template-main
- validate: ./node_modules/.bin/pipeline-template-validate
- validate: npx -y -p screwdriver-template-main pipeline-template-validate
publish:
requires: main
steps:
- install: npm install screwdriver-template-main
- publish: ./node_modules/.bin/pipeline-template-publish --tag stable
- publish: npx -y -p screwdriver-template-main pipeline-template-publish --tag stable
```

`pipeline-template-publish` can print a result as json by passing `--json` option to the command. `pipeline-template-publish` will tag the published version as well. The default tag is `latest` if none is specified.
Expand All @@ -276,6 +279,11 @@ jobs:
$ ./node_modules/.bin/pipeline-template-publish --json
{namespace:"template", name:"foo",version:"1.2.3",tag:"stable"}
```
Usage with npx
```
$ npx -y -p screwdriver-template-main pipeline-template-publish --json
{namespace:"template", name:"foo",version:"1.2.3",tag:"stable"}
```

### Removing a template

Expand All @@ -285,22 +293,19 @@ Example `screwdriver.yaml` with validation and publishing, and template removal

```yaml
shared:
image: node:6
image: node:18
jobs:
main:
requires: [~pr, ~commit]
steps:
- install: npm install screwdriver-template-main
- validate: ./node_modules/.bin/pipeline-template-validate
- validate: npx -y -p screwdriver-template-main pipeline-template-validate
publish:
requires: main
steps:
- install: npm install screwdriver-template-main
- publish: ./node_modules/.bin/pipeline-template-publish
- publish: npx -y -p screwdriver-template-main pipeline-template-publish
remove_template:
steps:
- install: npm install screwdriver-template-main
- remove: ./node_modules/.bin/pipeline-template-remove --namespace templateNamespace --name templateName
- remove: npx -y -p screwdriver-template-main pipeline-template-remove --namespace templateNamespace --name templateName
```
`pipeline-template-remove` can print a result as json by passing `--json` option to the command.
Expand All @@ -309,6 +314,12 @@ jobs:
$ ./node_modules/.bin/pipeline-template-remove --json --namespace templateNamespace --name templateName
{"namespace":"templateNamespace", "name":"templateName"}
```
Usage with npx
```
$ npx -y -p screwdriver-template-main pipeline-template-remove --json --namespace templateNamespace --name templateName
{"namespace":"templateNamespace", "name":"templateName"}
```
### Removing a pipeline template version
Expand All @@ -319,22 +330,20 @@ Example `screwdriver.yaml` with validation, publishing and tagging, and version
```yaml
shared:
image: node:6
steps:
- init: npm install screwdriver-template-main
image: node:18
jobs:
main:
requires: [~pr, ~commit]
steps:
- validate: ./node_modules/.bin/pipeline-template-validate
- validate: npx -y -p screwdriver-template-main pipeline-template-validate
publish:
requires: main
steps:
- publish: ./node_modules/.bin/pipeline-template-publish
- tag: ./node_modules/.bin/pipeline-template-tag --namespace templateNamespace --name templateName --version 1.0.0 --tag latest
- publish: npx -y -p screwdriver-template-main pipeline-template-publish
- tag: npx -y -p screwdriver-template-main pipeline-template-tag --namespace templateNamespace --name templateName --version 1.0.0 --tag latest
detached_remove_version:
steps:
- remove: ./node_modules/.bin/pipeline-template-remove-version --namespace templateNamespace --name templateName --version 1.0.0
- remove: npx -y -p screwdriver-template-main pipeline-template-remove-version --namespace templateNamespace --name templateName --version 1.0.0
```

`pipeline-template-remove-version` can print a result as json by passing `--json` option to the command.
Expand All @@ -348,25 +357,23 @@ Example `screwdriver.yaml` with validation and publishing and tagging:

```yaml
shared:
image: node:6
image: node:18
jobs:
main:
requires: [~pr, ~commit]
steps:
- install: npm install screwdriver-template-main
- validate: ./node_modules/.bin/pipeline-template-validate
- validate: npx -y -p screwdriver-template-main pipeline-template-validate
publish:
requires: main
steps:
- install: npm install screwdriver-template-main
- publish: ./node_modules/.bin/pipeline-template-publish
- tag: ./node_modules/.bin/pipeline-template-tag --namespace templateNamespace --name templateName --version 1.2.3 --tag stable
- publish: npx -y -p screwdriver-template-main pipeline-template-publish
- tag: npx -y -p screwdriver-template-main pipeline-template-tag --namespace templateNamespace --name templateName --version 1.2.3 --tag stable
```
`pipeline-template-tag` can print a result as json by passing `--json` option to the command.

```
$ ./node_modules/.bin/template-tag --json --name templateName --version 1.2.3 --tag stable
$ npx -y -p screwdriver-template-main pipeline-template-tag --json --name templateName --version 1.2.3 --tag stable
{"namespace":"templateNamespace", "name":"templateName","tag":"stable","version":"1.2.3"}
```
Expand All @@ -379,9 +386,7 @@ Example `screwdriver.yaml` with validation, publishing and tagging, and tag remo
```yaml
shared:
image: node:6
steps:
- init: npm install screwdriver-template-main
image: node:18
jobs:
main:
requires: [~pr, ~commit]
Expand All @@ -400,7 +405,7 @@ jobs:
`pipeline-template-remove-tag` can print a result as json by passing `--json` option to the command.

```
$ ./node_modules/.bin/pipeline-template-remove-tag --json --namespace templateNamespace --name templateName --tag stable
$ npx -y -p screwdriver-template-main pipeline-template-remove-tag --json --namespace templateNamespace --name templateName --tag stable
{"namespace":"templateNamespace", "name":"templateName","tag":"stable"}
```

Expand All @@ -412,22 +417,20 @@ Example `screwdriver.yaml` with validation, publishing and tagging, and getting

```yaml
shared:
image: node:6
steps:
- init: npm install screwdriver-template-main
image: node:18
jobs:
main:
requires: [~pr, ~commit]
steps:
- validate: ./node_modules/.bin/pipeline-template-validate
- validate: npx -y -p screwdriver-template-main pipeline-template-validate
publish:
requires: main
steps:
- publish: ./node_modules/.bin/pipeline-template-publish
- tag: ./node_modules/.bin/pipeline-template-tag --namespace templateNamespace --name templateName --version 1.0.0 --tag latest
- publish: npx -y -p screwdriver-template-main pipeline-template-publish
- tag: npx -y -p screwdriver-template-main pipeline-template-tag --namespace templateNamespace --name templateName --version 1.0.0 --tag latest
detached_get_version_from_tag:
steps:
- get_version: ./node_modules/.bin/pipeline-template-get-version-from-tag --namespace templateNamespace --name templateName --tag latest
- get_version: npx -y -p screwdriver-template-main pipeline-template-get-version-from-tag --namespace templateNamespace --name templateName --tag latest
```
## Testing
Expand Down
Empty file modified bin/pipelineTemplatePublish.js
100644 → 100755
Empty file.
Empty file modified bin/pipelineTemplateRemove.js
100644 → 100755
Empty file.
Empty file modified bin/pipelineTemplateRemoveTag.js
100644 → 100755
Empty file.
Empty file modified bin/pipelineTemplateRemoveVersion.js
100644 → 100755
Empty file.
Empty file modified bin/pipelineTemplateTag.js
100644 → 100755
Empty file.
Empty file modified bin/pipelineTemplateValidate.js
100644 → 100755
Empty file.

0 comments on commit 2a1ce4c

Please sign in to comment.