Check multiple subdirectories

Benjamin's Avatar

Benjamin

29 Oct, 2015 01:44 PM

I have a project with multiple subdirectories which I all want to check in turn. Actually, these directories are a bit outdated version of branches which I have to keep for various reasons.

In my main folder I have the subdirectories patch and pkg and want to check both. I tried to use the following script to achieve this.

environment:
  matrix:
  - TEST_DIR: patch/
  - TEST_DIR: pkg/

before_build:
  - ps: echo %TEST_DIR%
  - ps: cd %TEST_DIR%

build_script:
  - travis-tool.sh install_deps

I also used $TEST_DIR and also had the lines

  - ps: echo %TEST_DIR%
  - ps: cd %TEST_DIR%

in build_script just before - travis-tool.sh install_deps. None of this was working.

When I use echo %TEST_DIR% it echos %TEST_DIR% and with echo $TEST_DIR nothing is echoed, i.e., the string seems to be empty. Any clues?


In Travis-CI I can use

## test multiple directories 
## (see https://lord.io/blog/2014/travis-multiple-subdirs/)
env:
 - TEST_DIR=patch/
 - TEST_DIR=pkg/

language: r
sudo: required

## change directory before installation 
## as R packages are not available elsewise
before_install:
  - cd $TEST_DIR

which works like a charm.

  1. Support Staff 1 Posted by Feodor Fitsner on 29 Oct, 2015 04:36 PM

    Feodor Fitsner's Avatar

    It should be:

    before_build:
      - echo %TEST_DIR%
      - cd %TEST_DIR%
    
  2. 2 Posted by Benjamin on 29 Oct, 2015 04:46 PM

    Benjamin's Avatar

    Thanks, Feodor. That works.

    Yet, now I cannot find the build script itself anymore:

    echo %TEST_DIR%
    patch/
    cd %TEST_DIR%
    travis-tool.sh install_deps
    'travis-tool.sh' is not recognized as an internal or external command,
    operable program or batch file.
    Command exited with code 1
    travis-tool.sh dump_logs
    'travis-tool.sh' is not recognized as an internal or external command,
    operable program or batch file.
    Command exited with code 1
    

    Do I need to change the working directory at another point in the script? Please see my complete script here:

    https://github.com/hofnerb/gamboostLSS/blob/AppVeyor/appveyor.yml

  3. Support Staff 3 Posted by Feodor Fitsner on 29 Oct, 2015 06:42 PM

    Feodor Fitsner's Avatar

    Well, I guess you can't run .sh script "as is" on Windows.

  4. 4 Posted by Benjamin on 30 Oct, 2015 09:39 AM

    Benjamin's Avatar

    Well, actually this script works well for other projects. So this can't be an issue. See e.g. https://github.com/hofnerb/stabs

  5. 5 Posted by Benjamin on 30 Oct, 2015 03:23 PM

    Benjamin's Avatar

    The script simply wasn't in the right place. I needed to copy it. This worked:

    environment:
      matrix:
      - TEST_DIR: patch
      - TEST_DIR: pkg
    
    before_build:
      - cp ..\travis-tool.sh .\travis-tool.sh
      - cp travis-tool.sh.cmd %TEST_DIR%\travis-tool.sh.cmd
      - cd %TEST_DIR%
      - bash -c "echo '^travis-tool\.sh\.cmd$' >> .Rbuildignore"
    
  6. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:01 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac