1
通過終端,它是爲source activate MyCondaEnv
一樣簡單,但如果我嘗試在Jenkinsfile:如何通過Jenkinsfile激活conda環境?
sh '. /home/rwardrup/anaconda3/bin/activate MyCondaEnv',
詹金斯控制檯回報:
Running shell script
+ . /home/rwardrup/anaconda3/bin/activate MyCondaEnv
+ [[ -n ]]
/var/lib/jenkins/workspace/testing/[email protected]/durable-bb4a4c30/script.sh: 4: /home/rwardrup/anaconda3/bin/activate: [[: not found
+ [[ -n ]]
/var/lib/jenkins/workspace/testing/[email protected]/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'
,以爲這樣就可以有,這樣做,我也得到:
Running shell script
+ /bin/bash. /home/rwardrup/anaconda3/bin/activate MyCondaEnv
/var/lib/jenkins/workspace/testing/[email protected]/durable-2a550d19/script.sh: 2: /var/lib/jenkins/workspace/testing/[email protected]/durable-2a550d19/script.sh: /bin/bash.: not found
有什麼辦法來激活和使用Conda環境通過Jenkinsfile?我發現了一些關於使用Django venv in a Jenkinsfile的信息,但這在我的情況下並不起作用。
這是它!非常感謝你。 –