As of 3/20/2024, this documentation has been moved to the official Experience Builder Developers documentation:
https://developers.arcgis.com/experience-builder/guide/deployment-topics/#automated-deployments
Please refer there for the latest updates. This post will not be updated.
---
If you’re using Experience Builder in a DevOps workflow, you may need the ability to generate the app ZIP export from a terminal without having the Experience Builder server running. There’s now a way to do this with developer edition of Experience Builder version 1.6 (released last week).
In the terminal, browse to the extracted root directory of your Experience Builder developer edition install (the directory that contains the “client” and “server” folders). Then run the following command, replacing the ‘0’ with the ID of the app that you’d like to export, and the ‘app.zip’ with the name of the ZIP file you’d like it to generate.
node -e "require('./server/src/middlewares/dev/apps/app-download.js').zipApp('0', 'app.zip');"
The ZIP will be generated and placed in the current working directory.
An example of using this command in a GitHub Actions dev-ops workflow can be found in this GitHub repository: https://github.com/gavinr/experience-builder-devops-example. Specifically, see the file build-app.yml to see app-download.js being used to generate the ZIP export. This GitHub action builds and deploys the Experience every time a commit is made to the repository – completely automatically!
---
Update: In developer edition of Experience Builder v1.7 (released January 2022), you can now include the Client ID that you'd like to be included in the config.json of the output app. For example,
node -e "require('./server/src/middlewares/dev/apps/app-download.js').zipApp('0', 'app.zip', 'my_client_id');"