【问题标题】:/bin/sh: eval: line 98: bash: not found/bin/sh:评估:第 98 行:bash:未找到
【发布时间】:2020-08-30 09:20:33
【问题描述】:

我明白了

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

通过执行 gitlabb .yml 文件发送消息。

我在之前的脚本部分添加了这一行

- apk update && apk add openssh

这没有帮助。

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

我该如何解决这个问题?

【问题讨论】:

    标签: gitlab gitlab-ci gitlab-ci-runner


    【解决方案1】:

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

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

    【讨论】:

    • chmod +x ./docker_install.sh > /dev/null 这是获得权限的正确方法吗?现在部署阶段出现问题:/bin/bash: line 102: phpunit: command not found.
    • php:7.4 镜像似乎没有安装phpunit,您要么需要安装它,要么查看hub.docker.com/r/phpunit/phpunit
    • 如果我得到了 bash: not found 错误。部署阶段成功。
    猜你喜欢
    • 1970-01-01
    • 2017-12-21
    • 2021-07-24
    • 2012-10-25
    • 2017-05-19
    • 1970-01-01
    • 2019-05-15
    • 2022-01-07
    • 2018-04-26
    相关资源
    最近更新 更多