source activate MyCondaEnv
sh '. /home/rwardrup/anaconda3/bin/activate MyCondaEnv',
Jenkins控制台返回:
Running shell script
+ . /home/rwardrup/anaconda3/bin/activate MyCondaEnv
+ [[ -n ]]
/var/lib/jenkins/workspace/testing/features@tmp/durable-bb4a4c30/script.sh: 4: /home/rwardrup/anaconda3/bin/activate: [[: not found
+ [[ -n ]]
/var/lib/jenkins/workspace/testing/features@tmp/durable-bb4a4c30/script.sh: 7: /home/rwardrup/anaconda3/bin/activate: [[: not found
+ echo Only bash and zsh are supported
Only bash and zsh are supported
+ return 1
sh '$!/bin/bash. /home/rwardrup/anaconda3/bin/activate MyCondaEnv'sh '$!/bin/bash. /home/rwardrup/anaconda3/bin/activate MyCondaEnv'
Running shell script
+ /bin/bash. /home/rwardrup/anaconda3/bin/activate MyCondaEnv
/var/lib/jenkins/workspace/testing/features@tmp/durable-2a550d19/script.sh: 2: /var/lib/jenkins/workspace/testing/features@tmp/durable-2a550d19/script.sh: /bin/bash.: not found
有没有办法通过Jenkinsfile激活和使用Conda环境? 我已经找到了一些关于在Jenkins文件中使用Django venv的信息 ,但这在我的情况下不起作用。