1build
1build copied to clipboard
Support command line parameters for 1build yaml configuration file
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?
Sounds like a handy thing to have. +1
Isn't the whole purpose of 1build to avoid commands with long list of options?
@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.