Coder Social home page Coder Social logo

Comments (3)

greg-1-anderson avatar greg-1-anderson commented on July 19, 2024

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.

pwtyler avatar pwtyler commented on July 19, 2024

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.

pwtyler avatar pwtyler commented on July 19, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.