Gitlab CI:-在gitlab上推送后获得待处理状态 [英] Gitlab CI :- Getting pending status after push on the gitlab

查看:841
本文介绍了Gitlab CI:-在gitlab上推送后获得待处理状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Gitlab-ci来创建推送构建,我也在根目录中创建了 .gitlab-ci.yml .每次在Gitlab上推送代码时,我都会收到以下消息

I am using the Gitlab-ci for the creating the build on the push,I have also creating the .gitlab-ci.yml inside my root directory. With each push the code on the Gitlab , i am getting the following message which are as follow

这项工作被困是因为您没有任何可以运行此工作的活跃跑步者.

我已经在设置上面的问题"中启用了 Shared Runners ,例如没有活动的成员.

I have already enable the Shared Runners in the Setting getting above problem like Not having active member.

请检查我的gitlab-ci.yml文件数据

Please check my gitlab-ci.yml file data

image: jangrewe/gitlab-ci-android

stages:
  - build

before_script:
  - export GRADLE_USER_HOME=$(pwd)/.gradle
  - chmod +x ./gradlew

cache:
  key: ${CI_PROJECT_ID}
  paths:
    - .gradle/

build:
  stage: build
  script:
    - ./gradlew assembleDebug
  artifacts:
    paths:
      - app/build/outputs/

我已暂停所有创建该构建的推送,请检查一次.

My all push suspended to create the build , please check it once.

即使我手动创建了跑步者,但他们却无法执行并无法继续锻炼

Even though i have created the runner manually but they become fail to execute and getting following excetion

错误:作业失败(系统故障):获取Kubernetes配置:无效的配置:未提供任何配置

ERROR: Job failed (system failure): getting Kubernetes config: invalid configuration: no configuration has been provided

请帮助我解决问题.谢谢

Please help me to short out from the problem. Thanks

推荐答案

如果您有活跃的shared-runner,请尝试在.gitlab-ci.yml中提供跑步者的标签.假设共享运行者的标签为dev-ci,则在更新后的代码下方找到:

If you have active shared-runner, then try to give the tags of the runner in the .gitlab-ci.yml. Say if the tag for the shared-runner is dev-ci, then find below the updated code:

image: jangrewe/gitlab-ci-android

stages:
  - build

before_script:
  - export GRADLE_USER_HOME=$(pwd)/.gradle
  - chmod +x ./gradlew

cache:
  key: ${CI_PROJECT_ID}
  paths:
    - .gradle/

build:
  stage: build
  tags:
  - dev-ci
  script:
    - ./gradlew assembleDebug
  artifacts:
    paths:
      - app/build/outputs/

赛跑者标签的屏幕截图:

Screenshot of the runner tags:

设置跑步者

在为项目设置运行器之前,您需要先:

Before setting up a runner for your project, you need to first:

  1. 安装 gitlab-runner在与安装了GitLab的位置不同的服务器上
  2. 注册跑步者 [共有3种跑步者类型:共享,团体和特定跑步者.根据要求,您可以选择要注册的赛跑者.]
  3. 注册跑步者时,您需要提供标签运行执行器.
  4. 注册跑步者后,进入 Project>>设置>> CI/CD>跑步者,您可以看到跑步者在线.如果要使用组"或共享"运行器,则需要在项目"设置中启用运行器.
  1. Install gitlab-runner on a server separate than where GitLab is installed.
  2. Register a runner [there are 3 types of runners: shared, group and specific runners. Depending on requirement, you can choose which runner to register.]
  3. While registering the runner, you need to give tags and the type of runner executor you need.
  4. After registering the runner, go to Project >> Settings >> CI/CD >> Runners, you can see the runner is online. If in case you are using Group or Shared runner, then you need to enable the runner in Project settings.

在您的情况下,您可以将 Special Runner Docker一起用作Runner-Executor ,然后在.gitlab-ci.yml中使用在注册运行程序时提供的标签.

In your case, you can use Specific Runner with Docker as Runner-Executor and then, in the .gitlab-ci.yml use the tags you provided while registering the runner.

这篇关于Gitlab CI:-在gitlab上推送后获得待处理状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆