1build icon indicating copy to clipboard operation
1build copied to clipboard

Support command line parameters for 1build yaml configuration file

Open gopinath-langote opened this issue 5 years ago • 3 comments

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?

gopinath-langote avatar Jun 18 '19 09:06 gopinath-langote

Sounds like a handy thing to have. +1

that-data-scientist avatar Jun 19 '19 05:06 that-data-scientist

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

AdeshAtole avatar Jun 19 '19 12:06 AdeshAtole

@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.

gopinath-langote avatar Jun 19 '19 13:06 gopinath-langote