In our Gitlab CI/CD pipeline, when we issue the command:
netlify deploy --alias "$CI_COMMIT_REF_NAME" --message "Deployado desde rama $CI_COMMIT_REF_NAME commit $CI_COMMIT_SHORT_SHA"
Everything seems fine:
Website Draft URL: https://master--mcc-adm-es.netlify.app
But the changes are not the latest deployed. But, if I open this unique URL:
This URL is the right. Its work fine and have the latest changes deployed.
Why the alias URL is not refreshed with the latest changes and the unique URL works fine ?
Our Site-ID is:
Thanks in advance, and best regards.
P.D.: Soy for my bad English.
P.D.2: The $CI_COMMIT_REF_NAME env var contains the “master” string. I double checked that.
@Gedco_Sistemas. Alias deploys are not branch deploys. I go into more detail about why this is so here:
@jega. It sounds like you are considering using a unique site for each “trunk”. I was going to recommend this myself.
If you are using different git branches then using our branch subdomain feature makes sense. You are not using different git branches so this won’t work for you.
The next best workaround is just to use different sites as you have suggested.
Also, I want to warn you about a “false workaround”. It is a possible solution some people have already tried and it doesn’t work. So,…
If there are question after reading that, please let us know.
@luke, thanks for your quick reply.
Ok, I learn that Alias deploys aren’t branches deploy. So, what’s is the alias flag for ? I can’t imagine an use case for this…
string ) - Specifies the alias for deployment. Useful for creating predictable deployment URL’s
@Gedco_Sistemas. It is for exactly what is says: “Useful for creating predictable deployment URL’s”.
It is just important to understand that they are not treated in the same ways as branch deploys (because they aren’t).
Sorry, but then why when I use
--alias master to deploy, I don’t see the last changes I made push?
Is ‘master’ a reserved word? Should I have to use another word to test, such as cat or dog? Then there would be a
@Gedco_Sistemas. It was reserved when you deployed a branch with that same name,
master. So now that subdomain (
master--mcc-adm-es) is reserved for branch deploys to that branch. If you try to use it as an alias it fails to update because it was already used for a branch deploy. The branch deploy take precedence over the alias.
Perfect. Thank you very much for the patience and time invested in clarifying our doubts.
We have been using Netlify for a while and we are very pleased with the service.
Keep the good work. Cheers from Buenos Aires.