如何使用prependpath在天蓝色管道中设置路径 [英] How to set path in azure-pipeline using prependpath

查看:353
本文介绍了如何使用prependpath在天蓝色管道中设置路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用前置路径在Azure管道中设置路径

I am trying to set path in an Azure-pipeline using prepend path

  echo '##vso[task.prependpath]$(HOME)/miniconda3/bin'
  echo "New path 1... $PATH"

  ##vso[task.prependpath]($HOME)/miniconda3/bin
  echo "New path 3... $PATH"

  ##vso[task.prependpath]($env.HOME)/miniconda3/bin
  echo "New path 3... $PATH"

  ##vso[task.prependpath]$(env.HOME)/miniconda3/bin
  echo "New path 4... $PATH"

  ##vso[task.prependpath]$(env.home)/miniconda3/bin
  echo "New path 5... $PATH"

  ##vso[task.prependpath]$(home)/miniconda3/bin
  echo "New path 6... $PATH"

都不设置路径,但是在执行export PATH=$HOME/miniconda3/bin:$PATH时会设置路径.

None of this sets the path, but when doing export PATH=$HOME/miniconda3/bin:$PATH the path is set.

如何在天蓝色管道中使用HOME设置PATH变量

How to set PATH variable with HOME in azure-pipeline

推荐答案

来自

指定的目录位于PATH的前面.更新后的环境变量将反映在后续任务中.

The specified directory is prepended to the PATH. The updated environment variable will be reflected in subsequent tasks.

在后续任务中引用$ PATH可以解决问题.

Referencing $PATH from subsequent tasks does the trick.

构建步骤1

echo '##vso[task.prependpath]$(HOME)/miniconda3/bin'

构建步骤2

echo "$PATH"'

## This prints /home/vsts/miniconda3/bin:/usr/share/rust/...and on it goes...

这篇关于如何使用prependpath在天蓝色管道中设置路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆