So, that means that there is no value being passed—which, at closer look, is kind of not surprising:
ES_SVC=${ES_SVC}; export ES_SVC
How exactly can you pass the value of ES_SVC
to itself? or RETENTION_PERIOD_FOR_TESTING
to itself? You ought to be passing values to the environment variables. Here, you're passing the value of variables—which may or may not be set properly—to identically named variables. This would make it nearly impossible to cleanly troubleshoot.
At the very least, you should change the variable names to not be identical.