Develop On Okteto Button
The Develop on Okteto button is a shortcut to deploy your development environments with a single click.
The button is designed to be used in Git README
files, documentation sites, or pretty much anywhere that renders an html file.
Here's an example button that deploys the Movies App using Okteto:
Requirements
The basic requirements for creating the button are that your application can be deployed in Okteto, and that the application's source code is hosted in a public Git repository.
The easiest way to validate this is to follow the instructions in the Deploy from Git document.
Adding the Develop on Okteto button
There are two ways of referencing the source code repository:
- Resolve it implicitly. This is useful in GitHub
README.
files. If you don't specify the repository, Okteto will infer it using thereferrer
header. This only works on public repositories hosted in https://github.com. - Using the
repository
andbranch
parameters. This is useful for buttons hosted outside of https://github.com, in blog posts or documentation.
Using an implicit repository
If you're embedding the button in a public GitHub repository's README
file, Okteto will automatically infer the repository and the branch using the referrer header when someone clicks on the button.
Here's an example:
[![Develop on Okteto](https://okteto.com/develop-okteto.svg)](https://okteto.example.com/deploy)
And here's the equivalent content as HTML if you prefer that:
<a href="https://okteto.example.com/deploy">
<img src="https://okteto.com/develop-okteto.svg" alt="Develop on Okteto">
</a>
A develop-okteto.png
is also available.
Adding explicit parameters
Use the following Markdown snippet as a template, changing the repository
and branch
query parameters to match your repository. The branch
query parameter is optional.
[![Develop on Okteto](https://okteto.com/develop-okteto.svg)](https://okteto.example.com/deploy?repository=https://github.com/okteto/movies&branch=main)
And here's the equivalent content as HTML if you prefer that:
<a href="https://okteto.example.com/deploy?repository=https://github.com/okteto/movies&branch=main">
<img src="https://okteto.com/develop-okteto.svg" alt="Develop on Okteto">
</a>
Parameters
You can parametrize your deployment using the following parameters:
repository
: The repository to be deployed. If it's not present, Okteto will automatically infer it using the referrer header, if available.branch
: The repository branch to be deployed. If not included, it will use the default branch of the repository.vars
: It allows you to specify a list of variables that will be available as environment variables during the deployment. It is optional. .e.gvars=[{"name":"THEME","value":"dark"},{"name":"LANG","value":"en"}]
. This would generate 2 environment variables that are available on your deployment:THEME=dark
andLANG=en
. It has to be URL encoded.filename
: The location of the Okteto manifest relative to the root of the repository. If not set, one of the deployment related manifests will be used.