We strongly recommend moving forward with Expo's official supported implementation!
Right now Expo doesn't support different deploy environments like staging and production. This is a simple tool to help mimic that environment by creating a copy of your app.json
and adding a suffix to stuff like name and slug.
Expo is working on supporting their own deployment environments. As soon as its released I'll update the repo to take you there instead
Orchard uses this on an daily basis to deploy their different environments
exp-deploy
requires aconfig
folder with a copy ofapp.json
. Create the following:config/exp-development.json
config/exp-production.json
- If you'd like to store environment variables, create a
config
object next toexpo
withinapp.json
:"config": { "apiUrl": "https://api.mysite.com", "sentryApiKey": "xyz" }, "expo": { "name": "MyAppName", "privacy": "unlisted", "slug": "my-app-name", "sdkVersion": "1.0.0", "scheme": "my-app-name", "version": "1.0.0", }
- Running
exp-deploy --production
will now do the following:- copy
config/exp-production.json
over intoapp.json
- run
exp publish
- reset app.json to its previous state
- copy
yarn global add exp-deploy-cli
npm install -g exp-deploy-cli
Usage: exp-deploy [command]
Commands:
config Initial Config Setup
Options:
--help Show help [boolean]
Examples:
exp-deploy config
exp-deploy --env production
exp-deploy --env staging
Since Expo doesn't give you access to Config via Constants.manifest
, you can import the json file directly:
import App from './app.json'
const API_URL = App.config.apiUrl
exp config
exp deploy
exp releases
exp rollback
- exp doesn't support dev. vs prod environments so lets try and make it work on our own
- create a
config
folder and placeexp-development.json
andexp-production.json
- within your
app.json
create aconfig
object to store your api keys, etc. in - run
exp-deploy config
which will:- run interactive shell
- check for
config
folder. If doesn't exist, create it - copy over
app.json
intoexp-development.json
andexp-production.json
- ask user for any specific api keys they would like to separate
- run
exp-deploy --production
which will:- check whether config/exp-production.json exists
- copy it over into your main app.json
- bumps the version number (or npm version patch) by default
- save the version number, commit it including creating a tag
- save the release into a
releases.json
file
- run
exp-deploy releases
which will:- look up
releases.json
with every released version- ties in git tag / release to what's been deployed
- look up
- run
exp-deploy rollback
which will:- look into
releases.json
and asks you interactively to choose a version to roll back to - will check out the git tag and roll back your deploy to that specific version
- look into