Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify a build folder in Travis?

Tags:

travis-ci

I have a github repository user/repo but the real project is in a subfolder user/repo/project/build.sbt
What should I write in the .travis.yml to make Travis ignore the top folder and work only in the project folder?

Inspired by this I tried the following which didn't work:

env:   global:     - REPO="user/repo"     - CI_HOME=`pwd`/$REPO script: sh -c 'cd $CI_HOME/project' && sbt ++$TRAVIS_SCALA_VERSION package 

Error log:

$ sh -c 'cd $CI_HOME/project' && sbt ++$TRAVIS_SCALA_VERSION package Detected sbt version 0.12.2-RC1 /home/travis/build/user/repo doesn't appear to be an sbt project. 

Ideally there should be a way to specify the build folder but let Travis handle the build command.

like image 370
Крис Avatar asked Jan 22 '13 21:01

Крис


People also ask

What is Travis_build_dir?

2. Yes, sorry, my answer may not have been totally clear on that: $TRAVIS_BUILD_DIR is the directory that contains your checked-out code (i.e. $TRAVIS_BUILD_DIR/. git exists), and is the working directory when your commands start to run.

What is a build stage?

The build stage is the first stretch of a CI/CD pipeline, and it automates steps like downloading dependencies, installing tools, and compiling. Besides building code, build automation includes using tools to check that the code is safe and follows best practices.


2 Answers

You could also try adding the following line in your .travis.yml file:

before_script: cd project 
like image 198
iOSCowboy Avatar answered Oct 10 '22 03:10

iOSCowboy


I tried using this in my travis.yml file but didnt work

before_script: cd project 

Then i tried this

before_install: cd project 

And that worked 😅

like image 35
Lxrd-AJ Avatar answered Oct 10 '22 02:10

Lxrd-AJ