Check if Dockerhub environment exists before using gopass

This commit is contained in:
Clemens Geibel 2020-12-04 11:45:30 +01:00
parent 742fe2e641
commit 2233676fdd

View file

@ -15,8 +15,12 @@ class MyBuild(DevopsDockerBuild):
def initialize(project):
project.build_depends_on('ddadevops>=0.6.1')
stage = 'notused'
dockerhub_user = environ.get('DOCKERHUB_USER', gopass_field_from_path('meissa/web/docker.com', 'login'))
dockerhub_password = environ.get('DOCKERHUB_PASSWORD', gopass_password_from_path('meissa/web/docker.com'))
dockerhub_user = environ.get('DOCKERHUB_USER')
if not dockerhub_user:
dockerhub_user = gopass_field_from_path('meissa/web/docker.com', 'login')
dockerhub_password = environ.get('DOCKERHUB_PASSWORD')
if not dockerhub_password:
dockerhub_password = gopass_password_from_path('meissa/web/docker.com')
config = create_devops_docker_build_config(
stage, PROJECT_ROOT_PATH, MODULE, dockerhub_user, dockerhub_password)
build = MyBuild(project, config)