-
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.
fix(worker): worker tmpl with exported var (#3834)
* fix(worker): worker tmpl with exported var Signed-off-by: Yvonnick Esnault <[email protected]> * it test Signed-off-by: Yvonnick Esnault <[email protected]> * it Signed-off-by: Yvonnick Esnault <[email protected]> * cr Signed-off-by: Yvonnick Esnault <[email protected]> * fix it Signed-off-by: Yvonnick Esnault <[email protected]>
- Loading branch information
Showing
5 changed files
with
68 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: ITSCWRKFLW9-WORKFLOW | ||
version: v1.0 | ||
pipeline: worker-tmpl |
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,22 @@ | ||
version: v1.0 | ||
name: worker-tmpl | ||
jobs: | ||
- job: New Job | ||
steps: | ||
- script: | ||
- worker export foo "bar" | ||
- script: | ||
- '#!/bin/bash' | ||
- echo "cds.build.foo = {{.cds.build.foo}}" | ||
- echo -n "{" > inputfile | ||
- echo -n "{.cds.build" >> inputfile | ||
- echo -n ".foo}}" >> inputfile | ||
- echo "" >> inputfile | ||
- echo "input file is:" | ||
- cat inputfile | ||
- echo "running worker tmpl..." | ||
- worker tmpl inputfile outputfile | ||
- echo "output file is:" | ||
- cat outputfile | ||
- echo "grep bar in outputfile :" | ||
- cat outputfile | grep bar |
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,34 @@ | ||
name: Create a simple workflow (ITSCWRKFLW9) | ||
testcases: | ||
- name: assert filepath, your current directory must be at the root of this project | ||
steps: | ||
- script: '[ -f ./tests/fixtures/ITSCWRKFLW9/worker-tmpl.pip.yml ]' | ||
- script: '[ -f ./tests/fixtures/ITSCWRKFLW9/ITSCWRKFLW9.yml ]' | ||
|
||
- name: prepare test | ||
steps: | ||
- script: "{{.cds.build.cdsctl}} project remove --force ITSCWRKFLW9" | ||
- script: "{{.cds.build.cdsctl}} group remove --force ITSCWRKFLW9 " | ||
- script: "{{.cds.build.cdsctl}} project add ITSCWRKFLW9 ITSCWRKFLW9" | ||
|
||
- name: push workflow | ||
steps: | ||
- script: {{.cds.build.cdsctl}} workflow push ITSCWRKFLW9 ./tests/fixtures/ITSCWRKFLW9/*.yml --skip-update-files | ||
assertions: | ||
- result.code ShouldEqual 0 | ||
|
||
- name: run workflow | ||
steps: | ||
- script: {{.cds.build.cdsctl}} workflow run ITSCWRKFLW9 ITSCWRKFLW9-WORKFLOW | ||
assertions: | ||
- result.code ShouldEqual 0 | ||
- "result.systemout ShouldContainSubstring Workflow ITSCWRKFLW9-WORKFLOW #1 has been launched" | ||
|
||
- name: the workflow should be successful | ||
steps: | ||
- script: {{.cds.build.cdsctl}} workflow status ITSCWRKFLW9 ITSCWRKFLW9-WORKFLOW 1 --format json | ||
assertions: | ||
- result.code ShouldEqual 0 | ||
- result.systemoutjson.status ShouldEqual Success | ||
retry: 30 | ||
delay: 10 |