Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Build the Docker image:

    Code Block
    languagebash
    $ cd appctest
    $ docker build -t appctestimage .
    # Double check the image presents locally
    $ docker images |grep appctestimage
    appctestimage               latest              869918dab71b        43 minutes ago      277 MB
  2. Next, publish the image directly. Ensure that you provide the app version and name and image name by using the --app-versionappname, and --image flags:

    Code Block
    languagebash
    $ cd appctest
    $ appc publish --app-version 1.0.0 --image appctestimage appctest
  3. If you need to scale up the number of servers, execute these commands:

    Code Block
    languagebash
    # Set maximum number of containers allowed for appctest
    $ appc cloud config appctest --maxsize <size>
    # Set current number of containers for appctest as long as the cluster has enough resource)
    $ appc cloud config appcteest --minsize <size>

...

  1. Note

    If you haven't set up your DNS yet, your app publish may fail with the following error:

    Code Block
    languagebash
    $ appc cloud logcat appctest
    ...
    Uncaught Exception Error loading connector/appc.arrowdb. Error: getaddrinfo ENOTFOUND api.cloudapp-1.appctest.com api.cloudapp-1.appctest.com:443
    2017-04-03T16:24:39-07:00 | Error: Error loading connector/appc.arrowdb. Error: getaddrinfo ENOTFOUND api.cloudapp-1.appctest.com api.cloudapp-1.appctest.com:443
    ...

    In this case, you will need to execute the following command to configure the custom host info in the app container. Please note if you try to update /etc/hosts file in the Dockerfile with the custom hostname and IP. It will not work because the Docker swarm mode will override that information at the time of the container launch.

    Code Block
    languagebash
    $ appc cloud config --set "extra_hosts=54.212.208.81 api.cloudapp-1.appctest.com"
    Appcelerator Command-Line Interface, version 7.0.0
    Copyright (c) 2014-2017, Appcelerator, Inc.  All Rights Reserved.
    Admin Hostname: https://admin.cloudapp-1.appctest.com
    The variable has been saved successfully.
     
    # Confirm the env is set correctly
    $ appc cloud config --env appctest
    Appcelerator Command-Line Interface, version 7.0.0
    Copyright (c) 2014-2017, Appcelerator, Inc.  All Rights Reserved.
    Admin Hostname: https://admin.cloudapp-1.appctest.com
    extra_hosts = 54.212.208.81 api.cloudapp-1.appctest.com
    Note

    Note about Docker image publish with Alpine: You will need to execute apk add --no-cache curl in the Docker file when publishing the Docker image.

 

CLI commands

CommandDescription

appc login

Login

appc config set defaultEnvironment preproduction

Selection of an environment (optional, if the default needs to be switched).

appc new

Create an app.

appc publish

Publish the app.

appc cloud list

Query the list of applications that are deployed to my current environment and dashboard.

appc cloud list <appname>

Query the config for a specific application that is deployed to the currently referenced environment and dashboard.

appc cloud config --maxsize 4 <appname>

Configuration for a given application: change the maximum number of containers.

appc cloud config —minsize 2 <appname>

Configuration for a given application: change the minimum number of containers.

appc cloud server <appname> —set <value>

Change the size of the given application. Accepted values include Dev, Small, Medium, Large, and XLarge.

appc cloud logcat

View logs of the application.
appc cloud loglist —build_logs View logs of the application.
appc cloud accesslogList application's access log.
appc cloud addAdd a new route or service.
appc cloud cnameSet a CNAME for an application.
appc cloud configConfigure the application.
appc cloud crtManage SSL certificates for the application.
 appc cloud download

Download source files for the specified application and version. Note: If you publish using a Docker image, this command won't work.

appc logoutLog out
appc removeRemoves installed Appcelerator CLI.
appc runRun an application locally for dev. and/or testing.
appc unpublishUnpublish an application.
appc cloud whoamiShow current login user.