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. Otherwise, you may run into an error.

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 project folder 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 app deploy command in the project folder root of your Turbine data app. This will start the process of deployment. The Meroxa CLI will print out the steps taken and confirm once deployment is successful.

$ meroxa app 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 visualize your application visit https://dashboard.meroxa.io/apps/UUID/detail

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

Deploy using feature branches

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 app deploy command in the project folder root of your Turbine data app. This will start the process of deployment. The Meroxa CLI will print out the steps taken and confirm once deployment is successful.
$ meroxa app 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 visualize your application visit https://dashboard.meroxa.io/apps/UUID/detail

Things to know about feature branch deployments

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 applications:
    • 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 applications. To redeploy, you must first delete the existing data application from Meroxa.
  • We do not check for looping effects across multiple data applications, 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.

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].