Whenever bin/deploy is ran, it will attempt to reinstall a conda environment even if that exact conda environment is already deployed. On jenkins workers for linux, this is really slow because the transactions are very slow over networked file systems due to the large amount of small files.
Some kind of fast path could probably be created - particularly when we are using lock files. Simply verifying an existing environment has the same conda list --explicit output that the environment we are asking to install should be enough to bypass the extra step.
As long as the env is specified by git hash, I agree that looking at the contents is overkill. In other cases, checking the contents doesn't seem too expensive and is a bit safer.
Considering that an environment reference may be a tag instead of a hash and that tags may change (this is a different problem in my opinion), it may make sense to check also that the content of the environment hasn't changed.
From my understanding, especially in Jenkins, nothing is going to change the environment.
Therefore, we could just check if the environment exists, and avoid re-deploying in case it is.
Or we could add a flag to force: do not redeploy if it exists, so we keep the current behavior as default.