Tôi đang thiết lập một máy chủ ubuntu có jenkins cho CI.Không xây dựng của Jenkin trên npm cài đặt
Khi tôi cố gắng chạy một xây dựng tôi nhận được thất bại
Câu hỏi: Làm thế nào tôi có thể làm cho npm install
làm việc từ công việc Jenkins của tôi?
build 1:
[morningharwood] $ /bin/sh -xe /tmp/hudson8925730298288495807.sh
+ pwd
/var/lib/jenkins/workspace/morningharwood
+ ls
bower.json
client
e2e
Gruntfile.js
karma.conf.js
package.json
protractor.conf.js
server
+ npm install
/tmp/hudson8925730298288495807.sh: 5: /tmp/hudson8925730298288495807.sh: npm: not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Jenkin xây dựng
UPDATE:
~$ pwd
/home/ubuntu
ls -a
. .bash_history .bashrc .config .gem .gnupg .node-gyp .nvm .rbenv .ssh .viminfo
.. .bash_logout .cache .dotfiles .gemrc .local .npm .profile .rvm .vim
Bây giờ tôi thấy .npm
+ /home/ubuntu/.npm/npm install
/tmp/hudson1456103398115324880.sh: 5: /tmp/hudson1456103398115324880.sh: /home/ubuntu/.npm/npm: not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Cấu hình Script:
gì xảy ra khi bạn chạy từ thiết bị đầu cuối ssh?
npm WARN engine [email protected]: wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"0.11.14","npm":"2.0.0"})
npm ERR! Linux 3.13.0-36-generic
npm ERR! argv "/home/ubuntu/.nvm/v0.11.14/bin/node" "/home/ubuntu/.nvm/v0.11.14/bin/npm" "install"
npm ERR! node v0.11.14
npm ERR! npm v2.0.0
npm ERR! path /var/lib/jenkins/workspace/morningharwood/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! Error: EACCES, mkdir '/var/lib/jenkins/workspace/morningharwood/node_modules'
...
Vì vậy, tôi đã chown thư mục:
+ pwd
/var/lib/jenkins/workspace/morningharwood
sudo chown ubuntu /var/lib/jenkins/workspace/morningharwood/ -Rv
...
Ran NPM cài đặt sau đó NPM cài đặt
Nó đã thành công!
VẤN ĐỀ MỚI: Quá trình xây dựng của tôi hiện không thành công khi cố gắng sao chép kho từ github qua jenkins.
điều khiển log
Started by user matthew harwood
Building in workspace /var/lib/jenkins/workspace/morningharwood
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url [email protected]:matthewharwood/morningharwood.git # timeout=10
ERROR: Error fetching remote repo 'origin'
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE
Hiển thị chủ nhân:
ls -la
drwxr-xr-x 3 jenkins jenkins 4096 Dec 26 20:31 .
drwxr-xr-x 13 jenkins jenkins 4096 Dec 26 08:23 ..
drwxr-xr-x 7 ubuntu jenkins 4096 Dec 26 20:59 morningharwood
Xin cảm ơn người đàn ông rất nhiều vì đã giúp đỡ! Tôi đã đốt cháy nó và bắt đầu lại. Tôi đang tái tạo công việc ngay bây giờ. Sẽ sớm cập nhật! –
Đã làm việc thật tuyệt vời! cám ơn rất nhiều! hey tôi có cùng một vấn đề nhưng với ruby bây giờ lol tôi là khủng khiếp. http://stackoverflow.com/questions/27670407/set-up-ruby-globally-for-all-users-on-ubuntu –
"Có vẻ như bạn đang sử dụng nút 0.11. Tại sao?" thật là một câu hỏi. làm thế nào ai đó có một lý do cụ thể để sử dụng 0,11. bạn có thực sự mong đợi một câu trả lời cho điều đó không? – eyurdakul