Skip to main content

Step 4 - Deploying to the Edge

In this guide we'll show you how to deploy your gateway to the edge, at over 200 data-centers around the world. The act of deployment creates new environments and it's worth familiarizing yourself with how environments work.

In this tutorial we'll show the default workflow via GitHub, but note that we also support GitLab, BitBucket (enterprise plan only) and custom CI/CD.

To follow this tutorial you'll need

1/ Connect to GitHub

First, we'll need to connect your project to GitHub. Go to Settings > Source Control. If your project isn't already connected to GitHub click the Connect to GitHub button and follow the auth flow. You'll need to grant permissions for any GitHub organizations you want to work with.

Connect to Source Control

2/ Create the repo and connect the project

Once connected, you'll have the option to connect your project to source control by creating a new repo or connecting to an existing one.

Create Repo

You can choose the organization in the dropdown and choose a repo name (it doesn't have to be the same as the project name, but that is a good practice).

If you've already installed the Zuplo GitHub App your project will already be deploying to the edge.

You can check this by looking at your repo (click the link shown below)

Repo Link

You can see your deployment status in GitHub by looking for the (little) green check or orange dot by the last commit hash

Commit Hash

If you click on the details link you'll see the deployment output from the Zuplo GitHub app. Including, how long it took (6s!) and the URL.

Deployment

You can also see all your environments in Zuplo - head back to Zuplo and click the working-copy link at the top left.

Environment Selector

You should see a new main environment which maps to your main branch. This is typically your Production environment.

3/ Deploy another environment

Zuplo makes it easy for teams to collaborate by allowing teams to create many preview environments. To create a new environment, simple go to your repo in GitHub and create a new branch.

branch names dev and prod are keywords and not supported at this

time. :::

Let's create a branch called development

Create new branch

Wait about 20s and head back to Zuplo - you should see a new entry in the environment dropdown called development.

4/ Push a change to 'development'

Let's make a simple change to our working-copy environment. Let's do something simple like capitalize the Summary field from 'Get all todos' to 'Get All Todos'. It doesn't really matter what the change is.

Change of Summary

Save your changes. Click the GitHub button at bottom left and choose Commit & Push. Enter a description of your change in the dialog that pops up:

Commit Dialog

Click Commit & Push will create a new temporary branch in GitHub with a name zup-.... On the next dialog, click Create Pull Request.

Create PR

This will navigate you to the screen in GitHub that allows you to create a Pull Request. Change the base branch to development (since that is the environment we want to update first). Click Create pull request.

GitHub PR

When ready, click Merge pull request

Merge PR

Once merged, you'll want to delete that temporary branch.

Delete branch

The successful merge will trigger a rebuild and deployment of development with your change. You can check this by choosing the environment development in Zuplo and navigating to the readonly Route Designer.

Readonly view of changes

This shows how you can use widely recognized GitOps practices to manage how code flows through your environments using Pull Requests and protected branches.

Troubleshooting

I don't see my repository listed in Zuplo project settings.

  • Make sure you've granted access to the project with the Zuplo GitHub App, you can check that configuration here

I've connected my Zuplo project to a GitHub repository but get access errors when running commits, pulls or try to open a pull request.

  • If you are the owner of the project, make sure you've granted access to the project with the Zuplo GitHub App, you can check that configuration here
  • If this Zuplo project was shared with you, make sure you are a GitHub collaborator. This can be verified by going to the GitHub repository > Settings > Collaborators section. You'll need admin permissions to the repository.
  • If the GitHub repository has been renamed or moved to a different organization, try disconnecting and reconnecting to it. You can do this by going to your Zuplo project's settings > Source Control section