Skip to content

PostJobBash is a Bash@3 based task that allows you to executes bash scripts (across platforms) in the post-job phase of the job!

License

Notifications You must be signed in to change notification settings

tsvetilian-ty/PostJobBash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

PostJobBash is Bash@3 based task that allows you to executes bash scripts (across platforms) in the post-job phase of the job!

Examples

Exiting job

- task: PostJobBash@1
  displayName: Exit log
  inputs:
    targetType: 'inline'
    script: |
      echo "Exiting the job!"

Clean workspace after the pipeline executes

- task: PostJobBash@1
  displayName: Clean workspace
  env:
    PIPELINE_WORKSPACE: $(Pipeline.Workspace)
    AGENT_WORK_FOLDER: $(Agent.WorkFolder)
  inputs:
    targetType: 'inline'
    script: |
      pipelineWorkspace=$PIPELINE_WORKSPACE
      agentWorkFolder=$AGENT_WORK_FOLDER

      if [ -d "$pipelineWorkspace" ]; then
          echo "Pipeline workspace folder still exists ($pipelineWorkspace), deleting..."
          cd $agentWorkFolder
          rm -r $pipelineWorkspace
      else
          echo "Pipeline workspace folder does not exist."
      fi

About

PostJobBash is a Bash@3 based task that allows you to executes bash scripts (across platforms) in the post-job phase of the job!

Topics

Resources

License

Stars

Watchers

Forks