Experience Builder DevOps: Generating the App Export ZIP from the Terminal

3794
5
10-28-2021 01:43 PM
GavinRehkemper
Esri Contributor
14 5 3,794

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');"

 

 

 

5 Comments
About the Author
I am a geospatial developer working for Esri Professional Services. https://gavinr.com ... see my Codepens: https://codepen.io/gavinr