Cd into files and then install requirements?

Hi all

Trying to install Travis CI for the Linux folder on my keylogger repo here:

I can’t get travis to go to the Linux folder first thing - how do I get it to?



In the script section of your .travis.yml file you could have multiple lines and just run cd linux as the first line, like this:

  - cd linux
  - python

That would cd into the linux folder, and then run a python script. An alternative would be having a bash or python script that runs all the commands you want (including cd), and that might look something like:

script: ci_scripts/

That would run a script located in the ci_scripts folder of the git repo.

1 Like

Awesome, thank you!

Is there an example script that I can use to simply run the script and warn me of traceback errors?


You could try command substitution to assign the output to a bash variable and then use a if to check if it contains a particular string of text.

if [[ "$OUT_LOG" == "*traceback error*" ]]; then echo "traceback error detected" ; fi

Another option would be redirecting the output (stdout and/or stderr) when running the script to a file, and using grep/sed to search the file for output indicating that there is a traceback error.

1 Like

Awesome, thanks!

I added that to in my main files. However I’m getting an error 127 as apparently the command is not found?

I have script: in the yml file…

Have no idea why it’s not working :pensive:

Would this work to test for errors?

  - python -m unittest discover

This isn’t picking up errors :pensive:

I’m trying to add it to a smaller project however this project requires user input, which I would be able to deanwith, but uses an api key that needs to be kept private and expires every 24 hours.

I’m not seeing any files in your repository that import unittest or implement test cases – that might be related to why it isn’t picking up any errors.

1 Like