Coder Social home page Coder Social logo

expo-up's Introduction

expo-up CLI

Description

This is a CLI tool that helps you to upload and rollback your Expo Updates to custom servers using expo-up-server. Set up your own custom server by following the instructions in the expo-up-server package.

Features

  • Upload and Rollback your Expo Updates to custom servers in a single command.

Installation

For NPM users:

npm install -g expo-up

For Yarn users:

yarn global add expo-up

Usage

First, if your Expo project is still using app.json, you need to migrate it to app.config.[js|ts].

Then, you need to add the following code to your app.config.js:

const EXPO_UPDATES_KEY = process.env.EXPO_UPDATES_KEY || "";

module.exports = {
  expo: {
    // ...
    updates: {
      url: "http://<link-to-custom-server>/api/expo-up/manifest",
      enabled: true,
      fallbackToCacheTimeout: 30000,
      requestHeaders: {
        "x-expo-updates-key": EXPO_UPDATES_KEY,
      },
    },
    runtimeVersion: { policy: "appVersion" },
    // ...
  },
};

Replace <link-to-custom-server> with the link to your custom server.

Then, you need to set the EXPO_UPDATES_KEY environment variable in your .env file:

EXPO_UPDATES_KEY=<your-expo-updates-key>

Replace <your-expo-updates-key> with any random string. This key will be used to reference your Expo Updates in the custom server. Generate a random string using the following command:

node -e "console.log(require('crypto').randomBytes(16).toString('hex'))"

This is useful when you have multiple Environments (e.g. Development, Staging, Production) and you want to upload your Expo Updates to different servers.

After setting up, you can run the following command to upload your Expo Updates to the custom server:

expo-up release --platform [android|ios] --token <your-custom-server-auth-token>

Replace [android|ios] with the platform you want to upload the Expo Updates to. Replace <your-custom-server-auth-token> with the auth token of your custom server. Read about how to get your auth token for your custom server using the expo-up-server package. Authorization Token

You can also run the following command to rollback your Expo Updates to the custom server:

# Rollback to the previous release
expo-up rollback --platform [android|ios] --token <your-custom-server-auth-token>
# Rollback to embedded release
expo-up rollback --platform [android|ios] --token <your-custom-server-auth-token> --embedded
# Release a new update
expo-up release --platform [android|ios] --token <your-custom-server-auth-token>

# Rollback to the previous release
expo-up rollback --platform [android|ios] --token <your-custom-server-auth-token>

# Rollback to embedded release
expo-up rollback --platform [android|ios] --token <your-custom-server-auth-token> --embedded

Multiple Environments

If you have multiple Environments (e.g. Development, Staging, Production), create one key for each Environment and set the EXPO_UPDATES_KEY environment variable in your .env file:

Roadmap

  • Unit Tests

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

If you have any questions, please feel free open an issue.

expo-up's People

Contributors

glncy avatar

Stargazers

Sebastian Ciobanu avatar Montlouis-Calixte Stéphane avatar Amine Bezzarga avatar  avatar Anday avatar Efstathios Ntonas avatar Phạm Ngọc Thạch avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.