surfliner: r&d spike on deploying multiple products in review deploy
An outcome of #999 (closed) was the desire to have the option, when the situation warranted, to specify the deployment of multiple applications for a review deployment. An example of this might be the following:
- I have written code that satisfies #1017 (closed) so that comet and now unpublish objects
Currently, if one writes that comet code and creates an MR, only the comet product will be deployed in the review environment. However, given that this change might now enable a demo of this functionality being realized in a consumer application such as tidewater, one might want the following applications deployed:
comet (contains the code changes) tidewater (presuming in this case the application is already prepared to handle deleting unpublished objects) superskunk (needed to demonstrate the API interaction between the 3 along with rabbitmq)
A proposed solution to this is the following:
- Given the appropriate flag / env var we could potentially install all the products defined and leverage existing pipeline jobs.
How to best pass an env var like this isn't immediately obvious. We can use the Gitlab Push options If documented, probably not a terrible option, but perhaps we can do better?
An example might look like the following:
git push -o merge_request.create -o ci.variable="DEPLOY_PRODUCTS=comet,tidewater,superskunk"
We would then need a way to dynamically create a pipeline that leveraged these variables, and potentially short-circuit the typical pipeline. I'm still reading up on ideas there.
Dynamic child pipelines looks really interesting: https://docs.gitlab.com/ee/ci/pipelines/parent_child_pipelines.html#dynamic-child-pipelines
But I suspect more practically, we might leverage those variables in the various only
templates we have for each of those apps. So we might modify the comet template to something like:
.only-comet-changes:
only:
changes:
- .gitlab-ci.yml
- charts/comet/**/*
- charts/snippets/comet/*
- charts/snippets/surfliner/*
- ci/comet/**/*
- ci/comet.yml
- comet/**/*
- comet/Dockerfile
- gems/surfliner_schema/**/*
variables:
- $DEPLOY_PRODUCTS =~ /comet/
Note: This might not work as intended, we might have to use the newer rules
syntax to get the OR
behavior we'd expect out of the above.
only
includes the job if all of the keys have at least one condition that matches
With
only
, individual keys are logically joined by anAND
.
Acceptance Criteria:
-
An attempt is made to rewrite the configuration needed for superskunk and tidewater to demonstrate that given a merge request creation supplying the ci.variable
of"DEPLOY_PRODUCTS=tidewater,superskunk"
a tidewater AND a superskunk deployment are created