Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not parse .travis.yml

I'm trying to create CI pipeline with GitHub, Travis CI and AWS ECS. When I'm push commit to master branch, I'm getting error in travis CI: 'Could not parse .travis.yml'. I can't figure out, where is the problem. Travis dosen't provide more information about error.

There is a code, which I'm using:

.travis.yml

language: csharp
dist: trusty
sudo: required
mono: none
dotnet: 2.0.0
branches:
    only:
        - master
before_script:
    - chmod -R a+x scripts
script:
    - ./scripts/dotnet-build.sh
    - ./scripts/dotnet-publish.sh
    - ./scripts/docker-publish-travis.sh

dotnet-build.sh

 dotnet restore 
 dotnet build

dotnet-publish.sh

dotnet publish ./BookMeMobi2 -c Release -o ./bin/Docker

dotnet-publish-travis.sh

pip install --user awscli
eval $(aws ecr get-login --no-include-email --region eu-central-1)
docker build -t bookmemobi2 .
docker ps
docker tag bookmemobi2:latest 601510060817.dkr.ecr.eu-central-1.amazonaws.com/bookmemobi2:latest
docker push 601510060817.dkr.ecr.eu-central-1.amazonaws.com/bookmemobi2:latest

I don't know where is the problem. Could you help me?

like image 688
Michał Ściborski Avatar asked May 27 '18 10:05

Michał Ściborski


1 Answers

Use yamllint, which you can install, or just copy&paste to a web-based version.

With the example in the question, I get:

(<unknown>): found character that cannot start any token while scanning for the next token at line 7 column 1

There's a tab on line 7. See "A YAML file cannot contain tabs as indentation".


Another online resource for .travis.yml files is http://lint.travis-ci.org/ except, this tool does not pick-up the tab character. It's just generally a good resource to use.

like image 57
Mike T Avatar answered Nov 14 '22 19:11

Mike T