My Pipelines configuration gets rejected with the following message:
The 'environment' section in your bitbucket-pipelines.yml file must be a map.
Using the docs, I created the following yml:
pipelines: branches: main: - step: image: php script: - php -v - apt-get update && apt-get install -y unzip - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer - composer -V - composer install - bin/console doctrine:schema:create - bin/console doctrine:fixtures:load - vendor/bin/phpunit services: - mysql definitions: services: mysql: image: mysql environment: MYSQL_DATABASE: tournament MYSQL_RANDOM_ROOT_PASSWORD: yes MYSQL_USERNAME: tournament_user MYSQL_PASSWORD: tournament_password
What's wrong with this configuration file? Why is it rejected?
I second @Adrian - the validator told me my configuration was valid but then I got this unexplained error.
Also, these docs should be updated to use the correct format https://confluence.atlassian.com/bitbucket/how-to-run-common-databases-in-bitbucket-pipelines-891130454.html
I had the same problem and through a process of elimination found that the error comes from using MYSQL_RANDOM_ROOT_PASSWORD. So, despite what the pipelines documentation says, I don't think this is supported properly yet.
Not ideal but it is a workaround for now.
Hi Kieren, sorry for the incorrect example in the docs. I've gone ahead and fixed it.
It's an issue with yml where yes gets converted to a boolean (true) which messes with Pipelines since you can't have a boolean environment variable they must be strings.
If you wrap the yes in quotes then it should work.
Awesome, i'll check that out later.They also seem to have updated the docs as now the credentials are in quotes and they weren't before (still says MYSQL_USERNAME though)!
We’ve been building a plugin to integrate Bitbucket Server and Jenkins CI, and I’m excited to announce that our alpha is ready to download and install. It lets you seamlessly configure a Jenkins job ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events