Hello. I wanted to install the latest (at the moment) version of ElasticSearch, so I set up circle.ci
as described in this guide — and it worked great. Then I decided to “DRY-out” repeated ElasticSearch version so it can be easily changed later. I modified my config to use the version defined via an environment variable:
machine:
environment:
ELASTIC_VERSION: 5.1.2
dependencies:
cache_directories:
- elasticsearch-${ELASTIC_VERSION}
post:
- if [[ ! -e elasticsearch-${ELASTIC_VERSION} ]]; then wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ELASTIC_VERSION}.tar.gz && tar -xzf elasticsearch-${ELASTIC_VERSION}.tar.gz; fi
- elasticsearch-${ELASTIC_VERSION}/bin/elasticsearch:
background: true
I pushed this change to the repo and waited until the build finished successfully, then rebuilt it twice, each time ElasticSearch was downloaded. Also, there was a warning:
circle.yml specified cache directory: /home/ubuntu/REPONAME/elasticsearch-${ELASTIC_VERSION} but it does not exist
So I’ve figured out that environment variables just don’t expand inside the cache_directories
directive. I don’t know if it’s made by intention or just have not been implemented yet, but I think that it would be a nice feature to have, so I have decided to report this.
Thanks.