首页 > 解决方案 > /bin/sh: eval: line 98: bash: not found

问题描述

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?

标签: gitlabgitlab-cigitlab-ci-runner

解决方案


这意味着您的管道中使用的图像之一没有安装 bash。

尝试将行更改before_script./docker_install.sh > /dev/null(确保docker_install.sh事先设置了执行权限)。


推荐阅读