Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Quesstion] Getting deployment-id or url after deploy as an output #354

Open
MastalerzKamil opened this issue Aug 3, 2022 · 5 comments
Open

Comments

@MastalerzKamil
Copy link

I'm going to use tf-next into Github Action CI/CD and based on README in order to switch alias I need to have daployment-id or url to deployed app. Is there any way to get it as an output from command tf-next deploy?

@MastalerzKamil MastalerzKamil changed the title Getting deployment-id or url after deploy as an output [Quesstion] Getting deployment-id or url after deploy as an output Aug 3, 2022
@khuezy
Copy link

khuezy commented Aug 5, 2022

@MastalerzKamil
Copy link
Author

Yes it is but I would like to take it and save into secrets in my CI/CD. I know that I could copy it manually but I need make deployment wit changing alias automatically. Based on documentation https://registry.terraform.io/modules/milliHQ/next-js/aws/1.0.0-canary.5. There isn't an output as url or deployment Id

@eprokofev
Copy link

It seems the project is stale...it's a pity...not usable in the real world without getting a deployment id.
Only for manual deployments.

@khuezy
Copy link

khuezy commented Feb 6, 2023

Yeah Vercel poached our dear boy. I'd recommend using sst.dev for your infra and NextjsSite v2 for your nextjs app. It supports latest Nextjs features. https://discord.gg/sst

@eprokofev
Copy link

eprokofev commented Feb 7, 2023

I made this construction:

resource "null_resource" "tf-next-deploy-and-promote" {
  provisioner "local-exec" {
    command = "tf-next deploy --endpoint=${module.tf_next.api_endpoint} | grep -oP '(?<=\\/\\/)(.*?)(?=undefined)' | xargs -I {} tf-next alias set ${aws_route53_record.main.fqdn} {} --force"
    working_dir = "../." #because next.js in parent folder
  }
}

In my case, tf-next deploy throws "HTTP://1234141124(some_id)123141234undefined" instead of URL. That's why I used regex '(?<=//)(.*?)(?=undefined)'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants