continuous-integrationdrone.io

Drone CI/CD only stuck in exec pipeline


When i use docker pipeline it will success building. But when i use exec pipe line it's always stuck in pending. And i don't what going wrong.

kind: pipeline
type: exec
name: deployment

platform:
  os: linux
  arch: amd64

steps:
- name: backend image build
  commands:
    - echo start build images...
    # - export MAJOR_VERSION=1.0.rtm.
    # - export BUILD_NUMBER=$DRONE_BUILD_NUMBER
    # - export WORKSPACE=`pwd`
    # - bash ./jenkins_build.sh
  when:
    branch:
      - master

Docker Pipe Line is fine.

kind: pipeline
type: docker
name: deployment

steps:     
- name: push image to repo
  image: plugins/docker
  settings:
    dockerfile: src/ZR.DataHunter.Api/Dockerfile
    tags: latest
    insecure: true
    registry: "xxx"
    repo: "xxx"
    username:
      from_secret: username
    password:
      from_secret: userpassword

Solution

  • First of all it's important to note that the exec pipeline can be used only when Drone is self-hosted. It is written in the official docs:

    Please note exec pipelines are disabled on Drone Cloud. This feature is only available when self-hosting

    When Drone is self-hosted be sure, that:

    1. The exec runner is installed
    2. It is configured properly in its config file (to be able to connect to the Drone server)
    3. And the drone-runner-exec service is running

    After the service is started, look for its log file and you have to see an info message saying it was able to connect to your Drone server:

    level=info msg="successfully pinged the remote server"
    level=info msg="polling the remote server"
    

    It's also possible to view the web UI (Dashboard) of the running service if you enable it.

    So if you see it can poll your server, then your exec pipeline should run as expected.