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.

'Divio app'

1. The Project list

Also shows the running project, if any.

Equivalent command: divio project list

2. Organisation list

Switch between projects lists for multiple organisations.

3. General application controls 'Divio app general controls'

Status, refresh, account settings

4. Divio Shell launcher 'Divio Shell'

See The Divio Shell, below.

5. The local project pane

Controls for managing the local server for your project. Controls and their command-line equivalents:

'Local site controls'
Open a bash shell in the local container
docker-compose exec web /bin/bash
Open the local site
divio project up

6. Actions 'Local site controls'

The Setup menu offers different options for managing the local project as a whole. Controls and their command-line equivalents:

Setup
divio project setup <project slug>
Update
divio project update
Rebuild
docker-compose build web. Note that this only rebuilds the web container. To rebuild all the project’s containers, you will need to run docker-compose build in a terminal.
Reset
docker-compose rm to tear down the project, followed by divio project setup to rebuild it.

7. Files 'Local file controls'

Manage the syncronisation of code, database and media between your local site and the cloud Test server. Each can be downloaded or uploaded. Controls and their command-line equivalents:

Download/Upload
Uses git pull to update the local codebase/git push to update the Cloud project codebase.
Media Download/Upload

divio project pull media db/divio project push media

As soon as the media files are transferred in either direction, they are available - there’s no need to redeploy the cloud server or relaunch the local server.

Database Download/Uploading

divio project pull db/divio project push db

As soon as the database is transferred in either direction, it is available - there’s no need to redeploy the cloud server or relaunch the local server.

8. Run controls 'Local server run controls'

Manage the state of the local server. Controls and their command-line equivalents:

Start
docker-compose up
Stop
docker-compose stop

9. Logs 'Local server logs'

Opens local server logs in a shell. Equivalent command: docker-compose logs -f --tail=100

10. Test server pane 'Test server controls'

The Divio app communicates with the Control Panel to provide basic management of your Test server. Controls and their command-line equivalents:

Open Cloud project Dashboard
divio project dashboard
Open Test site
divio project test

There is also a Deploy Test site button 'Deploy Test server'. This runs: divio project deploy test

11. File synchronisation

(Must be enabled in the Divio app’s settings). When active, synchronises frontend file (HTML templates, CSS and JavaScript) changes between the local and test servers. This may be useful to frontend developers, for quick changes.

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 'Divio Shell' button in the bottom left corner 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