Why we created Now
We believe that deployments should be fast, simple, reliable, and cost-effective. We want to enable developers to focus on their core applications, and not on configuring DNS, scalability, or other infrastructure. That's why we created Now – to allow you to just push code, while we take care of the infrastructure.
Git is popular among us developers – our code is often backed by a Git repository hosted on GitLab or GitHub. For most of us, our workflow involves developing features in distinct branches, which get merged into a stable master branch (or its equivalent). For most teams, the strategy around deployments follows the same style – we first stage our work on feature-specific URLs, and then finally merge them into a production URL.
We want Now to enhance the developer workflow. By sticking close to the source code, and integrating with code collaboration tools we love, we are helping enhance the code review and release process.
Now for GitLab
In this post, we showcase our most requested feature, Now for GitLab. With this first-class GitLab integration, you can automatically deploy any GitLab project, and enjoy core Now features, including global CDN, Anycast DNS, HTTPS support, and DDOS Protection.
Once set up, Now builds and deploys automatically, for every commit you push to GitLab. Each such deployment gets a unique URL and we keep all your deployments alive. Thanks to our usage-based pricing model, you only pay for actual invocations and don't have to worry about unused deployments.
Being able to test a unique deployment for every commit allows you to merge changes to your project with confidence.
All deployments made within a merge request are listed chronologically on its page. They can be tested at any time, allowing your team to try out changes as progress is made, and to iron out concerns before pushing a new feature to production.
You can track all the deployments made towards a specific feature on its merge request page.
Every merge request receives a unique URL based on its branch name. The URL points to the latest deployment made on the merge request branch. You can share the URL with your team or even publicly, for beta testing your changes.
The unique URL for the merge request acts as a staging link that can be passed around to anybody in the team who is interested in tracking development updates on a specific feature.
Merged MRs are automatically deployed to production. Once deployed, we automatically alias your deployment to the production domain name.
Once a merge request lands on the default branch, it is automatically built, deployed, and aliased to the chosen production domain names.
Getting started with Now for GitLab
We offer a powerful free tier which allows you to deploy a small-scale production app without requiring a credit card. To get started, visit the ZEIT Sign up page and click the
Continue with GitLab button. When GitLab requests an authorization, click
By signing up for ZEIT with GitLab, you automatically connect Now with your GitLab account, making it easier to link to your GitLab projects.
The Quick Start templates save you time from setting up boilerplate code for several popular projects, such as Next.js, Vue, or Hugo.
Please note that if you already have a ZEIT account, you can set up the connection to GitLab on your ZEIT account page.
Prepare your project for Now
To be able to successfully process a GitLab project, Now needs to be provided with build and deployment information. This information can be provided via a
now.json configuration file.
For example, if you are interested in deploying Node.js serverless code, the
now.json file could be framed as follows:
"name": "GitLab Project",
now.json allows us to provide information about building, deploying, and aliasing a GitLab project with Now.
More information on configuring
now.json, including all supported options, is available on its docs page. We support building and deploying many popular technologies through our open-sourced official Builders, including Python, Rust, PHP, and Go. We welcome your contributions toward new Builders to support your favorite technology. To help with that, we also have a guide in place that walks through the process of creating and publishing a Builder.
Custom domain names and Instant Rollbacks
When a GitLab merge request is merged into the default branch, Now for GitLab instantly triggers a new deployment. As soon as that deployment completes, it is automatically aliased to the production domain names that were specified through the
alias property in
When you deploy with Now, we map all your code and configuration to a single, unique URL. Now only performs a new build when the underlying code receives changes.
If you trigger a revert within GitLab on the default branch, the code and configuration perfectly match a deployment URL Now previously had. This allows us to perform the alias with the previous URL within milliseconds, thus providing an Instant Rollback.
Our mission at ZEIT is to make the cloud accessible to everyone. The Now for GitLab integration was one of our most requested features, and we are thrilled to make it available to you.