Custom development
- MyBatis
- Jetty
- Jersey
- Junit
- Flyway
- Google Guice
- Docker, Docker compose
mvn versions:set -DnewVersion= < version >
- Mysql Engine: 8.0.28
every push to main branch a github workflow gets executed and performs deployment to ECS
just run the local-provision.sh file
docker compose will crate following containers:
- mysql:8.0.28: cc-service-db
- flyway:6.5.5: cc-service-flyway
- app: cc-service
Some useful commands to troubleshoot:
docker compose up --no-recreatedocker compose restart <service>
To create a copy of db data
mysqldump -h ${CC_SERVICE_DB_HOST} -u admin --extended-insert \
--ignore-table=catalog_count.flyway_schema_history \
--ignore-table=catalog_count.catalog_count_enum \
--ignore-table=catalog_count.timezone_type \
--no-create-db --no-create-info --compact \
--password=${MYSQL_ROOT_PASS} \
--single-transaction --set-gtid-purged=OFF \
catalog_count > backup.sql"this is the one!"
mysqldump -h ${CC_SERVICE_DB_HOST} -u admin \
--password=${MYSQL_ROOT_PASS} \
--single-transaction --set-gtid-purged=OFF --routines \
catalog_count > backup.sqlnote: this is to create a complete backup, everything. which means, first time restoring a db, it should be empty. no flyway commands should run prior recovering db. cp to docker container:
docker cp backup_08162025.sql cc-service-db:/
To import the copy to a db
mysql -u root -p catalog_count < backup_08162025.sqlManual process to "update" previous month's movements
- get last month's movements in excel_sheet file - consider format
- POST /cc-service/api/v1/excelimport
-
{ "personProfileId": "c70d4cfe-0f68-482d-8e82-5952fadba5e4", "fileStorageKey": "excel-import/example1copy.xlsx", "tabName": "Registros 2023" }
-
docker exec -it cc-service-dbmysqldump -p --no-create-info catalog_count catalog_count > data_dump.sqldocker cp cc-service-db:/data_dump.sql .
Digital Ocean App: docker image registry.digitalocean.com/cc-service/cc-service-image
- Make sure you are login into registry:
doctl registry login - Push image:
docker push registry.digitalocean.com/cc-service/cc-service-image:<tag> doctl apps list: and make sure to pick correct app iddoctl apps update <id> --spec /path/to/spec.yaml
- command to run application - (java -jar )
- /etc/systemd/system/cc-service.service, systemctl enabled cc-service (reboot)
- Nginx - configuration_file
- environment variables, .env, profile
set -o allexport; source /home/.env; set +o allexport(cmd)