Zuplo provides the Zuplo deployer, a GitHub app that can be used to
automatically deploy your APIs from your GitHub repository to the Zuplo
platform. However, sometimes you might not be using GitHub as your version
control provider. Or, that you might want to exercise more control over your
CI/CD pipeline. For these cases, we provide a CLI that can be used to deploy
your APIs to the Zuplo platform.
The API key is scoped to your account. So you can use the same one for all
projects under the same account. If you are a member of multiple accounts, be
sure to select the right one.
The Zuplo CLI, zup, which you be using in you custom
CI/CD script, uses API Keys to authenticate. You can find your API Key by
following these steps:
Create a pipelines file. You can use the following to help you get started:
Note
GitLab CI/CD does not have a built-in way to delete deployments. You can use the Zuplo UI to delete old environments.
Create a variable
for ZUPLO_API_KEY on your GitLab project. Set it to the API key you
generated in the previous step. You can choose to
mask the
variable so it does not display in job logs.
The above samples showcase the most common use case for our customers. However,
you might have more advanced use cases that require more control. The following
sections describe some other parameters that you can control.
You might end up with this structure because you are using git submodules to
connect multiple repositories together. Or, you might have multiple projects in
the same repository because you are trying to migrate to a monorepo.
If you have multiple sub-folders in your repository, each representing a
different Zuplo project, you can deploy each one separately.
Ensure you use the right API key for each project. You can specify the API
key by passing it with the --apiKey flag.
Ensure that you have the project name configured in the zuplo.jsonc file in
the subfolder. This tells the Zuplo CLI which project to deploy to.
You might need to use the --no-verify-remote flag to bypass verification. By
default, the CLI checks that the repository matches what is configured on the
server. If you have moved or renamed your repository, you must bypass the
verification.
The npx @zuplo/cli deploy command takes the current Git branch that you are on
into consideration when deploying. If you are on your main branch, it will
deploy to your production. If you are on any other branch, it will deploy to a
staging environment with the name of your branch.