Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write .travis.yml if my project deps on python and nodejs?

Tags:

travis-ci

My project includes some python codes and build with grunt.I write .travis.yml like:

language: node_js
before_install:
  - pip install Django
  - npm install -g grunt-cli
  - npm uninstall grunt # https://github.com/npm/npm/issues/3958
node_js:
  - "0.10" 
python:
  - "2.7"

But that failed: *

OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/Django-1.7.1.dist-info'

*

It seems like I cannot 'pip install' in a 'node_js' project.

like image 510
yanni4night Avatar asked Nov 20 '14 09:11

yanni4night


People also ask

What is Travis Yml file?

travis. yml , which is a YAML format text file, to the root directory of the repository. This file specifies the programming language used, the desired building and testing environment (including dependencies which must be installed before the software can be built and tested), and various other parameters.

Can I use Travis CI for free?

If you're not familiar with Travis CI, it's a build company that has been powering the continuous integration (CI) of many open source projects since it launched in 2011. It was the first build solution that was free for open source use and that easily integrated into GitHub.

How does Travis CI work with GitHub?

Travis CI is a cloud-based CI service that builds and tests your projects hosted on GitHub. It would trigger a build process to validate the build and report any failures for every commit made. It fetches the commands from a . travis.


1 Answers

Instead of using sudo, pass the --user flag into pip (e.g., pip install --user django) to install the package in the home directory. This approach also works in Travis’ container-based infrastructure, which disallows sudo.

like image 200
Minh Nguyễn Avatar answered Sep 24 '22 12:09

Minh Nguyễn