-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api,hooks): add variable {{.payload}} (#3748)
* feat(api,hooks): add variable {{.paylaod}} close #3612 Signed-off-by: Yvonnick Esnault <[email protected]>
- Loading branch information
Showing
13 changed files
with
105 additions
and
8 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: "ITSCWRKFLW8-WORKFLOW" | ||
version: v1.0 | ||
pipeline: payload |
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,10 @@ | ||
version: v1.0 | ||
name: payload | ||
jobs: | ||
- job: New Job | ||
steps: | ||
- name: "Payload" | ||
script: | ||
- mkdir -p website/sub | ||
- env > thefile | ||
- worker upload --tag={{.cds.version}} thefile |
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,41 @@ | ||
name: Create a simple workflow (ITSCWRKFLW8) | ||
testcases: | ||
- name: assert filepath, your current directory must be at the root of this project | ||
steps: | ||
- script: '[ -f ./tests/fixtures/ITSCWRKFLW8/payload.pip.yml ]' | ||
- script: '[ -f ./tests/fixtures/ITSCWRKFLW8/ITSCWRKFLW8.yml ]' | ||
|
||
- name: prepare test | ||
steps: | ||
- script: "{{.cds.build.cdsctl}} project remove --force ITSCWRKFLW8" | ||
- script: "{{.cds.build.cdsctl}} group remove --force ITSCWRKFLW8 " | ||
- script: "{{.cds.build.cdsctl}} project add ITSCWRKFLW8 ITSCWRKFLW8" | ||
|
||
- name: push workflow | ||
steps: | ||
- script: {{.cds.build.cdsctl}} workflow push ITSCWRKFLW8 ./tests/fixtures/ITSCWRKFLW8/*.yml --skip-update-files | ||
assertions: | ||
- result.code ShouldEqual 0 | ||
|
||
- name: run workflow | ||
steps: | ||
- script: {{.cds.build.cdsctl}} workflow run ITSCWRKFLW8 ITSCWRKFLW8-WORKFLOW -d '{"aa":"bb","cc":["dd","ee"],"ff":{"gg":"hh"}}' | ||
assertions: | ||
- result.code ShouldEqual 0 | ||
- "result.systemout ShouldContainSubstring Workflow ITSCWRKFLW8-WORKFLOW #1 has been launched" | ||
|
||
- name: the workflow should be successful | ||
steps: | ||
- script: {{.cds.build.cdsctl}} workflow status ITSCWRKFLW8 ITSCWRKFLW8-WORKFLOW 1 --format json | ||
assertions: | ||
- result.code ShouldEqual 0 | ||
- result.systemoutjson.status ShouldEqual Success | ||
retry: 30 | ||
delay: 10 | ||
|
||
- name: download artifact with cdsctl | ||
steps: | ||
- script: rm -f thefile | ||
- script: {{.cds.build.cdsctl}} workflow artifact download ITSCWRKFLW8 ITSCWRKFLW8-WORKFLOW 1 | ||
- script: cat thefile|grep PAYLOAD | ||
- script: cat thefile|grep PAYLOAD|grep '{"aa":"bb","cc":\["dd","ee"\],"ff":{"gg":"hh"}}' |
File renamed without changes.