Skip to content

Instantly share code, notes, and snippets.

@craicoverflow
Last active July 30, 2019 08:14
Show Gist options
  • Select an option

  • Save craicoverflow/a2f72dff58caba16c245b36a482010c3 to your computer and use it in GitHub Desktop.

Select an option

Save craicoverflow/a2f72dff58caba16c245b36a482010c3 to your computer and use it in GitHub Desktop.
A list of useful commands to get Mobile Developer Console installed

MDC Cheatsheet

aerogear/mobile-developer-console

Development

Use the dedicated script to start Minishift. This enables CORS gives the developer user cluster-admin privileges.

Setup

Minishift

./scripts/minishift_start.sh

Set up the cluster:

./scripts/prepare.sh

Remote OpenShift cluster

Login to remote cluster as a user with cluster-admin privileges:

oc login <openshift-url>

Set up the cluster:

./scripts/prepare.sh

Starting the Mobile Developer Console

Server:

OPENSHIFT_HOST=https://$(minishift ip):8443 OPENSHIFT_USER_TOKEN=$(oc whoami -t) npm run start:server

Client:

npm run start:client

Alternatively, when using Minishift you can use the development script to start the server and client together:

./scripts/development.sh

Note: The development script detaches the server process before starting the client. Since the client can be quite slow to start initially, using the development script can be slow if you need to restart the server.

Debugging with VS Code

If you use Visual Studio Code, you can use the following configuration to debug the MDC server and client. I use Firefox so this configuration would need to be adjusted if you want to use Chrome/others.

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "firefox",
            "request": "attach",
            "name": "Client"
        },
        {
            "type": "node",
            "request": "attach",
            "name": "Server",
            "processId": "${command:PickProcess}"
        },
    ],
    "compounds": [
        {
            "name": "Server/Client",
            "configurations": ["Server", "Client"]
        }
    ]
}

Installing Mobile Service operators

There are currently 4 available mobile services in MDC. Two of these, aerogear/unifiedpush-operator and aerogear/mobile-security-service-operator can be installed using operators.

I have created a install-mobile-services.sh which you can use to install these services automatically.

Unified Push Operator

aerogear/unifiedpush-operator

Mobile Security Service Operator

aerogear/mobile-security-service-operator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment