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

Support command line parameters for 1build yaml configuration file #100

Open
gopinath-langote opened this issue Jun 18, 2019 · 3 comments

Comments

3 participants
@gopinath-langote
Copy link
Owner

commented Jun 18, 2019

Description

Imagine you have to run specific command just toggling one value in it. For example, running your spring boot application with a different profile. The current 1build configuration might look like –

project: spring project
commands:
  - run: mvn spring-boot:run -Dspring-boot.run.profiles=local
  - run-dev: mvn spring-boot:run -Dspring-boot.run.profiles=dev
  - run-staging: mvn spring-boot:run -Dspring-boot.run.profiles=staging
  - run-uat: mvn spring-boot:run -Dspring-boot.run.profiles=uat

With this new feature, you can just write like configuration file like,

project: spring project
commands:
  - run: mvn spring-boot:run -Dspring-boot.run.profiles={{profile:=local}}

Where profile is variable and the default value is local.

Now you can use command 1build run dev to run the application using dev profile

OR

1build run --profile staging to run using staging profile.

Acceptance Criteria

  • Use of variables in 1build configuration file.
  • If a named variable is not present use the sequence of input at variable left to right

@landpro and @Ritabrata-TW
WDYT about this feature?

@Ritabrata-TW

This comment has been minimized.

Copy link
Contributor

commented Jun 19, 2019

Sounds like a handy thing to have. +1

@AdeshAtole

This comment has been minimized.

Copy link

commented Jun 19, 2019

Isn't the whole purpose of 1build to avoid commands with long list of options?

@gopinath-langote

This comment has been minimized.

Copy link
Owner Author

commented Jun 19, 2019

@AdeshAtole Yes, you are right.

As you can see above, the duplication of commands run , run-dev , run-staging

  • you duplicating a lot of configuration just for 1/2 place changes. This feature might be useful for developers who prefer to parameterize the commands instead of duplicating.

We can hold on this until we get some more feedbacks on this.

@landpro landpro changed the title set dynamic values with 1build yaml configuration file Support command line parameters for 1build yaml configuration file Jun 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.