Electrode Native
v0.41
v0.41
  • Introduction
  • INTRODUCTION
    • Overview
      • What is Electrode Native
      • Why use Electrode Native
      • What is a MiniApp
      • Electrode Native workflow
      • Native dependencies management
      • JS/Native communication
      • Requirements
      • Upgrading Electrode Native
      • Contributing
  • REFERENCE
    • Bundle Store
    • Composite
    • Container
      • What's inside
      • Publication
      • Integration
      • Initialization
      • Launching MiniApps
    • Cauldron
      • Structure
      • Setup
      • Compatibility checks
      • Guidelines
    • Manifest
      • Override
      • Native Modules
      • Configurable Modules
    • Runner
    • APIs
      • Project Generation
      • Implementation
      • Versioning
      • Guidelines
    • Bridge
      • Message Types
      • Communication
      • Leveraging APIs
    • CLI
      • Global CLI
      • Local CLI
    • GLOSSARY
  • GUIDES
    • Debugging multiple MiniApps
  • CLI COMMANDS
    • add
    • bundlestore
      • create
      • delete
      • upload
      • use
    • binarystore
      • add
      • get
      • remove
    • code-push
      • patch
      • release
      • promote
    • compat-check
    • create-api-impl
    • create-api
    • create-composite
    • create-container
    • create-plugin-config
    • publish-container
    • transform-container
    • create-miniapp
    • link
    • regen-api
    • regen-api-impl
    • run-android
    • run-ios
    • start
    • unlink
    • upgrade-miniapp
    • cauldron add
      • file
      • jsapiimpls
      • miniapps
      • nativeapp
    • cauldron config
      • get
    • cauldron del
      • file
      • jsapiimpls
      • miniapps
      • nativeapp
    • cauldron get
      • config
      • dependency
      • nativeapp
    • cauldron repo
      • add
      • clear
      • current
      • list
      • remove
      • use
    • cauldron update
      • file
      • jsapiimpls
      • miniapps
      • nativeapp
    • cauldron batch
    • cauldron regen-container
    • cauldron upgrade
    • cauldron why
    • github
      • github create-ref
      • github delete-ref
      • github align-dependencies
    • platform
      • plugins
        • list
        • search
      • config
        • set
        • get
        • del
        • list
      • install
      • versions
      • uninstall
      • use
Powered by GitBook
On this page
  • Prerequisites
  • Usage
  1. CLI COMMANDS

github

Previouscauldron whyNextgithub create-ref

Last updated 4 years ago

Prerequisites

  • ERN_GITHUB_TOKEN environment variable must be set. This is a Personal Access Token, generated from GitHub, having read/write access to the different repositories.

  • If you are not using github.com but your own GitHub enterprise server, the API url should be set in cauldron github configuration as baseUrl. If your repositories are in github.com, nothing needs to be done.

{
  "github": {
    "baseUrl": "https://company-github-host/api/v3"
  }
}

Usage

The github commands can be used to automate some advanced custom development/release workflows when working with MiniApps / JS API Implementations that are handled as GitHub urls in the Cauldron rather than NPM published versions.

For example, in an hypothetical development workflow for MyAwesomeApp Android you might use dummy version 1000.0.0 in your Cauldron, with all MiniApps tracking the development branch. Then to regenerate a new development Container, you would just invoke container, which would pull the latest from the development branches, generate and publish a new Container and update the SHAs in the Cauldron.

Let's assume there are three tracked MiniApps fro version 1000.0.0, this would result in the following entry in the Cauldron (excluding some data):

{
  "name": "1000.0.0",
  "container": {
    "miniApps": [
      "git+ssh://git@github.com/foo/MiniAppA.git#346f8f185f4bfc5de0c694918e131eec1847dab0",
      "git+ssh://git@github.com/foo/MiniAppB.git#d4ced142494b7f02c9038c805ca13229d2e32415",
      "git+ssh://git@github.com/foo/MiniAppC.git#ec1a90be810e1dc6668f5a7c2ec25e3302799cdd"
    ],
    "miniAppsBranches": [
      "git+ssh://git@github.com/foo/MiniAppA.git#development",
      "git+ssh://git@github.com/foo/MiniAppB.git#development",
      "git+ssh://git@github.com/foo/MiniAppC.git#development"
    ]
  }
}

Your mobile application release workflow might include a code-freeze, where release branches are cut for all MiniApps. For example, assuming you are preparing release of version 1.0.0 of your mobile application, what could be done is the following :

This would result in the following entry in Cauldron:

{
  "name": "1.0.0",
  "container": {
    "miniApps": [
      "git+ssh://git@github.com/foo/MiniAppA.git#346f8f185f4bfc5de0c694918e131eec1847dab0",
      "git+ssh://git@github.com/foo/MiniAppB.git#d4ced142494b7f02c9038c805ca13229d2e32415",
      "git+ssh://git@github.com/foo/MiniAppC.git#ec1a90be810e1dc6668f5a7c2ec25e3302799cdd"
    ],
    "miniAppsBranches": [
      "git+ssh://git@github.com/foo/MiniAppA.git#Release/1.0.0",
      "git+ssh://git@github.com/foo/MiniAppB.git#Release/1.0.0",
      "git+ssh://git@github.com/foo/MiniAppC.git#Release/1.0.0"
    ]
  }
}

At release time (when 1.0.0 is released to the store) you might want to create tags in the MiniApps repositories, to exactly know what was shipped for each MiniApps.

{
  "name": "1.0.0",
  "container": {
    "miniApps": [
      "git+ssh://git@github.com/foo/MiniAppA.git#RELEASE_1.0.0",
      "git+ssh://git@github.com/foo/MiniAppB.git#RELEASE_1.0.0",
      "git+ssh://git@github.com/foo/MiniAppC.git#RELEASE_1.0.0"
    ],
    "miniAppsBranches": [
    ]
  }
}

Create new application version MyAwesomeApp:android:1.0.0 in Cauldron using command, copying data over from 1000.0.0 version.

Create new Release/1.0.0 branches in all MiniApps repositories, using the command.

Update MyAwesomeApp:android:1.0.0 MiniApps in the Cauldron, to track this new Release/1.0.0 branch rather than development, using the command.

Then it's possible to regenerate post freeze Containers for 1.0.0, by just using command for 1.0.0. As long as MiniApp developers are pushing post code freeze bug fixes to the Release/1.0.0 of the MiniApps branches. Developers can continue pushing changes to their development branch to continue generating development Containers for the next release.

One way to do that is to just use the command, this time to create tags (RELEASE_1.0.0 for example), from the current SHAs stored for the MiniApps, and then use command to update the Cauldron. This would result in the following entry in Cauldron:

ern cauldron regen-container
ern cauldron add nativeapp
ern github create-ref
ern cauldron update miniapps
ern cauldron regen-container
ern github create-ref
ern cauldron update miniapps