The Divio application

The Divio app is a GUI application for interacting with local projects and the Divio Cloud. It also sets up the Divio Shell.

Controls

Most of the controls in the Divio app correspond to Divio CLI or docker-compose commands.

Project list

The Divio application opens with a list of the projects available to you.

'Divio app'

Select from All projects, or the projects in your Personal/Organisation views. You can also filter projects by name using the search field. The equivalent command is divio project list.

Select a project to see its status in your local environment.

Toolbar controls

The toolbar at the bottom of the application interface is always available and provides some useful controls:

'Divio app Shell launcher Help and settings'

Open shell will open a shell environment, running in Docker itself, with your keys and access to projects set up automatically.

The other icons give you:

  • Docker status
  • help options
  • Divio application preferences

Setting up a project

When you select a project for the first time, you will be given the option to set it up.

'Project setup'

When you select Set up project, the Divio application will clone the project’s repository to the directory specified in the the application’s preferences, build it, and finally pull down its media and database. While it does this, it will also display the local build log.

'Project setup process'

The command-line equivalent is divio project setup <project slug>; the process is described in more detail in the project build process. The process can take a few minutes.

Once successfully set up, the application will show more information and options for managing the project.

'Divio app Dashboard launcher'

Managing a project

Project list/open Dashboard

'Divio app Dashboard launcher'

Return to list of projects; open the project Dashboard in the Control Panel (equivalent to divio project dashboard).

Download/upload

'Divio app database and media controls'

Download and Upload controls for:

  • code (equivalent: using git commands to interact with the repository)
  • media (equivalent: using divio project push media and divio project push media commands)
  • database (equivalent: using divio project push db and divio project push db commands)

Open local files

'Divio app open project directory'

Open the local project directory for access to the files.

Start/stop

'Divio app open project directory'

Start to launch the local project (or Stop if it is already running).

Options when running

The other options are only available when the project is running locally:

'Divio app options when running'

Respectively, they will:

  • open the local site in your browser
  • open a console displaying the site runtime logs in a Divio shell; equivalent to docker-compose logs -f --tail=100
  • open a shell inside the local site’s web container; equivalent to docker-compose exec web /bin/bash
  • present additional options for managing the Docker build:
    • Update - equivalent to divio project update (pulls latest Git commits, rebuilds)
    • Rebuild - equivalent to docker-compose build web
    • Reset - equivalent to docker-compose rm to tear down the project, followed by divio project setup to rebuild it.

First run

When first run, the Divio app will:

  • download Docker
  • install Docker
  • launch it
  • set up a local Docker image that provides a Bash shell interface for issuing divio commands, even if the Divio CLI has not been installed globally

The Divio Shell

The Divio Shell is a pre-configured shell environment for interacting with local Divio projects. It’s launched with the open shell button in the toolbar of the Divio app, and drops you in a bash prompt, in your Divio Cloud workspace directory.

The Divio Shell is configured with the SSH keys required to give you access to our Cloud servers. You don’t have to use the Divio Shell (you can use an ordinary session in your terminal) but in that case you will need to set up keys yourself.

Important

The Divio Shell and the local container’s bash shell are quite different.

  • The Divio Shell is for interacting with your Divio projects.
  • The local container bash shell is inside an instance of a particular project, allowing you to interact with its program code and operations.

Creating the Divio shell

The Divio app creates the shell by running a sequence of commands, expanded here for clarification:

# clear the terminal window
clear
# set the path for this shell
PATH=$HOME/.local/bin:/usr/local/bin:$PATH
# clears the DOCKER_HOST environment variable, in case something else has set it
unset DOCKER_HOST
# runs a docker command in a new container, with interactive TTY access, removing it on exit
docker run -it --rm \
    # ... mounting  these volumes in the container:
    -v '/var/run/docker.sock:/var/run/docker.sock:rw' \
    -v '/Users/daniele/.netrc:/home/divio/.netrc:rw' \
    -v '/Users/daniele/.aldryn:/home/divio/.aldryn:rw' \
    -v '/Users/daniele/divio-cloud-projects:/Users/daniele/divio-cloud-projects:rw'
    # ... using the image:
    divio/divio-app-toolbox:daniele-0.10.5-daniele.procida_divio.ch
    # ... and in the new container, run the following commands:
    cd /Users/daniele/divio-cloud-projects
    divio doctor
    bash