• Overview
    Key features
    • Observability
    • Auto-scaling
    • Multiframework
    • Security
    Frameworks
    • Django
    • Next.js
    • Drupal
    • WordPress
    • Symfony
    • Magento
    • See all frameworks
    Languages
    • PHP
    • Python
    • Node.js
    • Ruby
    • Java
    • Go
  • Industries
    • Consumer Goods
    • Media/Entertainment
    • Higher Education
    • Government
    • Ecommerce
  • Pricing
  • Featured articles
    • Switching to Platform.sh can help IT/DevOps organizations drive 219% ROI
    • Organizations, the ultimate way to manage your users and projects
  • Support
  • Docs
  • Login
  • Request a demo
  • Free Trial
Meet Upsun. The new, self-service, fully managed PaaS, powered by Platform.sh.Try it now
Blog
Thumbnail

This week in new features - Build-time variables

console
20 December, 2016
Larry Garfield
Larry Garfield
Director of Developer Experience

As we wrote about recently, all of the inputs to an application running on Platform.sh are clearly defined, predictable, and with one exception entirely under your control as a user. We’re happy to announce that we’ve added one more input, and it’s also under user control: Project-level variables available at build time.

Project variables are, as the name implies, just like the other variables we already support but bound to a project rather than to a specific environment. That is, they become available for all environments in a project unconditionally rather than just selected environments/branches. If a given environment has a variable of the same name it will override the project variable, but otherwise a project-level variable will be available to all environments.

“So what?” you may say. Variables defined on the master environment already inherit that way, so what’s the big deal? The big deal is that project variables are available at build time, too.

Environment variables are only available on a running container. That is, they’re available to the running application and can be used in a deploy hook, but not in a build hook. Project variables, by contrast, are also available during a build hook.

Why would you want build-time variables? Shouldn’t the build be controlled entirely by what’s in Git? Generally speaking yes, but just as you may need runtime values that are not stored in Git, such as API keys, you may need secret values for the build process, too. The most common use for that is for downloading non-public 3rd party dependencies. In other words, and at the risk of burying the lead:

We now support private Composer repositories on Platform.sh

That includes the newly-announced Private Packagist.

We’ve written up a tutorial to show how to use a private Composer repository. Give it a try.

There are of course plenty of other things you can do with build-time variables. Let us know what else you are able to do with them.

Get the latest Platform.sh news and resources
Subscribe

Related Content

Simple. Streamlined. Secure. Effortless user management has arrived with Teams

Simple. Streamlined. Secure. Effortless user management has arrived with Teams

Company
AboutSecurity and complianceTrust CenterCareersPressContact us
Thank you for subscribing!
  •  
Field required
Leader Winter 2023
System StatusPrivacyTerms of ServiceImpressumWCAG ComplianceAcceptable Use PolicyManage your cookie preferencesReport a security issue
© 2024 Platform.sh. All rights reserved.
Supported by Horizon 2020's SME Instrument - European Commission 🇪🇺