Allow to use local services area via optional parameter#1269
Conversation
amaltaro
left a comment
There was a problem hiding this comment.
Valentin, I have a general comment on this script which is, whenever I have to use it, I don't pass the <env> option and I simply rely on it to be self-discovered by the script and my environment. In that scenario, we might have a mix up of parameters 3 and 4 (aka. positional arguments).
So, I think to have a clear and solid script option, we should either:
a) remove the env option and always rely on the environment for the correct execution
b) or, make it keyword arguments, e.g. -t <tag> -e <env> -p <services_path> etc
What do you think? @muhammadimranfarooqi and @arooshap might have a different view as well.
|
@muhammadimranfarooqi from line 4, we need to provide >= 2 parameters. Thus, running it only with the service name and the tag works just fine. |
| # helper script to deploy given service with given tag to k8s infrastructure | ||
|
|
||
| if [ $# -lt 2 ]; then | ||
| echo "The required parameters for service and tag are missing. Please use deploy-srv.sh <service> <tag> <env> " |
There was a problem hiding this comment.
@amaltaro Yes, this can cause a mixup of parameters 3 and 4. I think rather than removing the env variable entirely, we can make the script take keyword arguments because when you're doing multiple deployments at the same time, it helps to make sure that you are deploying in the correct environment.
|
I implemented script variables, please see updated code. For simplify here is a stand-alone script to demonstrate how it works (I name this script as t.sh): If you'll run it you'll see something like this: @muhammadimranfarooqi , @arooshap please review and test these changes by yourself in your own environment and report if everything is fine and you are satisfied with them (i.e. I mean try your wokrflows and test with multiple setups). @amaltaro please provide your feedback as user if you are satisfied with proposed solution. |
|
Hi @vkuznet, I have tested this script separately on many instances, and it works as expected. |
|
@arooshap , I'm in favor of merging this PR but I will let Alan to confirm if it is ready or will require further adjustments. |
No description provided.