首页 文章

Gitlab-runner权限

提问于
浏览
1

试用gitlab并尝试构建一个简单的create-react-app项目 . 但是,我遇到了gitlab-runner的问题 . 我正在使用来自亚马逊市场的gitlab的AMI在EC2实例上运行gitlab .

通过yml是非常基本的 .

build-site:
  image: node:9
  stage: build
  script:
    - npm install
    - npm run build
  artifacts:
    expire_in: 1 week
    paths:
      - build

但是我在gitlab web UI中得到的输出是

Running with gitlab-runner 10.1.0 (c1ecf97f)
  on runner-1 (9fc6bc1c)
Using Shell executor...
Running on ip-10-214-239-156...
Fetching changes...
warning: failed to remove builds/0/project-0.tmp/git-template/config
warning: failed to remove builds/0/project-0/.istanbul.yml
warning: failed to remove builds/0/project-0/yarn.lock
warning: failed to remove builds/0/project-0/src/Root.js
warning: failed to remove builds/0/project-0/src/utils/common.js

当ssh进入ec2机器时运行 sudo gitlab-runner --debug exec shell build-site 时得到的输出

ERROR: Job failed: exit status 1
FATAL: exit status 1

1 回答

  • 1

    必须将用户 gitlab-runner 添加到docker组

    usermod -aG docker gitlab-runner

    似乎已经成功了

相关问题