exp-deploy-cli
v1.7.0
Published
An easy way to deploy different environment configurations using Expo & exp CLI
Downloads
7
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-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
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
Using 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.apiUrl
Future Api
exp config
exp deploy
exp releases
exp rollback
Philosophy / Idea
- 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