Difference between revisions of "Azure Pipelines: AWSShellScript@1"

From wikieduonline
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
  /home/[[vsts]]/work/_temp/awsshellscript_1568.sh: line 2: your_python_script.py: [[command not found]]
 
  /home/[[vsts]]/work/_temp/awsshellscript_1568.sh: line 2: your_python_script.py: [[command not found]]
  
 +
== Example ==
  
 
+
  - task: AWSShellScript@1
[[inlineScript:]]
+
    displayName: Name for you task
[[workingDirectory:]]
+
    [[condition:]] always()
 +
    inputs:
 +
      awsCredentials: "${{ parameters.awsCredentials }}"
 +
      regionName: "${{ parameters.awsRegion }}"
 +
      scriptType: inline
 +
      inlineScript: |
 +
        ls -lah
 +
        pip3 install virtualenv
 +
        virtualenv venv
 +
        venv/bin/pip install -r requirements.txt
 +
        venv/bin/python your_python_script.py \
 +
            --environment "${{ parameters.awsAccountName }}" \
 +
            --service "${{ parameters.sphereServiceName }}"
 +
      disableAutoCwd: true
 +
      failOnStandardError: false
 +
      workingDirectory: "$(System.DefaultWorkingDirectory)"
  
 
== Related ==
 
== Related ==
 
* <code>[[ShellScript@2]]</code>
 
* <code>[[ShellScript@2]]</code>
 +
* <code>[[script:]]</code>
 +
* <code>[[env]]</code>
 +
* <code>[[inlineScript:]]</code>
 +
* <code>[[workingDirectory:]]</code>
  
 
== See also ==
 
== See also ==
* <code>[[Azure Pipelines: task:]]</code>
+
* {{Azure Pipelines tasks}}
* {{Azure Pipelines}}
 
  
 
[[Category:Azure]]
 
[[Category:Azure]]

Latest revision as of 15:16, 24 March 2022

/home/vsts/work/_temp/awsshellscript_1568.sh: line 2: your_python_script.py: command not found

Example[edit]

 - task: AWSShellScript@1
   displayName: Name for you task
   condition: always()
   inputs:
     awsCredentials: "$Template:Parameters.awsCredentials"
     regionName: "$Template:Parameters.awsRegion"
     scriptType: inline
     inlineScript: |
       ls -lah
       pip3 install virtualenv
       virtualenv venv
       venv/bin/pip install -r requirements.txt
       venv/bin/python your_python_script.py \
           --environment "$Template:Parameters.awsAccountName" \
           --service "$Template:Parameters.sphereServiceName"
     disableAutoCwd: true
     failOnStandardError: false
     workingDirectory: "$(System.DefaultWorkingDirectory)"

Related[edit]

See also[edit]

  • https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/manual-validation?view=azure-devops&tabs=yaml
  • Advertising: