Dear Community,
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:
Logs: https://app.netlify.com/sites/mcc-adm-es/deploys/5fc81a1977d2340e5e725215
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:
https://5fc81a1977d2340e5e725215--mcc-adm-es.netlify.app/
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: 02c9b8d5-c0c9-40a9-8d51-f9c86b793d80
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.
luke
December 4, 2020, 7:19am
#2
Hi, @Gedco_Sistemas . Alias deploys are not branch deploys. I go into more detail about why this is so here:
Hi, @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.
Dear @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…
alias
( string ) - Specifies the alias for deployment. Useful for creating predictable deployment URL’s
luke
December 7, 2020, 1:12am
#4
Hi, @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).
Hi, ok.
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 https://dog--mcc-adm-es.netlify.app
?
luke
December 7, 2020, 3:04am
#6
Hi, @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.
1 Like