4.0 KiB
AuA24 dev-env
Introduction
This project is the development environment of the AuA24 Dashboard.
It's purpose is to simplify the handling, maintenance and development of docker-enabled applications (systems).
Installation
- Create a .systems file bases on .systems.example:
cp .systems.example .systems - Enter all systems in the created file
nano .systems - Run
./init - Perform initial actions on systems.
This might include...- changing variables in your
.envfiles, adjusting thedocker/docker-compose.ymlif necessary - adding file(s) to the system (e.g. the
weblate.token)
- changing variables in your
./upto start your containers- up will also run all the
bin/script/firstRunscripts, if the.firstRunmarker is missing
- up will also run all the
Usage
After the installation was performed successfully and you've sourced your ~/.profile file, you'll have access to the following utilities
Binaries
denv
Syntax:
denv [script]
- Without a passed script, navigates to the development environment.
- If
scriptis passed, denv will try to execute the specified script in the dev-env base folder.
drun
Syntax:
drun [system-identifier] <command>
- Executes a command on the 'app'-container of a system. (e.g.
backend-appforbackend)- If a system-identifier is passed, the specified command will be executed on the 'app'-container for the passed system-identifier.
- If no system-identifier is passed,
drunwill try to identify the system by the folder you're currently in.
dcom
Syntax:
dcom [system-identifier] <command>
- Executes a
docker composecommand for a specific system- If a
system-identifieris passed, thecommandwill be for thedocker/docker-compose.ymlfile of the passedsystem-identifier.- If no
system-identifieris passed,dcomwill try to identify the system by the folder you're currently in.
Scripts
All these scripts are available in the dev-env base directory.
They may be called by either just executing them in the command line when you're in the dev-env base directory ./script or by using the denv binary from any place: denv script
build
Builds the images, which are used to start up docker containers
- Executes
docker compose buildfor the dev-env- Then executes
dcom <system> buildfor each system
down
Stops all running containers and removes them afterwards.
This may lead to loss of data.
- Executes
docker compose downfor the dev-env- Then executes
dcom <system> downfor each system
info
Displays information about the dev-env
- Full path to the environment
- An overview over all installed systems...
- Identifier
- Path relative to the dev-env
- Currently checked out branch
- An indicator whether there are uncommitted changes on the branch
init
Initializes the development environment.
It should skip unnecessary steps, in case the dev-env is already initialized.
- Creates certificates used by traefik to enable TLS (HTTPS)
- Creates access keys
~/.ssh/personal_bitbucket_access_keyand~/.ssh/bitbucket_access_keyused for connecting a container with git- Updates
.aliasesfile, which enables you to switch between your systems easily viagoto-<system-identifier>- Updates
.profileto use the updated aliases, enables the dev-env binaries (denv,drun,dcom, ...) and add some utility functions- Clones all systems defined in
.systems- Calls the
./bin/script/initscript for each cloned system
prune
Removes all containers and images from docker. This also includes all data saved on databases.
After confirmation...
- Stops all running docker containers
- Remove all containers and images
stop
Stops all running containers.
- Executes
docker compose stopfor the dev-env- Then executes
dcom <system> stopfor each system
up
Starts all running containers.
- Executes
docker compose up -dfor the dev-env- Then executes
dcom <system> up -dfor each system
update
Calls the
bin/script/updatescript for each system