Comments (3)
You can currently do this in two requests; the site:info
command will give you your multidev limit, and multidev:list
will let you count them. This feature request is a reasonable way to determine the same thing faster; however, if you are often hitting your multidev limit, try submitting a support request and ask about getting it bumped up. The main reason the limit exists is so that customers will delete their unused multidevs. If you can demonstrate that your multidevs are actually in use (e.g. "for our team size, we need a buffer of five unused for our pull request workflow"), your request is likely to be granted.
from terminus.
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 (terminus site:info "${SITE_NAME}" --field="Max Multidevs"
) against a count of env:list
—
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
from terminus.
@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.
from terminus.
Related Issues (20)
- Export the production domain as the URI when exporting drush aliases HOT 1
- Document use of workflow:wait
- terminus
- The file assets://css was not deleted because it does not exist. HOT 1
- Testing Zapier with Chris HOT 1
- Moar zap testing
- Terminus not working on Windows with WSL ubuntu 22.04
- Is TERMINUS_MACHINE_TOKEN still a thing? HOT 12
- terminus self:plugin:install does not exit with an error if the composer command failed
- Terminus fails to return mysql connection string for multidev with numeric name HOT 2
- autocomplete is not working in remote host HOT 1
- Update for compatibility with Drush v12
- PHP 8.2 deprecations HOT 1
- [LOPS-1661] PHP 8.3 Support HOT 1
- Wrong release version pattern HOT 2
- workflow:wait reports workflow is still running when it isn't HOT 1
- Failed code merges are suppressed using `--no-interaction` with `terminus multidev:merge-from-dev`
- defaultMaxRetries not defined in Request::createRetryDecider HOT 2
- Add ability to skip cache tables to env:clone command
- Pantheon Customer SSH key authorization issue - need to login for every command HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terminus.