-
Notifications
You must be signed in to change notification settings - Fork 23
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
Autodeploy deploying into wrong account #25
Comments
Following up there for now |
Thanks @jayair - the console channel has been archived, so i can't respond there. You asked: "So from the second screenshot here, it's saying that it's deploying to a stage called prd. Now if you go to the app page where it lists all the stages, what's the AWS account listed by prd?" What happened was we ended up with two
I had to kill the the first one by setting my terminal profile to dev, then running Like I say, sure i'm doing something wrong just not sure how to debug. We removed the AWS prod account from the console and re-added, but same thing just happened again. |
Do you have an auto deploy block in your sst config? |
I do - i assumed this was not the issue as i can see It looks like this: console: {
autodeploy: {
target(event) {
// staging -> stg
if (
event.type === "branch" &&
event.branch === "staging" &&
event.action === "pushed"
) {
return { stage: "stg" };
}
// production -> prd
if (
event.type === "branch" &&
event.branch === "production" &&
event.action === "pushed"
) {
return { stage: "prd" };
}
// dev -> dev
if (
event.type === "branch" &&
event.branch === "dev" &&
event.action === "pushed"
) {
return { stage: "dev" };
}
// only create a stage for PRs that are targeting the dev branch
if (event.type === "pull_request" && event.base === "dev") {
return { stage: `pr${event.number}` };
}
},
},
},
``` |
Hi @jayair, any ideas on what else i can try here? Do you see any issues with my config above? |
So is |
Yes, thats correct. |
I've raised this in Discord, but raising here as well incase any else has the same problem and can help.
We are running into a strange issue with autodeploy. We have 4 environments, mapped to 3 AWS accounts (pr's and dev go to dev account) When we merge into production, the deploy runs, but it deploys into the dev account. I think my SST config is correct as i can see
sst deploy --stage prd
running in the logs when i merge into prod branch.In the screenshot, you can see the 4 environments, but prd deploy does not deploy to expected account. I'm sure i'm missing something obvious here, how can i debug it?
You can see below the merge into production triggers
sst deploy --stage prd
I'm sure i'm doing something wrong, but i'm not sure how to debug this further, does anyone have idea what could be going wrong or steps i can follow to find out whats happening?
Thanks!
The text was updated successfully, but these errors were encountered: