This how-to guide assumes you already completed the steps described in the 5-minute getting started experience. To test that the Nextmv CLI is correctly configured, you can optionally run the following command on your terminal. It will get some files that are necessary to work with the Nextmv Platform. You can see the expected output as well.
To deploy an application with Nextmv Cloud, we'll start with a template.
For this example, we'll use the routing app. Initiate a new template and then navigate into the new directory.
Creating an Application
You are now ready to start using applications. An application is hosted by Nextmv and gets run in Nextmv Cloud. You'll first
create the application. You must provide an id and name, and can optionally provide a description.
Copynextmv app create \ --app-id 'pizza-delivery' \ --name 'Pizza Delivery' \ --description 'My pizza delivery app'
You can now see the application by running the
Running an Application
Once an app is created, you'll need to
push the app that you want to run to the cloud. When you
push an application, you update the application's latest binary with the binary from your local project. To update the working cloud binary run the following command:
Once this completes successfully you can go ahead and
run the application on the cloud platform.
When you append the
--wait flag, the cli will continue to poll until the run is complete.
Promoting an Application
When your app is at a point that you want to use it for a more formal case, like running with production, you can
promote a version of the app to generate an instance you can refer to when performing a run.
Copynextmv app promote \ --app-id 'pizza-delivery' \ --name 'Prod version' \ --description 'my first prod version'
To see a list of promoted versions of your app, run the following command:
You can now run that specific version by running the
default flag. Only the default instance is supported in this release. Note: if you perform a run using the REST endpoint, and do not specify a version, then the default instance will be used.
Copynextmv app run \ --app-id 'pizza-delivery' \ --input './input.json' \ --default \ --wait
If you don't wish to
--wait, you’ll receive the
run id for your run. You'd now have a unique cloud native endpoint and can use the
result command to retrieve the results of your run.
get your application, you’ll see that it now has a default instance id set. Here is an example:
If you make a change and push a new update the default version will not be affected. If you want to run the working app you will simply execute
run without the
--default flag. If you promote again, another version is created, and the default instance is updated to that recently promoted version.