This application is distributed as a Python (Pip) package.
Continuous Deployment will build the package and publish it to the project Package Registry 🛡️ automatically.
Tip
The package can be built manually by running the build Development Task.
This application is deployed as a custom Environment Module on the BAS central workstations for running the application CLI.
The module:
- adds the control CLI to the
$PATHfrom the Python Packagebin/directory - sets Configuration Options
Separate modules (and corresponding virtual environments) are created for each project Release automatically by the Ansible Playbook.
This application is deployed using an Ansible Playbook 🛡️ as part of the BAS IT Ansible 🛡️ project.
The playbook:
- creates a Python virtual environment containing the Python Package for the app version
- generates an Environment Module for the app version
- runs Database Migrations via the control CLI
- configures cron jobs for Scheduled Tasks
The playbook is run automatically via Continuous Deployment.
The playbook can be run manually with these General Instructions and context:
- environment:
stagingorproduction - app:
magic/assets-tracking-service - additional variables:
app_version=1.2.3
Tagged commits created for Releases will trigger a continuous deployment workflow for the release
to the production environment using GitLab's CI/CD configured in .gitlab-ci.yml.
Pre-releases can optionally be deployed to the staging environment by triggering the relevant CI job manually.
Deploy:
$ scp resources/scripts/clean-venvs.py geoweb@bslws01.nerc-bas.ac.uk:/users/geoweb/bin/clean-ats-venvs.py
Run:
% ssh geoweb@bslws01.nerc-bas.ac.uk
$ /data/magic/.conda/envs/python311/bin/python bin/clean-ats-venvs.py