Up 0.5.0 — Custom stages and instant rollbacks

TJ Holowaychuk
4 min readFeb 9, 2018

--

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 most notable change in v0.5.0 is the addition of custom stages—you’re no longer bound to staging and production — you may define as many stages as you need for your teams or features.

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

Overrides allow you to customize deployments per-stage—this is something we already saw with the development override of proxy.command in the previous section, but this works for other options as well.

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

Up Pro now supports instant rollbacks. Through the use of immutable deployments on Lambda, you can roll back to the previous (or specified) version in milliseconds.

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

Up provisions free SSL certificates for you via AWS ACM, and now optimizes this process so that you have fewer confirmation emails to verify.

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

Another tiny but welcome addition is the -c, --command flag for up start allowing you to quickly change the command run, here are some examples:

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

--

--