我正在尝试使用drone运行Kafka服务
这是我的.drone.yml文件
kind: pipeline
name: default
steps:
- name: tests
image: docker.repo1.acme.com/golang
environment:
KAFKA_HOME: /drone/src
KAFKA_BROKER: kafka:9092
KAFKA_TOPIC: ops_agent_test_topic
PKG_CONFIG_PATH: /usr/local/librdkafka/1.1.0/lib/pkgconfig
commands:
- cd librdkafka
- ./configure --prefix /usr
- make
- make install
- cd ..
- sleep 10
- make test
services:
- name: kafka
image: spotify/kafka:latest
environment:
TOPICS: ops_agent_test_topic
ports:
- 9092
- 2181
如果我从命令行在本地运行drone exec .drone.yml
,一切都会按预期进行,但当它部署到CI/CD服务器时,我会得到Invalid or missing pipeline section
。我很好奇我做错了什么。
看起来将其更改为这种格式就可以了:
pipeline:
tests:
image: docker.repo1.acme.com/golang
environment:
KAFKA_HOME: /drone/src
KAFKA_BROKER: kafka:9092
KAFKA_TOPIC: ops_agent_test_topic
PKG_CONFIG_PATH: /usr/local/librdkafka/1.1.0/lib/pkgconfig
commands:
- git clone https://github.com/edenhill/librdkafka.git
- cd librdkafka
- ./configure --prefix /usr
- make
- make install
- cd ..
- sleep 10
- make test
services:
kafka:
image: spotify/kafka:latest
environment:
TOPICS: ops_agent_test_topic
ports:
- 9092
- 2181