Up 0.5.0 — Custom stages and instant rollbacks

TJ Holowaychuk
Feb 9, 2018 · 4 min read

This small release introduces custom stages, stage-level configuration overrides, instant rollbacks and a few other refinements for Up the serverless deployment tool.

Custom Stages

The development stage is now reserved for local use, and Up now deploys to staging by default. This lets you do things like override the command run locally, for example if you use the gin hot reloading tool in Golang you would override the proxy.command setting:

{
"name": "app",
"stages": {
"development": {
"proxy": {
"command": "gin --port $PORT"
}
}
}
}

Running up start starts the Up proxy which provides logging and middleware such as CORS, as well as running your application, in this case using gin --port $PORT

Now suppose your team chooses to treat staging as an environment isolated from production using different databases and resources— in this scenario you may want to introduce a qa stage for quality assurance testing before releasing to production.

To add the stage, you may just add the “qa” key to stages in your up.json config:

{
"name": "app",
"stages": {
"qa": {},
"development": {
"proxy": {
"command": "gin --port $PORT"
}
}
}
}

However in most cases you’ll also want some kind of domain name for these stages, for exampleqa.up-example.com

{
"name": "up-demo",
"profile": "up-tobi",
"lambda": {
"memory": 1024
},
"stages": {
"qa": {
"domain": "qa.up-example.com"
},
"development": {
"proxy": {
"command": "gin --port $PORT"
}
}
}
}

Running up stack plan will show you a preview of the changes to apply, following that with up stack apply to perform the creation of the resources. Later if you’d like to remove the stage, simply remove it from up.json and plan/apply again.

Stage Overrides

Here’s an example of what this might look like for a single-page app, overriding the build hook to tune the parcel flags, and increase the lambda.memory from the default of 512 to 1024 .

{
"name": "app",
"hooks": {
"build": "parcel index.html --no-minify -o build",
"clean": "rm -fr build"
},
"stages": {
"production": {
"hooks": {
"build": "parcel index.html -o build"
},
"lambda": {
"memory": 1024
}
}
}
}

Instant Rollbacks

To rollback the previous version for production run:

$ up rollback -s production

To rollback production to a specific version, you may pass the version as an argument:

$ up rollback -s production 50

Soon Up will support deployment changelogs and interactive rollbacks which will help keep track of each release.

Optimized SSL Cert Creation

Previously Up created one per domain, for example api.myapp.com and myapp.com would require verifying two emails, however, now only a single wildcard cert is requested.

Start Command

up start -c 'go run main.go'
up start -c 'nodemon app.js'
up start -c 'gin --port $PORT'

If you like the idea of deploying infinitely scalable apps to AWS in a single command, or looking for a cost-effective Heroku alternative, give the free OSS version a try at apex/up — or subscribe to Up Pro for $10/mo with the coupon “up-medium-6203ABC2F9C3” for:

  • Unlimited team usage (as many apps and team-members as you need)
  • Encrypted stage-scoped environment variables via up env
  • Alerting via email, SMS, and Slack
  • S3 upload acceleration for faster deploys
  • Instant rollbacks

Head over to our Slack if you have questions or suggestions. More coming soon!


If you’re interested in Up and have a few minutes, please consider filling out the Up Feedback survey—no emails are collected :)

TJ Holowaychuk

Written by

Code. Photography. Art.