TODO: steps missing for deploy to production server
TODO: steps missing for deploy to production server
Notes + Examples
This page is a living document. will change over time
Less polished than the other wiki pages.
To see missing items (ToDo items) at a glance, check items marked with a dashed line ("---") in build-pipeline visualization . For background info, read Details ICDP Internal
Build Pipeline Links
ToDo: Outside container, creating images
- Describe how to build an image with a
Dockerfile. - Describe how to
docker commitan image, e.g.mdis-swais2c, from a running container, e.g.mdis-swais2c_1, push it to a registry, and pull it to a different server host.
ICDP INTERNAL
Intranet/VPN only
Staging environment, example: samp23-mdis on wb31.
Inspect new mDIS instances on wb31.gfz.de , icdp-osg/GFZ Section 4.2 private network.
First look. URLs and instance names might change in the future.
Example for a "Code Coverage Report" (indicates how "complete" the test-program runs are):
'Dashboard' of CI/CD Job 200811. - might be offline after Gitlab's retention period of 30(?) days.
ToDo: Outside container, on Production server host
On production server host (data.icdp-online.org), check reverse proxy configuration, e.g.
/etc/apache2/sites-available/000-default.confDouble-check the values in the
.env-mysqlfile referenced indocker-compose.my-instance.ymland change them if necessary (if password not strong enough, ...).Make sure
/var/www/mdis(not/var/www/dis) is referenced as a persistent Docker Volume indocker-compose.my-instance.yml.perl -pi -E "s#/var/www/dis#/var/www/mdis#" docker-compose.my-instance.yml
ToDo: Inside a newly installed mDIS instance
Enter a running container with docker exec -it containername bash to get shell access. Once "inside" that running container, change the following:
Find all subdirectories in backend/ except vendor/,
assign to www-data user and mdis group
sudo find web backend src -type d -not -path "backend/vendor/*" \
-exec chown www-data:mdis {} \; -exec chmod 2775 {} \;
Be careful to change ownership and permissions back to www-data after performing git operations.
replace MYSQL_HOST=wb31.* with MYSQL_HOST=mdis_db_1 in .env file
sed -i 's/MYSQL_HOST=wb31.*/MYSQL_HOST=mdis_db_1/' .env
replace Host placeholder \h in file .bash_it/themes/bobby.theme with instance name, e.g. "mdis-swais2c"
sed -i 's/\\h/mdis-swais2c/' ~/.bash_it/themes/bobby/bobby.theme.bash
Logout and login again to see the change.
Inside container, sites-available/000-default.conf, change /app/web to /var/www/mdis/web
sudo sed -i 's#/app/web#/var/www/mdis/web#' /etc/apache2/sites-available/000-default.conf
sudo apachectl restart
create a new branch, such that you can later pull from remote to master/main without conflicts; then switch to the new branch, rebasing on master/main
git switch -c mdis-swais2c
add lots of our own well-liked aliases and config to (.gitconfig)
cat /app/.gitconfig >> ~/.gitconfig
add some missing to .gitignore, e.g. build artifacts/files from JS Workbox library
git ignore "web/workbox*"
Weird, advanced, hacky stuff
- Replace
Config.phpwith fixed version, PHP8.1 compatible (/app/mdis-swais2c/Config.php) - Avoid PHP 8.1 deprecation warnings and notifications
- In files where runtime error/warning message
argument null deprecatedappears , add?? ""to the function call - Develop Selenium GUI tests for all mDIS forms: insert at least 1 record, and check that it is displayed , that both top and bottom panels are clickable.
################################################################
GUI-App basteln welche die Konfguration von mDIS instanzen ermöglicht
Docker Details: (Namenskonvention Network, Volumes für Persistenz: mDIS Volume, /app Shared folder)
- Virtualbox instances bauen mit gitlab-runner
- Erfahrungen mit Terraform deployment, Ansible
- Testscripts und Code-Coverage Reports erweitern
- Flyway: Datenbank-Schema changes tracken
To do: write something about
- Code Conventions
- TBC
- Testing Conventions
- Testing tool for PHP backend: Codeception. Example report: (coming soon).
- Testing tool for JavaScript Frontend: Jest. Example Report: (coming soon).
- Testing tool for API requests and integration tests: Postman.
- This is not set in stone, who wants to use another tool, can do so.
- Branching Conventions
- Details TBC
- Commit Message Conventions
- Steps for creating a good merge requests, feature requests, issues, bug reports
- Submit these to the Bremen mDIS repo, not here, given that you have a login there.