我目前正在開發一個使用Flask的Web應用程序,並且需要在其中一個測試中使用PhantomJS。我使用GitLab作爲遠程git存儲庫,並使用GitLab CI作爲CI工具。GitLab CI無法安裝/使用PhantomJS
不幸的是,我似乎不能得到GitLab CI的共享亞軍安裝和運行PhantomJS。它的輸出:
Failed PhantomJS Run Screenshot
一個片段從我.gitlab-ci.yml
:
image: python:2.7.11
before_script:
- ...
- mkdir ~/tmp
- pushd ~/tmp
- wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2
- tar xf $PHANTOM_JS.tar.bz2
- mv $PHANTOM_JS phantomjs
- ln -s ~/tmp/phantomjs/bin/phantomjs /usr/bin/phantomjs
- phantomjs --version
- popd
- ...
$Phantom_JS
指PhantomJS的特定版本。
有誰知道解決方案?或者是否有其他方法來安裝和運行PhantomJS?
謝謝。
sudo npm install -g phantomjs-prebuilt < - 將下載並安裝正確系統的最新二進制文件。 – larsemil