Skip to main content

Deployment

Deploying your Turbine data apps is easy using the Meroxa CLI.

Before you get started, ensure the resources used by your Turbine data app exist on the Meroxa Platform. You can check using the Meroxa Dashboard or CLI by running the meroxa resources list command--this command lists all resources and their state.

If the resources don't exist, you must configure your resources using the Meroxa Dashboard or CLI before proceeding to the next steps.

Prepare to deploy

The Turbine framework uses git for version control. Upon initilializing your application, git init is performed locally on your behalf. This creates a new repository in the root directory of your Turbine data app, which can be used to track your code. You will need commit your code changes before deploying by running a couple commands.

The following steps will guide you through how to do this:

  1. Ensure you are checked out in the correct branch by running git branch.
$ git branch
* main

The production or primary branch for Turbine data apps is always main or master--depending on your preference. When git init is run, what is defined as your init.defaultBranch is set as the primary branch by default.

  1. Review your code and make sure everything is correct.
warning

Check your record and write functions and ensure they are referencing the correct resources with collections or APIs. Unintended updates to production data stores and systems are not easily reversable.

  1. Stage your code changes and commit.
$ git add .
$ git commit -m "First commit"
[main (root-commit) <short-sha> First commit
5 files changed, 18 insertions(+)
create mode 100644 .gitignore
create mode 100644 README.md
create mode 100644 app.json
create mode 100644 fixtures
create mode 100644 index.js

Deploy

Great, now that you've committed your code changes you are ready to deploy!

Using the Meroxa CLI, run the meroxa apps deploy command in the root directory of your Turbine data app. This will start the process of deployment.

meroxa apps deploy

The Meroxa CLI will print out the steps taken and confirm once deployment is successful:

$ meroxa apps deploy
Validating your app.json...
✔ Checked your language is "javascript"
✔ Checked your application name is "liveapp"
Checking for uncommitted changes...
✔ No uncommitted changes!
Deploying application "liveapp"...
✔ Application built
✔ Can access your Turbine resources
✔ Application processes found. Creating application image...
✔ Platform source fetched
✔ Dockerfile created
"turbine-liveapp.tar.gz" successfully created in "/Users/local/path/liveapp"
✔ Source uploaded
✔ Removed "turbine-liveapp.tar.gz"
✔ Dockerfile removed
✔ Successfully built process image ("UUID")
✔ Deploy complete
✔ Application "liveapp" successfully created!

✨ To view your application visit https://dashboard.meroxa.io/apps/liveapp/detail

Deploy to an Environment

When deploying a Turbine data app, you have the option to indicate which Environment you'd like to create it in. The default Environment when running meroxa apps deploy on its own is common, our multi-tenant offering.

In the example below, we show you how to deploy to an Environment named aws by using the --env flag.

meroxa apps deploy --env aws

The Meroxa CLI will print out the steps taken and confirm once deployment is successful:

$ meroxa apps deploy --env aws
Validating your app.json...
✔ Checked your language is "javascript"
✔ Checked your application name is "liveapp"
Checking for uncommitted changes...
✔ No uncommitted changes!
Preparing to deploy application "liveapp"...
✔ Can access your Turbine resources
✔ No need to create process image
✔ Application "liveapp" successfully deployed!

✨ To view your application visit https://dashboard.meroxa.io/apps/liveapp/detail

If you'd like to learn more about Environments, see the Environment Overview.

Great! You've just deployed your first Turbine data app! 🎉

Deploy from a feature branch

You can use feature branches to create test deployments of your Turbine data apps.

The following steps will guide you through how to do this:

  1. Checkout a new feature branch and name it. In the following example, we'll name it this-is-a-test.
$ git checkout -b this-is-a-test
Switched to a new branch 'this-is-a-test'
  1. Make any appropriate changes to your code for your test. Review your code and make sure everything is correct.
warning

We recommend testing with a set of testing resources or at a minimum differentiate your downstream destination or service by renaming the collection or API specifications.

  1. Stage your code changes and commit.
$ git commit -m "Testing"
[this-is-a-test <short-sha>] Testing
1 file changed, 1 insertion(+), 1 deletion(-)
  1. Run the meroxa apps deploy command in the root directory of your Turbine data app. This will start the process of deployment.
meroxa apps deploy

The Meroxa CLI will print out the steps taken and confirm once deployment is successful:

$ meroxa apps deploy
Validating your app.json...
✔ Checked your language is "javascript"
✔ Checked your application name is "liveapp"
✔ Feature branch (this-is-a-test) detected, setting app name to "liveapp-this-is-a-test"...
Checking for uncommitted changes...
✔ No uncommitted changes!
Deploying application "liveapp-this-is-a-test"...
✔ Application built
✔ Can access your Turbine resources
✔ Application processes found. Creating application image...
✔ Platform source fetched
✔ Dockerfile created
✔ "turbine-liveapp-this-is-a-test.tar.gz" successfully created in "/Users/local/path/liveapp"
✔ Source uploaded
✔ Removed "turbine-liveapp-this-is-a-test.tar.gz"
✔ Dockerfile removed
✔ Successfully built process image ("UUID")
✔ Deploy complete
✔ Application "liveapp-this-is-a-test" successfully created!

✨ To view your application visit https://dashboard.meroxa.io/apps/liveapp/detail

Deploy from a feature branch to an Environment

You can use feature branches to create test deployments of your Turbine data apps in Environments.

The following steps will guide you through how to do this:

  1. Checkout a new feature branch and name it. In the following example, we'll name it this-is-a-test.
$ git checkout -b this-is-a-test
Switched to a new branch 'this-is-a-test'
  1. Make any appropriate changes to your code for your test. Review your code and make sure everything is correct.
warning

We recommend testing with a set of testing resources or at a minimum differentiate your downstream destination or service by renaming the collection or API specifications.

  1. Stage your code changes and commit.
$ git commit -m "Testing"
[this-is-a-test <short-sha>] Testing
1 file changed, 1 insertion(+), 1 deletion(-)
  1. Run the meroxa apps deploy command in the root directory of your Turbine data app. This will start the process of deployment.
meroxa apps deploy

The Meroxa CLI will print out the steps taken and confirm once deployment is successful:

$ meroxa apps deploy --env aws
Validating your app.json...
✔ Checked your language is "javascript"
✔ Checked your application name is "liveapp"
✔ Feature branch (this-is-a-test) detected, setting app name to "liveapp-this-is-a-test"...
Checking for uncommitted changes...
✔ No uncommitted changes!
Deploying application "liveapp-this-is-a-test"...
✔ Application built
✔ Can access your Turbine resources
✔ No need to create process image
✔ Application "liveapp-this-is-a-test" successfully created!

✨ To view your application visit https://dashboard.meroxa.io/apps/liveapp/detail

If you'd like to learn more about Environments, see the Environment Overview.

Things to know about deployments from feature branches

The ability to deploy from feature branches is a first step towards enabling continuous development on the Meroxa Platform. Here are things to know about this feature in the current state:

  • There are assumptions we make when it comes to deploying Turbine data apps:
    • Deployments from main are classified as production.
    • Deployments from feature branches other than main or is considered tests.
    • For tests, we identify them apart from production by appending the feature branch name to the end of the application name.
  • We do not yet support updating Turbine data apps. To redeploy, you must first delete the existing data application from Meroxa.
  • We do not check for looping effects across multiple Turbine data apps, resources, and collections. We highly recommend reviewing your Turbine code carefully before you deploy.
  • There is no concept of branch management on Meroxa. This must currently be managed entirely in a local or remote repository.
  • We do not yet support the automatic management of multiple development environments and their resources. However, this is something we plan to improve on.

Deploy help

If you run into any issues, see common errors for examples and remedies or reach out directly to our team by writing in to [email protected].