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

Add latest task definition option to run command #182

Merged

Conversation

jamesrwhite
Copy link

This adds the --latest-task-definition flag to the run command, the goal is to have it function identically to how it does for the deploy command.

We needed this to support our application deployment flow of:

  1. Registering a new task definition:
    $ ecspresso register
  2. Running database migrations using the newly registered task definition:
    $ ecspresso run --latest-task-definition --overrides '{...}'
  3. Deploying and updating our service using the latest definition:
    $ ecspresso deploy --latest-task-definition --update-service

@fujiwara
Copy link
Contributor

Thank you, I've recognized the use case. Great patch!

@fujiwara fujiwara merged commit dbae64e into kayac:v1 Oct 30, 2020
@fujiwara
Copy link
Contributor

@jamesrwhite
Copy link
Author

Thanks for dealing with this so quickly! Would you be able to push a new version of the orb to CircleCI also?

@fujiwara
Copy link
Contributor

@jamesrwhite
https://circleci.com/developer/orbs/orb/fujiwara/ecspresso CireleCI orb was updated!

@Songmu
Copy link
Contributor

Songmu commented Oct 31, 2020

@jamesrwhite

Very good work!

Interestingly, when I added "--latest-task-definition" before (#161), my motivation was the same as yours that I wanted to run the migration before deployment.

In fact, what you want to do can also be written as follows.

$ ecspresso -conf conf.yml run --overrides '{...}'
$ ecspresso -conf conf.yml deploy --latest-task-definition

In this case, the ecspresso run registers a new task definition and executing the task. Also, the --update-service option has been set to true by default since ecspresso v1, so it is not required.

However, your command declaration is clear and without any implications so, which one is better is a matter of taste, I think.

@jamesrwhite jamesrwhite deleted the add-latest-task-definition-option-to-run branch November 2, 2020 10:43
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

Successfully merging this pull request may close these issues.

3 participants