最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Docker run get local environment and use it right after - Stack Overflow

programmeradmin0浏览0评论

I'm trying to execute a docker run command by passing a local environment variable to sonar-scanner. This all gets executed in the Jenkins pipeline. However the result from os.getenv() is always empty and dsonar.login=$SONAR_SCANNER is not working.

run_image_command = \
        f"docker run --rm -e SONAR_SCANNER {image_name} sonar-scanner \
          -Dsonar.projectKey={domain}-{usecase} \
          -Dsonar.sources={path} \
          -Dsonar.host.url={url} \
          -Dsonar.branch.name={branch} \
          -Dsonar.login={os.getenv('SONAR_SCANNER')}"
    run_cmd(run_image_command)
发布评论

评论列表(0)

  1. 暂无评论