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.
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.
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.
You could also try adding the following line in your .travis.yml file:
before_script: cd project
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 😅
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With