-
Notifications
You must be signed in to change notification settings - Fork 48
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
fixed preapply commands and added postapply/postplan #102
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lkysow could you also have a look?
postrun/post_run.go
Outdated
@@ -0,0 +1,89 @@ | |||
// Package postrun handles running commands after the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a lot of redundant code here with prerun
package doing the same thing. We should restructure this so we can use the code for both prerun
and postrun
pacakges.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do. I'll get rid of the copy paste replace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anubhavmishra The code is basically the same, I could move duplicate functions with different names in a more general package "run" or we could just rename the package and functions to "run". What were you thinking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep! run might make more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay @anubhavmishra , settled on a more general package and opted to pass in the stage name(i.e "pre_plan", "post_plan", etc)
@@ -178,6 +181,14 @@ func (a *ApplyExecutor) apply(ctx *CommandContext, repoDir string, plan models.P | |||
} | |||
ctx.Log.Info("apply succeeded") | |||
|
|||
// if there are post apply commands then run them | |||
if len(config.PostApply.Commands) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are adding post_apply
might as well add post_plan
too. Some people might want to use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure thing. for whatever reason i just figure pre_apply
was the same thing as post_plan
, but you are right, the steps are different. Let me add it.
looks like e2e test failed. code seems fine. seems like environment variable doesn't exist in circle? |
yep. we might need to change it so that end to end test only run on master builds. |
#108 should fix the e2e failures for now. We will come up with a better plan to figure out when and how to run e2e tests. So you can rebase when the PR is merged. |
Sorry i missed this update. Thanks for the merge! Sent from my Samsung SM-G935T using FastHub |
All good! |
Per #100