1

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

Ravindra Kushwaha
  • 7,846
  • 14
  • 53
  • 103

1 Answers1

1

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.

Sourav
  • 3,025
  • 2
  • 13
  • 29
  • Hi @Sourav.. I have tried your yml file in my project.But unfortunately getting the same problem like **This job is stuck because you don't have any active runners online with any of these tags assigned to them: dev-ci** Please check it once and let me know..Thanks.... I have created the tag dev_ci...But getting this exception , please https://ibb.co/5RwjTV1check it once – Ravindra Kushwaha Oct 30 '20 at 06:18
  • From where have you created the **runner** like in above **2PxrajYi...** Please guide me on it Thanks – Ravindra Kushwaha Oct 30 '20 at 07:11
  • @RavindraKushwaha I have modified my answer with setting up a gitlab-runner. – Sourav Oct 31 '20 at 02:22
  • Thanks @Sourav , your suggestions has worked, what I have done create the custom runner **docker** and start it from my terminal then after I get the build as desire..Is it the right for it? Can you please guide me to create the build with flavouring( Create 2-3 apk at once). Please guide me on it.. Thanks☺️ – Ravindra Kushwaha Nov 01 '20 at 02:38
  • So you meant to say you are using docker as an executor ? If the same is true, yeah building custom docker image according to the requirement and running CI then, it is totally correct. But sorry, i didn't understand **create the build with flavouring( Create 2-3 apk at once)** Could you please be more specific. – Sourav Nov 01 '20 at 12:18
  • Actually , I want to create 3 apk of the same app using Gitlab ci.. currently the apk I am getting is debug..Now I want to create apk in 3 types like production, stage and testing, Are you geting my point – Ravindra Kushwaha Nov 01 '20 at 12:37
  • May be this can help then: https://docs.gitlab.com/ee/ci/environments/ – Sourav Nov 01 '20 at 14:48
  • Can you please help me on one doubt that how to create the shared runner of gitlab-ci beacause yet now build which is generating is system dependent means when my system is on then i am getting the build otherwise getting fail while creating the build.Please help me on it ..Thanks – Ravindra Kushwaha Nov 03 '20 at 10:38
  • Have you followed the steps mentioned in gitlab-runner documentation ? Try to install fresh. It should not be case what you are facing. You must have missed something while installing the runner. – Sourav Nov 03 '20 at 15:54
  • Yes, I have followed all the things as you know there is two runner one is Shared runner and another one is Custom runner..I have created the Custom runner which runs well when my system is on but become fail when my system is off.. I have read about the Shared runner which does well to run the task without any dependency..Please guide me about the Shared Runner of the gitlab..Have you get my point, please let me know for more info..Thanks – Ravindra Kushwaha Nov 03 '20 at 16:31
  • Ok. I will help you. Let me know which executor you want to use with shared runner. – Sourav Nov 04 '20 at 02:56
  • Whatever you can create.. Thanks – Ravindra Kushwaha Nov 04 '20 at 04:04
  • Could you please create another question for installing a shared runner. It will better, i will write answer there. Here the comments are increasing. Share the question link here. – Sourav Nov 04 '20 at 05:39
  • please check my new question on Gitlab CI https://stackoverflow.com/q/64675170/3946958 – Ravindra Kushwaha Nov 04 '20 at 06:32
  • Can you please guide me on Jenkin CI-CD configuration for the android. I just want to config my remote server to create my apk and testing,Please help me on it Thanks – Ravindra Kushwaha Jul 12 '21 at 13:59
  • @Ravindra Could you please create a new question with detailed information regarding the same. – Sourav Jul 13 '21 at 01:55
  • Can I edit the existing question and shared the link to you – Ravindra Kushwaha Jul 13 '21 at 04:46
  • Please check my latest question on Jenkin https://stackoverflow.com/q/68363485/3946958 Thanks – Ravindra Kushwaha Jul 13 '21 at 13:38