The Divio application¶
The Divio app is a GUI application for interacting with local projects andthe Divio Cloud. It also sets up the Divio Shell.
Controls¶
Most of the controls in the Divio app correspond to Divio CLI ordocker-compose commands.
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 ¶
Status, refresh, account settings
4. Divio Shell launcher ¶
See The Divio Shell, below.
5. The local project pane¶
Controls for managing the local server for your project. Controls and theircommand-line equivalents:
- Open a bash shell in the local container
docker-compose exec web /bin/bash
- Open the local site
divio project up
6. Actions ¶
The Setup menu offers different options for managing the local project as awhole. 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 webcontainer. To rebuild all the project’s containers, you will need to rundocker-compose build
in a terminal.- Reset
docker-compose rm
to tear down the project, followed bydivio project
to rebuild it.
setup
7. Files ¶
Manage the syncronisation of code, database and media between your local siteand the cloud Test server. Each can be downloaded or uploaded. Controls andtheir command-line equivalents:
- Download/Upload
- Uses
git pull
to update the local codebase/git push
to update the Cloud projectcodebase. - Media Download/Upload
divio project pull media db
/divio project push media
As soon as the media files are transferred in either direction, they areavailable - there’s no need to redeploy the cloud server or relaunch thelocal 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 ¶
Manage the state of the local server. Controls and their command-lineequivalents:
- Start
docker-compose up
- Stop
docker-compose stop
9. Logs ¶
Opens local server logs in a shell. Equivalent command: docker-compose logs
-f —tail=100
10. Test server pane ¶
The Divio app communicates with the Control Panel to provide basic managementof 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 . This runs:
divio project deploy test
11. File synchronisation¶
(Must be enabled in the Divio app’s settings). When active, synchronisesfrontend file (HTML templates, CSS and JavaScript) changes between the localand 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 issuingdivio 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 withlocal Divio projects. It’s launched with the button in the bottomleft corner of the Divio app, and drops you in a bash prompt, in your DivioCloud workspace directory.
The Divio Shell is configured with the SSH keys required to give you access toour Cloud servers. You don’t have to use the Divio Shell (you can use anordinary session in your terminal) but in that case you will need to setup 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 particularproject, 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, expandedhere 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
原文: http://docs.divio.com/en/latest/reference/divio-app.html