14

i got this

/bin/sh: eval: line 98: bash: not found 

message by executing the gitlabb .yml file.

I added in the before script section the line

- apk update && apk add openssh

which was not helpful.

before_script:
  - apk update && apk add openssh
  - bash docker_install.sh > /dev/null

stages:
  - build
  - deploy
  - loadtest-local

build:
  stage: build
  script:
    - echo "building my application in ubuntu container..."

deploy:
  stage: deploy
  image: php:7.4
  script: 
    - phpunit Unittest.php
    

loadtest-local:
  image: 
    name: loadimpact/k6:latest
    entrypoint: [""]
  stage: loadtest-local
  script:
    - k6 run ./loadtests/performance-test.js
    - k6 run ./loadtests/inttest.js

How can I resolve this issue?

Detlef7able
  • 191
  • 1
  • 2
  • 12

2 Answers2

6

That means one of the images used in your pipeline doesn't have bash installed.

Try changing the line on before_script to ./docker_install.sh > /dev/null (make sure the docker_install.sh has execution permissions set beforehand).

Olli K
  • 1,720
  • 1
  • 16
  • 17
  • chmod +x ./docker_install.sh > /dev/null is this the right approach for the permission? Now I have a problem in the deploy stage: /bin/bash: line 102: phpunit: command not found. – Detlef7able Aug 30 '20 at 09:55
  • It doesn't seem like the `php:7.4` image has `phpunit` installed, you either need to install it or check out https://hub.docker.com/r/phpunit/phpunit/ – Olli K Aug 30 '20 at 11:40
  • If I got the bash: not found error. The deploy stage was successful. – Detlef7able Aug 30 '20 at 11:59
1

This fixed the issue for me.

before_script:
    - apk add --no-cache --upgrade bash
iamattiq1991
  • 746
  • 9
  • 11