Skip to end of banner
Go to start of banner

Examples

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Action usage examples

Examples give users ideas on actual usage. We use automation to generate, test, and run these actions, so names and combinations may be odd or repetitive (wink). In many cases, other actions or environmental setup is required for the action to run, so you will need to adjust the action parameters and setup appropriate for your environment. 

Command line environments can be different, especially between Windows and non-Windows systems. Our Tips page talks about command line escaping differences and there are differences with respect to environment variable references ($ for non-Windows and %...% for Windows). These differences can impact examples, so recognize and adjust for your platform. In particular, all examples here are run with the standard bash shell on Linux.



copyFiles

--action copyFiles --sourceFile "build/output/copy/copy.txt"

getFileList

--action getFileList --directory "." --limit 10 --outputType "text" --columns "path,is directory,hidden" --options "recurse"
--action getFileList --directory "/opt/atlassian/pipelines/agent/build/src/itest/system/resources" --dateFormat "yyyy-MM-dd"
--action getFileList --directory "/opt/atlassian/pipelines/agent/build/src/itest/system/resources" --regex "copy\\..*" --outputType "text" --columns "1,-4,5"
--action getFileList --directory "src" --limit 50 --outputType "text" --columns "path,is directory,hidden" --options "recurse" --options "includeDirectories"

getFileMonitorList

--action getFileMonitorList --directory "build/output/files" --limit 5 --timeout 60 --events "create,modify,delete" --outputType "text" --columns "-3,-6,7,8" --dateFormat "yyyy-MM-dd hh:mm:sss" --options "screenWidth=200"
--action getFileMonitorList --directory "build/output/files" --timeout 50 --options "monitor" --options "recurse" --options "includeDirectories" --events "create,modify,delete" --outputType "text" --columns "event,name,path,timestamp" --dateFormat "yyyy-MM-dd hh:mm:sss"
--action getFileMonitorList --directory "build/output/files/yyy" --timeout 60 --options "monitor" --options "recurse" --options "includeDirectories" --events "create,modify,delete" --outputType "text" --columns "event,name,path,timestamp" --dateFormat "yyyy-MM-dd hh:mm:sss"
--action getFileMonitorList --directory "~" --events "create" --timeout 1

renderRequest

--action renderRequest --file "build/output/render/renderRequestAuthenticated.txt" --user "automation+user@appfire.com" --password "***" --url "https://ginthome.atlassian.net/wiki/spaces/ztest"
--action renderRequest --url "https://ginthome.atlassian.net/wiki/spaces/GINT/overview" --findReplaceRegex "(?s).*?(title=\"Gint Confluence\").*:\$1"
--action renderRequest --url "https://www.google.com/search" --requestParameters "q=gint+gradle+integration+test+automation+devops" --findReplaceRegex "(?s).*?(Gint - .*?Framework).*:\$1"
--action renderRequest --url "https://www.google.com/search?q=gint+gradle+integration+test+automation+devops" --findReplaceRegex "(?s).*?(Gint - .*?Framework).*:\$1"

run

--action run -i "-a getFileList --directory ."
--action run -i "-a return --value x --regex y" -i "-a return --value x --regex x --comment \"This is a completion message.\" --quiet"
--action run -i "-a return" -i "-a return --comment \"Not run\""
--action run --input "-a setReplacementVariables --field replaceVariable1=111 --field replaceVariable2=222" --input "-a copyFiles --sourceFile build/output/copy --file build/output/copy/target"
--action run --input "-a setReplacementVariables --field replaceVariable1=111 --field replaceVariable2=222" --input "-a copyFiles --sourceFile build/output/copy/copy.txt"
--action run --quiet -i "-a writeFile -f @temp --data firstText --replace" -i "-a run --clearFileBeforeAppend -i \"-a writeFile -f @temp --append --data \"\"'appendText1 \\n \\n '\"\" --options show\"" -i "-a run --clearFileBeforeAppend -i \"-a writeFile -f @temp --append --input \"\"appendText2 \\n \\n \"\" --options show\""

runFromFileList

--action runFromFileList --directory "/opt/atlassian/pipelines/agent/build/src/itest/system/resources" --input "-a copyFiles --sourceFile @filePath@ --file build/output/files/@fileBaseName@-xxx.@fileExtension@"

runFromList

--action runFromList --list "0,1,3" --input "-a sleep --value @entry@"

sleep

--action sleep
--action sleep --quiet

updatePropertyFile

--action updatePropertyFile --propertyFile "build/output/properties/example.properties" --field "# comment 1" --field "key7 = value7" --field "include = NOT_FOUND" --field "key6 = value6" --field "key2" --field "aa x =" --field "bb :x" --options "show"
--action updatePropertyFile --propertyFile "build/output/properties/example.properties" --field "# comment 2\\n! comment 3!" --options "show"
--action updatePropertyFile --propertyFile "build/output/properties/example.properties" --field "key1=value1" --field "key2 = value2" --field " key3 = value3 " --field "key4 = value4" --field "key5 = value5" --field "aa x = value aa" --field "bb :x = value bb" --field " include = build/output/properties/example-include.properties" --options "show"
--action updatePropertyFile --propertyFile "build/output/properties/test.properties" --field "key1" --field "key2" --field "key3" --field "key5 : " --field "key6 : = new value 6" --field "include=" --field "Include" --options "show"

writeFile

--action writeFile --file "build/output/copy/writeFile.txt" --data "-a getClientInfo --outputFormat 2 --outputType variables -a getReplacementVariableList" --options "show,run" --replace
--action writeFile --file "build/output/copy/writeFileInput.txt" --input "-a getClientInfo --outputFormat 2 --outputType variables" --input "-a getReplacementVariableList" --options "show" --replace
--action writeFile --file "build/output/copy/writeFileShow.txt" --data "-a getClientInfo --outputFormat 2 --outputType variables \\n -a getReplacementVariableList" --options "show" --replace
  • No labels