无人机 管道部分无效或缺失
Drone Invalid or missing pipeline section
我正在尝试使用无人机 运行 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
我正在尝试使用无人机 运行 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