I just tried to create a new environment named [PR-10350] fix(DEV-1966): keep me alive on this project and the settings are correctly applied (I used the API to do it).
Can you let me know how you are creating those environments from your CI ?
Thank you, I understand now.
Your issue is due because you are cloning the environment. When you clone, the environment inherits the same settings of the parent. So it bypasses the deployment rules logic of creation.
To change those settings while still cloning the environment, you either
Need to edit/modify the cloned environment after its creation
modify your blueprint environment to have the wanted settings
If you go with 1, there is no easy way for now to change those settings with the CLI.
The only way is to use the API
You are right, this is a lack of flexibility on our side regarding cloning.
I am creating a ticket to allow enabling/or not the application of deployment rules when cloning.
Regarding the reasoning, this is due because most users want a pristine clone of the resource.
But we’re already applying deployment rule when a clone is trigerred by webhook for PRs, so there is no reason we can allow this possibility also in the API.
We are going to try to do it for next sprint (nex couple weeks) as it should not be much work.
Just to let you know that the feature is now available in the CLI (and soon to be in the UI).
If you use the latest version of the qovery-cli (v0.58.8) you have a new flag in the environment clone, called --apply-deployment-rule. If you set your new env is going to apply the deployment rule logic.
❯ qovery environment clone -h
Clone an environment
Usage:
qovery environment clone [flags]
Flags:
--apply-deployment-rule Enable applying deployment rules on the new environment instead of having a pristine clone. Default: false
-c, --cluster string Cluster Name where to clone the environment
-e, --environment string Environment Name to clone
-t, --environment-type string Environment type for the new environment (DEVELOPMENT|STAGING|PRODUCTION)
-h, --help help for clone
-n, --new-environment-name string New Environment Name
-o, --organization string Organization Name
-p, --project string Project Name