python-2.7 - 设置arangodb环境变量以在bitbucket管道文件中进行身份验证

标签 python-2.7 docker arangodb bitbucket-pipelines

我正在使用位桶管道文件的应用程序上使用CI。
为此,我需要导入数据库docker镜像(arangodb)并指定一些环境变量以按照here所述设置身份验证方法。简而言之,它可能是以下可能性之一:

  • ARANGO_RANDOM_ROOT_PASSWORD = 1
  • ARANGO_NO_AUTH = 1
  • ARANGO_ROOT_PASSWORD =一些密码

  • 出于某种原因,先运行两个管道中的任何一个来运行管道会发回错误:

    The 'environment' section in your bitbucket-pipelines.yml file must be a map.



    我设法使用下面文件中的环境变量来使管道运行,但有时我可能想更改其他方法。我不确定写ARANGO_ROOT_PASSWORD到底是什么问题:”会发回相同的先前错误。任何帮助,将不胜感激。
    # This is a sample build configuration for Python.
    # Check our guides at https://confluence.atlassian.com/x/x4UWN for more examples.
    # Only use spaces to indent your .yml configuration.
    # -----
    # You can specify a custom docker image from Docker Hub as your build environment.
    image: python:2.7
    
    pipelines:
      branches:
        '{dev,master}':
            - step:
                script: 
                  - python setup.py develop
                  - python ./server/kernel/setup.py
                  - python ./server/tests/jsonLoginRegister_tests.py 
                services:
                  - arangodb   
    definitions:
      services:
        arangodb:
          image: arangodb/arangodb
          environment: 
            ARANGO_ROOT_PASSWORD: '1'
    

    最佳答案

    解决方案:

    # This is a sample build configuration for Python.
    # Check our guides at https://confluence.atlassian.com/x/x4UWN for more examples.
    # Only use spaces to indent your .yml configuration.
    # -----
    # You can specify a custom docker image from Docker Hub as your build environment.
    image: python:2.7
    
    pipelines:
      branches:
        '{dev,master}':
            - step:
                script: 
                  - python setup.py develop
                  - python ./server/kernel/setup.py
                  - python ./server/tests/common_tests.py 
                services:
                  - arangodb   
    definitions:
      services:
        arangodb:
          image: arangodb/arangodb
          environment: 
            ARANGO_NO_AUTH: 1
    

    关于python-2.7 - 设置arangodb环境变量以在bitbucket管道文件中进行身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47244123/

    相关文章:

    python - 无法在 python 2.7.14 中导入任何模块(安装使用 pip)

    django - 将环境变量中的 Django SECRET_KEY 传递给 Dockerized gunicorn

    arangodb - 如何在 ArangoDB 中返回文档之前添加/删除文档中的属性?

    javascript - 如何在 JavaScript 字符串中使用\n

    python-2.7 - spyder无法加载 tensorflow

    python - 是否可以在浏览器中运行 pygame 或 pyglet?

    django - Google App Engine : ImportError: No Module named appengine. 工具

    docker - 限制 docker 容器内的系统调用

    amazon-web-services - 创建 AWS Batch 托管计算环境,将用户数据传递到容器实例

    arangodb - 查询后是否需要删除 arangodb 游标?