G
G
Gallery
Search…
Create a Template
Once your cloud provider is linked, you can create a template that lists out your services. The most basic way to create a template is to sync services from an existing cloud project, however, this feature is only supported on GCP and Heroku for select cloud services at the moment. We are rolling out support for AWS, along with expanded support for more services on GCP in the coming weeks. When you create your template be sure to select the platforms you are using -- this will be used both to validate your Terraform snippets, and to import your cloud services, in the case you're not using Terraform.
A new template with the Google Provider selected

Importing Services

You can add services in two different ways, either through using Terraform snippets or syncing from an existing project, as mentioned above.

Existing Project Import

In order to sync with an existing project (only on GCP and Heroku), be sure that the relevant provider is selected. Then, click add service from existing project.
Adding a service from an existing project
Then, select the project in the dialog, and the relevant services will be added to the template. For a complete accounting of which services are supported for existing project import, see the Cloud Integrations section of the documentation.
Services after import from cloud project
Once a set of services is imported, a potential list of gallery configuration options for each service will appear. Make sure for services with the "Subdomain" section have unique values filled out, since they will be used to host your traffic on a gallery subdomain.

Linking Repositories

First, make sure you've linked your Git provider (Github or Gitlab) on the integrations page. You can link a template with one or more Git repositories to build and deploy your code onto the Gallery-managed infrastructure on your own cloud account. Be sure to check the relevant Cloud Integration page on the environment variables Gallery exposes to allow you to authenticate with your cloud provider on the build machines.
Go to the relevant template you wish to link a build repo to, and navigate to the "Build Commands" tab. Once you select the repository, you'll need to specify a build command. The easiest way to do so is to a "Basic" set of build instructions, that includes a Docker image and a build script.
The Basic Repo Deployment Form
You can also specify build services, which are background services that you can connect to from your build script. Currently this is limited to the docker-in-docker background service, which allows you to perform docker builds within your build script, but you can find more information on custom services in the "Building Repositories" section of the documentation. If you aren't using build services, all you need to do is copy your deployment script, and indicate a docker image that includes all the dependencies used to build and deploy your repository to your infrastructure. If you need references to the infrastructure that Gallery has spun up, you can generally find them in the environment variables passed into the deploy script, for more information see the relevant sections of the documentation.
Last modified 1mo ago