exp-deploy-cli
v1.7.0
Published
An easy way to deploy different environment configurations using Expo & exp CLI
Downloads
3
Maintainers
Readme
exp-deploy-cli
Expo Release Channels
Expo just released (11/17/2017) beta support for Release Channels
We strongly recommend moving forward with Expo's official supported implementation!
About
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
Instructions
exp-deployrequires aconfigfolder with a copy ofapp.json. Create the following:config/exp-development.jsonconfig/exp-production.json
- If you'd like to store environment variables, create a
configobject next toexpowithinapp.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 --productionwill now do the following:- copy
config/exp-production.jsonover intoapp.json - run
exp publish - reset app.json to its previous state
- copy
yarn global add exp-deploy-clinpm install -g exp-deploy-cliUsage
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 stagingUsing Config Variables in your app
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.apiUrlFuture Api
exp configexp deployexp releasesexp rollback
Philosophy / Idea
- exp doesn't support dev. vs prod environments so lets try and make it work on our own
- create a
configfolder and placeexp-development.jsonandexp-production.json - within your
app.jsoncreate aconfigobject to store your api keys, etc. in - run
exp-deploy configwhich will:- run interactive shell
- check for
configfolder. If doesn't exist, create it - copy over
app.jsonintoexp-development.jsonandexp-production.json - ask user for any specific api keys they would like to separate
- run
exp-deploy --productionwhich 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.jsonfile
- run
exp-deploy releaseswhich will:- look up
releases.jsonwith every released version- ties in git tag / release to what's been deployed
- look up
- run
exp-deploy rollbackwhich will:- look into
releases.jsonand 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
