aws-amplify / amplify-hosting

AWS Amplify Hosting provides a Git-based workflow for deploying and hosting fullstack serverless web applications.
https://aws.amazon.com/amplify/hosting/
Apache License 2.0
460 stars 116 forks source link

Custom domain pointing to latest tag in repo #614

Open woodsae opened 4 years ago

woodsae commented 4 years ago

I currently have a custom domain set up to point to my master branch. I would also like to have a consistent staging environment URL, but having a long-lived staging branch would introduce unnecessary overhead to our development process. The way I have done this in non-Amplify projects is to have the production environment be a deployment of the latest tag in the repo. This would then leave me free to make the master branch a pre-production staging environment with a consistent URL.

I would like an option to set my custom domain to point to a build of the latest tag in the repo. Would this be possible?

swaminator commented 4 years ago

@woodsae thanks for the feature request. Some questions:

  1. Do you want to have a flow where you can create a branch deployment from a specific tag? (e.g. release)
  2. Can you tell us what tags you use specifically in your workflow?
woodsae commented 4 years ago

Hi @swaminator, thank you for the response.

When I want to deploy to production I would make a tag in the format v1.0.0, so any tag starting with v means a production tag. I would like my custom domain, app.trabr.com, to point to a deployment of the latest tag. So when I make a new tag starting with v, a deployment would happen and that code would now be serving production.

Does that make sense?

woodsae commented 4 years ago

Hi @swaminator , do you have any thoughts around my previous comment?

jsw commented 4 years ago

I'm looking for something similar. We have our dev environment connected to the master branch and our prod environment connected to the prod branch. Maintaining the prod branch is not clean. All we want to do is promote the master branch to production. In our non-Amplify apps, we are able to simply publish a GitHub release, which triggers a GitHub Action to deploy to prod. Being able to connect an Amplify env to a tag or a release, or the latest tag as @woodsae suggests, seems like an improvement over maintaining separate branches for different environments.

woodsae commented 4 years ago

@swaminator Is there any movement on this?

Just to be clear, this is what I want to accomplish:

This would be hugely beneficial if we can accomplish this, because we have a native iOS app that exposes some web functionality in a wrapper and if the staging URL is constantly changing because of PR previews it means we have to keep updating the build just to test functionality. And it would be too much extra effort to always maintain a staging branch.

MichaelRoberts-FlashParking commented 3 years ago

I'm looking for the same thing. I was able to use the "Incoming webhooks" feature to get amplify to only builds the app when a "release" event is triggered in GitHub, but it's still building the latest version of the branch, making reverting to a previous release/branch in GitHub pointless. It would be great if Amplify could be configured to just track the latest tag/release.

GooBall commented 3 years ago

I could really do with this too. I need to be able to select a new tag once it has been built to just point the domain over to the new code. This would also then allow for rollback if a new tag introduces an issue to a production environment.

I understand I could do this with branches. But tags exist in GH and other repo management solutions for the express purpose of being able to target specific versions.

jose-fmeyer commented 3 years ago

Would really appreciate to be able to use Git tags as well. Many deployment tools use the release artifact as the source of truth for deployments and rollbacks, and relying only on a branch for me seems a bit error prone. Rolling back with amplify currently isn’t easy as well. Reverting the code in the master branch doesn’t seem to be a good option .

Any ideas when this could be tackled?

nirradi commented 3 years ago

Releasing and deploying on new git tags is very common, so this seems to make a lot of sense to have.

One workaround that seems pretty straightforward to me is having your CD (jenkins/github actions, etc) force push to the deployment branch any time a relevant tag is created (not master, more like "release-amplify" or something) . Rolling back to a different tag should be possible in a similar fashion. Proper branch rules in github could make sure that this branch isn't updated in any other way.

Does that cover this use case?

rchavez-neu commented 3 years ago

+1 for the request(s) for being able to connect Amplify to a specific tag/release for deploys and rollbacks. There hasn't been much feedback/response on this from AWS yet @swaminator , any idea of when/if this request might see some action?

croossin commented 3 years ago

@swaminator Bumping this thread... any updates?

ngeprint-io-team commented 3 years ago

@swaminator I think this is a must have feature. AWS CodeBuild support this feature, why Amplify can't?

ric-sapasap commented 3 years ago

Any updates on this feature?

dnoji commented 3 years ago

@swaminator Any updates? 🙏

truecolintracy commented 3 years ago

Also looking for this feature coming over from github actions.

rmakovyak commented 2 years ago

@swaminator this feature is also something our team is looking for

jeff-accountably commented 2 years ago

+1 to this, I currently manage three branches to accomplish this (dev, staging, and prod). Managing a single branch with tags would be so much easier.

david-j-davis commented 2 years ago

+1 to this

crow7m commented 2 years ago

+1

mswezey23 commented 1 year ago

+1 Been desiring this feature for awhile.

Any updates?

scotnick commented 1 year ago

+1 same here! would really love to see this feature! is there any progress on that?

mkelitz commented 1 year ago

+1 same need here.

erudenko commented 1 year ago

my +1 for this

cbetori commented 1 year ago

+1 need this feature

devinhaynes commented 1 year ago

+1 Much needed feature

For those looking for a workaround, I was able to deploy the Amplify webhook through Github actions.

Screenshot 2023-06-11 214446

alind-ch commented 1 year ago

@swaminator any updates? much anticipated feature.

mswezey23 commented 1 year ago

Still awaiting GitHub tagged version support.

Any updates on when this will or will not be supported?

ThibaultLengagne commented 1 year ago

+1 same need

walinsta commented 1 year ago

+1

nroehling commented 1 year ago

+1

SimonStAmand commented 11 months ago

+1

ki0 commented 11 months ago

+1

nkpremices commented 10 months ago

+1

mits87 commented 10 months ago

Any updates on this feature?

lucassarcanjo commented 10 months ago

+1

djmisha commented 9 months ago

+2

pmakow commented 8 months ago

Is there any update on this feature? My team also need it.

darekraczka commented 8 months ago

+1 It's a very needed feature

sszlaga commented 8 months ago

+1

mstali02 commented 8 months ago

+1

caseyhenderson commented 8 months ago

+1 - this feature would be extremely helpful for my organisation.

cgaubuchon commented 7 months ago

We sort of solved this by creating a GitHub action that manages a merge from our main branch into each environment branch that Amplify currently requires. While it does not achieve exactly what the original request was here it allows us to run trunk-based development. It does the following:

  1. Action is triggered when tagging a deployment on main
  2. Creates a temporary branch from whichever environment branch Amplify is connected to, such as "stage"
  3. Merges main into this temporary branch and prefers the changes in main to avoid any merge conflicts
  4. Opens a PR and merges with relevant commit messages
  5. Deletes the temporary branch used in the action

True tag-based deployments would still be a great addition to the Amplify platform, but this is working well enough for us. Where we still have environment branches, but they are locked down from usual git actions, and only the GitHub action controls what goes in/out.

mkaliberda commented 5 months ago

4 years later, no response on so critical feature request

tosh79kt commented 2 months ago

+1

juanchojbarroso-mymoid commented 2 months ago

+1

mcetat commented 2 months ago

We sort of solved this

Would it be possible to provide an concrete example of how you solved that? We're having the same problem currently, and I could not figure yet out a way to make that workflow automatic.

mswezey23 commented 1 month ago

Any updates from AWS on this?