I have a Jira ticket that requires me to update both a backend and frontend repo. When I commit and push the changes to the backend, a dynamic environment is created by the GitLab pipeline.

I now need to push the changes to my frontend and it too creates a dynamic environment but I need this frontend environment to point at my backend environment in order to test everything works as expected.

At the moment, I'm hard coding the link to my dynamic backend environment because otherwise I don't know how the frontend would know this environment exists.

The problem is, I will need to change the hard coded link back to point at a dev environment before release. My thinking is that one, this is risky because you have to remember to revert the code back before release. If you fail to do that you accidentally release broken code. Two, it increases the work you need to do to create a release.

Are there better approaches to this than having to temporarily hard code the URL? I'm quite new to CI/CD and GitLab pipelines but this feels clunky and wrong.

The only thing I can think of is that you should release the backend change before creating the frontend environment so it always points to a stable backend environment but currently there is little in the way of automated backend tests so its difficult to test without viewing via the frontend.

The other thing I thought about was having some sort of dedicated backend test environment you could merge in to. I can't quite figure out in my head how that would work from the point of view of keeping that branch up to date... if you are using it to test things out, there is a good chance this environment will break?

0

There are 0 best solutions below