gpt4 book ai didi

rabbitmq - 在 travis build设置中声明 rabbitmq 交换

转载 作者:行者123 更新时间:2023-12-05 06:30:44 25 4
gpt4 key购买 nike

我想在执行集成测试之前在 Travis 环境中设置一些 RabbitMQ 交换器。

.travis.yml

services:
- rabbitmq

before_script:
- src/it/bin/configure_rabbitmq.sh

configure_rabbitmq.sh

#!/usr/bin/env bash

if [ -f ./rabbitmqadmin ]; then
echo "rabbitmqadmin already present"
else
wget http://localhost:15672/cli/rabbitmqadmin
chmod +x rabbitmqadmin
fi

./rabbitmqadmin declare vhost name=guest
for r in a b c d e; do
./rabbitmqadmin --vhost=guest declare exchange name=set-$r-testing type=fanout durable=true -u guest -p guest
done

失败日志

$ src/it/bin/configure_rabbitmq.sh
--2018-08-31 01:56:05-- http://localhost:15672/cli/rabbitmqadmin
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:15672... connected.
HTTP request sent, awaiting response... 200 OK
Length: 37698 (37K) [application/octet-stream]
Saving to: ‘rabbitmqadmin’
0K .......... .......... .......... ...... 100% 181K=0.2s
2018-08-31 01:56:06 (181 KB/s) - ‘rabbitmqadmin’ saved [37698/37698]
vhost declared
*** Access refused: /api/exchanges/guest/set-a-testing
*** Access refused: /api/exchanges/guest/set-b-testing
*** Access refused: /api/exchanges/guest/set-c-testing
*** Access refused: /api/exchanges/guest/set-d-testing
*** Access refused: /api/exchanges/guest/set-e-testing
The command "src/it/bin/configure_rabbitmq.sh" failed and exited with 1 during .

是什么阻止了我创建这些交易所的授权?

最佳答案

Travis RabbitMQ docs状态:

RabbitMQ requires setuid flags, so you can only run RabbitMQ on standard, OS X or Trusty infrastructure (ie, your .travis.yml must contain sudo: required).

添加 sudo: required 可能会解决这个问题。

关于rabbitmq - 在 travis build设置中声明 rabbitmq 交换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52107517/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com