-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request: command that returns if the multidev environment limit has been reached #2440
Comments
You can currently do this in two requests; the |
While there's not currently a single endpoint that would provide this as a boolean yes/no, this can be done by comparing the "Max Multidevs" field ( I think something like this would work for you (I'm sure there are cleaner/better bashisms than what I've suggested as well): #!/bin/bash
MAX_ALLOWED=$(terminus site:info "${SITE_NAME}" --field="Max Multidevs")
# Count current environments
COUNT=$(terminus env:list "${SITE_NAME}" --format=list | wc -l)
# Subtract 3 to account for dev/test/live
# (and remove whitespace from the output of the previous command to make the arithmetic work)
MULTIDEV_COUNT=$(expr ${COUNT//[[:blank:]]/} - 3)
if [[ "${MULTIDEV_COUNT}" -ge "${MAX_ALLOWED}" ]]; then
echo "Not enough multidevs"
exit 1
fi |
@justafish, I ended up implementing a script to clean up old builds for CI on our pantheon_advanced_page_cache repo, it got a little more complicated to cover the edge cases a little better, but you can check it out here and adapt to your needs. |
This would help fail automated deploy processes faster i.e. not have to go through the entire build and preparation to push to a multidev before finding out that none are available.
The text was updated successfully, but these errors were encountered: