gitlab-ce and drone: 0.8, but drone's builds do not work

515 Views Asked by At

I use gitlab-ce and drone: 0.8, but drone's builds do not work. "Build list is empty" will be displayed I also put .drone.yml under the gitlab-ce repository.

gitlab-ce's docker-compose.yml

version: '2'
services:
  proxy:
    image: jwilder/nginx-proxy
    container_name: proxy
    ports:
      - "80:80"
      - "443:443"
      - "8000:8000"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./certs:/etc/nginx/certs:ro
      - /etc/nginx/vhost.d
      - /usr/share/nginx/html
    restart: always

  gitlab:
    image: gitlab/gitlab-ce:latest
    container_name: gitlab
    hostname: gitlab-l.com
    ports:
      - 22:22
    expose:
      - 80
      - 8000
      - 9000
    volumes:
      - ./config:/etc/gitlab
      - ./logs:/var/log/gitlab
      - ./data:/var/opt/gitlab
      - /etc/localtime:/etc/localtime:ro
    environment:
      VIRTUAL_HOST: gitlab-l.com
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://gitlab-l.com'
        user['uid'] = 998
        user['gid'] = 998
    restart: always
    external_links:
     - drone-server:drone-server

networks:
  default:
    external:
       name: share_link

drone's docker-compose.yml

version: '2'
services:
  drone-server:
    image: drone/drone:0.8
    container_name: drone-server
    hostname: drone.gitlab-l.com
    expose:
      - 8000
      - 9000
    volumes:
      - ./drone:/var/lib/drone/
    restart: always
    environment:
      - VIRTUAL_HOST=d.gitlab-l.com
      - VIRTUAL_PORT=8000
      - DRONE_HOST=http://d.gitlab-l.coml
      - DRONE_OPEN=true
      - DRONE_ADMIN=root,my gitlab-ce user name
      - DRONE_GITLAB=true
      - DRONE_GITLAB_CLIENT=************
      - DRONE_GITLAB_SECRET=************
      - DRONE_GITLAB_URL=http://gitlab-l.com
      - DRONE_SECRET=*******
      - DRONE_GITLAB_GIT_USERNAME=my gitlab-ce user name
      - DRONE_GITLAB_GIT_PASSWORD=my gitlab-ce password
      - DRONE_GITLAB_SKIP_VERIFY=true
      - DRONE_GITLAB_PRIVATE_MODE=false
      - GIN_MODE=release
    external_links:
     - gitlab:gitlab-l.com

  drone-agent:
    image: drone/agent:0.8
    container_name: drone-agent
    command: agent
    restart: always
    expose:
      - 9000
    depends_on:
      - drone-server
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DRONE_HOST=http://d.gitlab-l
      - DRONE_SERVER=drone-server:9000
      - DRONE_SECRET=*******

networks:
  default:
    external:
       name: share_link

.drone.yml

pipeline:
 build:
   image: phpunit/phpunit
   commands:
    - php -v

I do not know what is the cause. Please tell me if there is any way to solve it.

1

There are 1 best solutions below

0
On

Probably Gitlab/Github can't reach your Drone instance. You can check the webhook result in Github. Expose your Drone instance to the internet and re-enable the repo in the Drone UI (so the webhook will be recreated).