LogoLogo
  • Welcome to Release
  • Getting started
    • Quickstart
    • Create an account
    • Prepare to use Release
    • Create an application
      • Create custom application
      • Create from template
      • Servers vs runnables
    • Create an environment
  • Guides and examples
    • Domains and DNS
      • Manage domains
      • DNS and nameservers
        • Configure GoDaddy
        • Configure Cloudflare
        • Configure Namecheap
        • Other DNS hosts
      • Routing traffic
    • Example applications
      • Full stack voting app
      • Flask and RDS counter app
      • Static site with Gatsby
      • Golang with Postgres and Nginx
      • WordPress with MySQL
      • Spring and PostgreSQL
      • Terraform and Flask
      • OpenTelemetry demo
      • Load balancer with hostname
      • Static JavaScript service
      • SSH bastion access to services
      • ngrok and OAuth for private tunnels
      • Using OAuth Proxy
      • Hybrid Docker and static site
      • App Imports: Connecting two applications
      • Example library
    • Running instances
      • Cron jobs
      • Jobs
      • Using Helm charts
      • Using terminal
      • Viewing logs
      • Troubleshooting
        • ImagePullBackoff error
        • CrashLoopBackoff error
        • Exit codes
        • OOM: out of memory
    • Advanced guides
      • Containers guide
      • Application guide
      • Kubernetes guide
      • Create a cluster
      • Upgrade a cluster
      • Managing node groups
      • Patch node groups
      • Hostnames and rules
      • Serve traffic on multiple ports
      • Configure access to your K8s cluster
      • Designing for multiple environments
      • Microservices architecture
      • Monitoring your clusters
      • Performance tuning
      • Visibility and monitoring
      • Working with data
        • Container-based data
        • Seeding and migration
        • Cloud-provided data
        • Golden images
        • Third party
      • Pausing Instant Datasets
        • Application pausing schedules
        • Pause/resume environments
      • Infrastructure as code
        • Terraform
  • Reference documentation
    • Account settings
      • Account info
      • Managing users
      • Build settings
        • Build arguments
        • Build SSH keys
      • Add integrations
      • View clusters and cloud integrations
      • Add datasets
      • Environment handles
    • Workflows in Release
      • Stages of workflows
      • Serial deployments
      • Parallel deployments
      • Rolling deployments
      • Rainbow deployments
    • Networking
      • Network architecture (AWS)
      • Network architecture (GCP)
      • Ingresses
      • IP addresses
      • Cloud-provided services
      • Third-party services
    • Release environment versioning
    • Application settings
      • Application Template
        • Schema definition
      • Default environment variables
      • GitHub
      • Pull requests
      • GitOps
      • Just-in-time file mounts
      • Primary App Link
      • Create application FAQ
      • App-level build arguments
      • Parameters
      • Workspaces
    • End-to-end testing
    • Environment settings
      • Environment configuration
      • Environment variables
        • Environment variable mappings
        • Secrets vaults
        • Using Secrets with GitOps
        • Kubernetes Secrets as environment variables
        • Managing legacy Release Secrets
    • Environment expiration
    • Environment presets
    • Instant datasets on AWS
    • Instant datasets on GCP
    • Instant dataset tasks
      • Tonic Cloud
      • Tonic On-Premise
    • Cloud resources
    • Static service deployment
    • Helm
      • Getting started
      • Version-controlled Helm charts
      • Open-source charts
      • Building Docker images
      • Ingress and networking
      • Configuration
    • GitOps
    • The .release.yaml file
    • Docker Compose conversion support
    • Reference examples
      • Adding and removing services
      • Managing service resources
      • Adding database containers to the Application Template
      • Stock Off-The-Shelf Examples
    • Release API
      • Account Authentication
      • Environments API
        • Create
        • Get
        • Setup
        • Patch
      • User Authentication
      • Environment Presets API
        • Get Environment Preset List
        • Get Environment Preset
        • Put Environment Preset
  • Background concepts
    • How Release works
  • Frequently asked questions
    • Release FAQ
    • AWS FAQ
    • Docker FAQ
    • JavaScript FAQ
  • Integrations
    • Integrations overview
      • Artifactory integration
      • Cloud integrations (AWS)
        • AWS guides
        • Grant access to AWS resources
        • AWS how to increase EIP quota
        • Control your EKS fleet with systems manager
        • Managing STS access
        • AWS Permissions Boundaries
        • Private ECR Repositories
        • Using an Existing AWS VPC
        • Using an Existing EKS Cluster
      • Docker Hub integration
      • LaunchDarkly integration
      • Private registries
      • Slack integration
      • Cloud integrations (GCP)
        • GCP Permissions Boundary
      • Datadog Agent
      • Doppler Secrets Manager
      • AWS Secrets Management
    • Source control integrations
      • GitHub
        • Pull request comments
        • Pull request labels
        • GitHub deployments
        • GitHub statuses
        • Remove GitHub integration
      • Bitbucket
      • GitLab
    • Monitoring and logging add-ons
      • Datadog
      • New Relic
      • ELK (Elasticsearch, Logstash, and Kibana)
  • Release Delivery
    • Create new customer integration
    • Delivery guide
    • Release to customer account access controls
    • Delivery FAQs
  • Release Instant Datasets
    • Introduction
    • Quickstart
    • Security
      • AWS Instant Dataset security
    • FAQ
    • API
  • CLI
    • Getting started
    • Installation
    • Configuration
    • CLI usage example
    • Remote development environments
    • Command reference
      • release accounts
        • release accounts list
        • release accounts select
      • release ai
        • release ai chat
        • release ai config-delete
        • release ai config-init
        • release ai config-select
        • release ai config-upsert
      • release apps
        • release apps list
        • release apps select
      • release auth
        • release auth login
        • release auth logout
      • release builds
        • release builds create
      • release clusters
        • release clusters exec
        • release clusters kubeconfig
        • release clusters shell
      • release datasets
        • release datasets list
        • release datasets refresh
      • release deploys
        • release deploys create
        • release deploys list
      • release development
        • release development logs
        • release development start
      • release environments
        • release environments config-get
        • release environments config-set
        • release environments create
        • release environments delete
        • release environments get
        • release environments list
        • release environments vars-get
      • release gitops
        • release gitops init
        • release gitops validate
      • release instances
        • release instances exec
        • release instances logs
        • release instances terminal
  • Release.ai
    • Release.ai Introduction
    • Getting Started
    • Release.ai Templates
    • Template Configuration Basics
    • Using GPU Resources
    • Custom Workflows
    • Fine Tuning LlamaX
    • Serving Inference
Powered by GitBook
On this page
  • Release's matching branches heuristic
  • Fork the repositories on Github
  • Create the backend application
  • Create the frontend application
  • Add the environment variable
  • View the deploy
  • View the live application

Was this helpful?

  1. Guides and examples
  2. Example applications

App Imports: Connecting two applications

PreviousHybrid Docker and static siteNextExample library

Last updated 2 years ago

Was this helpful?

Release's App Imports functionality allows you to connect two applications with code in different repositories. You can read more about how App Imports is implemented in our documentation.

Here we'll show you an example of App Imports in action, using two repositories from our directory:

  • The will act as our frontend application.

  • The will act as our backend, with worker process provided by .

Release's matching branches heuristic

Let's take a moment to understand how Release chooses which branch to use when automatically creating an environment for connected apps with different repositories.

Release will try to match a branch in the imported repository to the name of the importing repository. If there is no match, Release will fall back to either the or the default branch. You can also use the .

Here's an example to demonstrate. Say we have RepoA, RepoB, and RepoC with the following branches:

Repository
Default Branch
Tracking Branch
Other Branches

RepoA

main

main

feature-1, feature-2

RepoB

develop

feature-2

RepoC

v5

bug-1

feature-1, bug-2

  • If an automatic environment request for RepoA on main is created, Release will select the develop default branch for RepoB and the bug-1 tracking branch for RepoC.

  • If an automatic environment request for RepoA on feature-1 is created, Release will select the develop default branch for RepoB and the matching feature-1 branch for RepoC.

  • If an automatic environment request for RepoA on feature-2 is created, Release will select the feature-2 matching branch for RepoB and the bug-1 tracking branch for RepoC.

  • If an automatic environment request for RepoB or RepoC is created, the results will be similar depending on how the separate imported apps are designed. For instance, your frontend may always import the backend and a middleware proxy, but the backend will only import the proxy automatically, and not the frontend.

In our example, RepoA imports RepoB and RepoC, but it is not clear how RepoB or RepoC imports the others. If you're importing bi-directionally (or meshed, as in our three-way example), the same heuristic would apply to RepoB, RepoC, and RepoA.

Fork the repositories on Github

Click the Fork button in the top right corner of the page to fork the repository.

Create the backend application

The first application we'll create will be from the rails_postgres_redis repository.

When you've selected the repository, Release presents options for how the services should be run. The api service has options for both Static (because a package.json file was found) and Docker (because a Dockerfile was found). Since this is a Rails server, we'll pick Docker.

Notice that Release specifies 443 under "Public Port" for our api service. We'll use this later when we connect our two applications.

Next we'll name the application. You can give the application any name, but since this repository is the backend API for our example, we'll name it "backend".

Click the Generate App Template button to move on to the next screen.

On the Application Template screen, we don't need to make any changes, so you can go ahead and click the Save & Continue button.

We don't need to make any changes in the Build & Runtime Configurations page either, so you can click the Start Build & Deploy button to finish setting up the backend.

Create the frontend application

Now we can create an application from the docker-create-react-app repository.

Select the repository and Release will present the options for how the services will be run. This repository has only one service named app, which is configured to run in Docker, so we select Docker.

Name the app – we've named it "frontend" – then click the Generate App Template button.

This time, we'll modify the Application Template to connect our applications using the App Imports feature. Click Edit to open the Application Template.

At the bottom of the Application Template we've added:

app_imports:
- name: backend

This tells Release that when we create the frontend application, the backend application must be imported.

Click Save & Continue.

Add the environment variable

Next we need to add an environment variable to ensure the two applications can talk to each other.

Release automatically generates environment variables in the form of <SERVICE_NAME>_INGRESS_URL when the service is exposed to the internet.

When we created our backend application, we selected Docker for our api service, and Release specified that the service is exposed on public port 443. This means we'll have an environment variable in our backend named API_INGRESS_URL.

To add the environment variable, click the Edit button in the "Default Environment Variables" section.

We added

mapping:
  REACT_APP_BACKEND_API: API_INGRESS_URL

Now our frontend application will receive the value of API_INGRESS_URL as the environment variable REACT_APP_BACKEND_API. Click Save to close the Default Environment Variables modal and click Start Build & Deploy.

View the deploy

On the App Dashboard page, we can see that a deploy is in progress.

Click on Deploy 3345 to go to the Deploy Info page where you'll see the progress.

Notice that there are four stages to this deployment: Two for the backend application and two for the frontend application. This tells us that our App Import has worked.

When deployment is complete, you can click on the Go To Environment button to view the URLs and ensure that the frontend application can talk to the backend application.

On the Environment Details page, we can see the environment for our backend application in the "Namespace" section, and the URL for our frontend application in the "Hostname URLs" section.

Click on the app link to go to the live Release environment.

View the live application

There isn't much to see when you first visit the live application, but what it's doing is making an API call to the backend to fetch users from the database and display them. Since we don't have any users yet, there are none to display.

Click on the Create New Users button to trigger a background job using Sidekiq and Redis to create users. After a short wait, the API to retrieve the users is called again and we can see that the users were successfully created.

Navigate to the .

Do the same for the .

You will need to grant access to the newly forked repositories. Follow the instructions in to do so.

When we use App Imports to connect the applications, the ingress environment variables for backend are shared with frontend. We need to add a mapping from API_INGRESS_URL to the correct environment variable on the frontend. We'll map to the REACT_APP_BACKEND_API environment variable, which can be found in the file of the repository.

If you'd like to learn more about mapping environment variables, read the section about it in our .

Release GitHub repository for our frontend application
GitHub repository for our backend application
api.js
microservices architecture
awesome-release
docker-create-react-app
rails_postgres_redis
sidekiq
connect your source control provider
guide to environment variables
tracking_branch
tracking_tag