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

odo dev add flag to run non-default run command. #5775

Closed
1 task
kadel opened this issue May 31, 2022 · 1 comment · Fixed by #5878
Closed
1 task

odo dev add flag to run non-default run command. #5775

kadel opened this issue May 31, 2022 · 1 comment · Fixed by #5878
Assignees
Labels
area/dev Issues or PRs related to `odo dev` kind/user-story An issue of user-story kind

Comments

@kadel
Copy link
Member

kadel commented May 31, 2022

User Story

  • As an odo user
  • I want to be able to execute alternative run command instead of the default one
  • So that I can run my app in a different mode (different configuration, flags etc..) without modifying the default command.

Example:

SpringBoot devfile has the following default run command.

- exec:
    commandLine: mvn -Dmaven.repo.local=/home/user/.m2/repository spring-boot:run
    component: tools
    group:
      isDefault: true
      kind: run
    hotReloadCapable: false
    workingDir: ${PROJECT_SOURCE}
  id: run

In some situations, I want to run spring boot application with a different profile.
This can be done adding -Dspring-boot.run.profiles=postgres flag to to spring-boot:run command.
Currently I have to edit the commandLine in order to be able to execute my with different profile.

Instead of that it would be nice to be able to add extra run command like this:

- exec:
    commandLine: mvn -Dmaven.repo.local=/home/user/.m2/repository spring-boot:run -Dspring-boot.run.profiles=postgres
    component: tools
    group:
      isDefault: false
      kind: run
    hotReloadCapable: false
    workingDir: ${PROJECT_SOURCE}
  id: run-wiht-postgres

And then simply execute odo dev --run-command run-with-postgres, when I want to switch back to using the default profile, I stop running odo dev command and start it again, but this time without --run-command flag.

Acceptance Criteria

  • odo dev should have --run-command flag that controls what command is used to start application.

/kind user-story

@openshift-ci openshift-ci bot added the kind/user-story An issue of user-story kind label May 31, 2022
@kadel kadel added the area/dev Issues or PRs related to `odo dev` label May 31, 2022
@rm3l
Copy link
Member

rm3l commented Jun 13, 2022

TODO (to not forget):

As commented out in [1]:

we should try to harmonize the behaviour between commands in pkg/libdevfile/libdevfile.go. Deploy is using getDefaultCommand, when Build/Test/Run is using getCommandAssociatedToGroup

[1] #5768 (comment)

@rm3l rm3l moved this to In Progress in odo v3-beta1 Jun 21, 2022
@rm3l rm3l moved this from In Progress to For Review in odo v3-beta1 Jun 27, 2022
@rm3l rm3l removed this from odo v3-beta1 Jun 27, 2022
@rm3l rm3l moved this to For review in odo v3-beta2 Jun 27, 2022
Repository owner moved this from For review to Done in odo v3-beta2 Jun 28, 2022
@rm3l rm3l added the v3 label Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dev Issues or PRs related to `odo dev` kind/user-story An issue of user-story kind
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants