Travis-CI 上的 Xenial (Ubuntu 16.04) 图像预装了 Elasticsearch-5.5。我应该在我的 .travis.yml
中放入什么来针对 Elasticsearch-7.0 运行我的构建?
最佳答案
将这些命令添加到您的 before_install
步骤:
- curl -s -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.0.1-amd64.deb
- sudo dpkg -i --force-confnew elasticsearch-7.0.1-amd64.deb
- sudo sed -i.old 's/-Xms1g/-Xms128m/' /etc/elasticsearch/jvm.options
- sudo sed -i.old 's/-Xmx1g/-Xmx128m/' /etc/elasticsearch/jvm.options
- echo -e '-XX:+DisableExplicitGC\n-Djdk.io.permissionsUseCanonicalPath=true\n-Dlog4j.skipJansi=true\n-server\n' | sudo tee -a /etc/elasticsearch/jvm.options
- sudo chown -R elasticsearch:elasticsearch /etc/default/elasticsearch
- sudo systemctl start elasticsearch
对 jvm.options
的更改是为了模拟 Elasticsearch-5.5 的现有配置,我认为 Travis peeps 已经真正考虑过了。
根据Travis docs ,您还应该将此行添加到您的 before_script
步骤:
- sleep 10
这是为了确保 Elasticsearch 启动并运行,但我还没有检查它是否真的有必要。
关于elasticsearch - 在 Travis Xenial 构建主机上运行 Elasticsearch-7.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55951531/