- Stitch >
- Application Deployment >
- Deploy App Changes
Deploy Changes with Stitch CLI¶
On this page
Overview¶
You can deploy changes to your Stitch app with Stitch CLI by importing an application directory with configuration files that define the updated app.
Prerequisites¶
- MongoDB Atlas programmatic API Key.
- A properly installed copy of
stitch-cli
that has been added to your systemPATH
.
Procedure¶
Prepare the Application Directory¶
Export your application to a local
application directory. Alternatively, create a new application
directory that contains a stitch.json
file with your application’s app_id
.
Add or Update Application Entities¶
Add sub-directories and configuration files for any new entities you’re importing, or update the values in existing entity files. All configuration files must conform to the Application File Schema.
Authenticate a MongoDB Atlas User¶
To import or update a MongoDB Stitch application with stitch-cli
, users
must authenticate with Atlas using an API Key.
Run the Import Command¶
Use the stitch-cli
import to deploy
your changes:
Import Strategy
The --strategy
flag indicates how you want Stitch to handle
configuration files that are missing or duplicated compared to the
currently deployed version of your application. For more
information, see import strategies.
If you want to upload static assets to Stitch Hosting, include the static assets in the
/hosting/files
directory and specify the
--include-hosting
option:
If you want to upload external dependencies, include your archived
node_modules
in the /functions
directory and specify the
--include-dependencies
option:
Review and Confirm Import Diff¶
Before committing the import, stitch-cli
will show you a diff of
the changes that will be made to your application. Review the diff to
ensure that all changes are correct then confirm the import.
After successfully importing your application, Stitch will automatically deploy a new version of your app and update your local application directory to match the new deployment.