sindresorhus / grunt-shell

Run shell commands
MIT License
949 stars 126 forks source link

bug(commands): Travis Command Line Client #121

Open Kristinita opened 4 years ago

Kristinita commented 4 years ago

1. Summary

If I run the Travis Command Line Client commands from grunt-shell:

    no commands are executed, nothing happens in the console.

else another commands (for example, see my real project file; I ran from grunt-shell pipenv, git, npx commands; shell and batch scripts, commands with environment variable as argument):

    grunt-shell works as expected.

2. MCVE

You can see this configuration in the KiraShellTravis branch of my demo/debugging repository.

  1. Operating system:

    1. Windows 10.0.19041.508 Pro N for Workstations 64-bit EN (Local)
    2. Ubuntu 20.04.1 LTS (Travis CI)
  2. Part of package.json:

    {
      "devDependencies": {
        "coffeescript": "^2.5.1",
        "grunt": "^1.3.0",
        "grunt-shell": "^3.0.1"
      }
    }
  3. Gruntfile.coffee:

    module.exports = (grunt) ->
    
        grunt.loadNpmTasks 'grunt-shell'
    
        grunt.initConfig
    
            shell:
                travislint:
                    command: 'travis lint -x'
  4. .travis.yml:

    os: linux
    
    dist: focal
    
    git:
      depth: 1
    
    cache: false
    
    language: node_js
    
    # [REQUIRED] Secure GitHub token for the Travis CI configuration:
    # http://blog.code4hire.com/2016/06/adding-github-token-to-travis-ci-configuration/
    env:
      global:
        secure: QVIMzZgQewWOrweiXZwOpRFMp2Xs6VgDpM7BR50hGIPEA5A5cmstI6gJAhi0M55DPkNWrtTLIKtbNhOvR861wVlZwqg1bxnmuqxhonpMooIV24PTFDo4tDo50UvuwhUqhqHvf0ugXalkA0QEoEaIBZlqXX+tvkvMJHwV7uONAYgxOx7z8tQ9v9yTXq2/Aos9Yt6Wb+37oFJGsLlZX6CLYIUOq5iFem+hkVrIOJrxB3PUch8L/L+pHy3i9NnGm95HBqptwkR+6NBgE/A3ZFFFLs7R28hDcQvtFZqJe1OIdclFutcNSAlElyn/i6y41oIIRnEnote7mZ5q3tzX+Mo6hjXZV2+nzKUc98x4QRWGqj3HghxcFtCSC4SZRt6gI2ayxzglWsaCfNqT6J6R+xBEN08jUwfZAHzXudeENrUzJaWm8iH3LEf4w4rMAoBHg7RO0lIz+LrmVtuBfM4Czkk8nyE+uhxdFDXNNmb6Pup/BwlOxcwjnbM+QU6mpoJyzb/HTUO2azoOx5D5zGDcBQ/J7BWNfbHmbx8hINYKnkylMOufkd/4F54iWStiuegX/vAGfDfBD4cjlGw0M0hAuO7r7ZNinWW0jWH/sD8z/XgXy0pDVH5Hl6tSGvK3rXfd88b5vwTXYv7rw7OwJjLCKlHEfNM0tOKc1f0mxgdatxzLCqE=
    
    node_js:
    # [INFO] The latest stable Node.js release:
    # https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#specifying-nodejs-versions
    - node
    
    install:
    # [INFO] The latest stable Ruby version already default for Focal Fossa Build environment
    # on the October 2020:
    # https://docs.travis-ci.com/user/reference/focal/#ruby-support
    - gem install travis
    - npm install -g grunt-cli
    - npm install
    
    script:
    # [INFO] Lint “.travis.yml” file locally:
    # https://stackoverflow.com/a/35607499/5951529
    # [INFO] “-x” option — exit code 1 if there are any warnings:
    # https://www.rubydoc.info/gems/travis/1.10.0#lint
    - travis lint -x
    - grunt shell --verbose

3. Steps to reproduce

How I got env.global.secure value from .travis.yml above, that required for the Travis CLI client.

I created a personal access GitHub tokentravis encrypt 'GITHUB_TOKEN=<MY_GITHUB_TOKEN>' --add.

4. Behavior

See the Travis build.

4.1. Expected — run command directly

If travis lint -x:

    command completed successfully in 0.96 seconds.

4.2. Unexpected — grunt-shell

Else grunt shell --verbose:

Running tasks: shell

Running "shell" task

Running "shell:travislint" (shell) task
Verifying property shell.travislint exists in config…OK
File: [no files]
Options: stdout, stderr, stdin, failOnError, stdinRawMode=false, preferLocal, execOptions={"env":null}
Command: travis lint -x

No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.

Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received

Thanks.