Search code examples
androidgitlabgitlab-cigitlab-ci-runner

Gitlab CI :- Getting pending status after push on the 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

This job is stuck because you don't have any active runners that can run this job.

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

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/

enter image description here

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

enter image description here

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

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


Solution

  • 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:

    enter image description here

    Setting up a runner

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

    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.

    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.