I ran the cookiecutter and pushed this project to a GitLab repository. I set up a VPS with Docker Swarm and GitLab Runner (based on the instruction from dockerswarm.rocks). I ran the pipeline and the test, build and deploy-stag completed successfully. I can access everything on stag.domain.com without issues. Then..
1) I made some change to the user model (split full name to first and last name) in the gitlab repository master branch and committed the changes. But the CI/CD job failed, because the backend container failed, because the column did not exist in the table, because there was no migration done. How do I make migrations and migrate automatically when I make changes to the GitLab repository with this set up? Why is it necessary to manually enter the container and make migrations using alembic?
2) Any time there is a new commit, I want it to make the migrations (if applicable) and migrate automatically, otherwise the backend container will fail every time. It seems unnecessary to manually connect to the backend container and make the migrations each time. How do I accomplish this?
3) How it should work:
Upload repository to GitLab
Run CI/CD pipeline
Make changes to files in repository
Commit changes
Repeat steps 2-4 again and again in the same way, forever
Why are there so many extra steps?
I've been pulling my hair out for a couple days on this.
Thanks in advance!
I ran the cookiecutter and pushed this project to a GitLab repository. I set up a VPS with Docker Swarm and GitLab Runner (based on the instruction from dockerswarm.rocks). I ran the pipeline and the test, build and deploy-stag completed successfully. I can access everything on stag.domain.com without issues. Then..
1) I made some change to the user model (split full name to first and last name) in the gitlab repository master branch and committed the changes. But the CI/CD job failed, because the backend container failed, because the column did not exist in the table, because there was no migration done. How do I make migrations and migrate automatically when I make changes to the GitLab repository with this set up? Why is it necessary to manually enter the container and make migrations using alembic?
2) Any time there is a new commit, I want it to make the migrations (if applicable) and migrate automatically, otherwise the backend container will fail every time. It seems unnecessary to manually connect to the backend container and make the migrations each time. How do I accomplish this?
3) How it should work:
Why are there so many extra steps?
I've been pulling my hair out for a couple days on this. Thanks in advance!