Bitbucket管道节点js与mongo连接

时间:2017-02-14 14:41:20

标签: bitbucket-pipelines

我将其用作bitbucket-pipelines.yml

image: spittet/node-mongodb

pipelines:
  default:
    - step:
        script: # Modify the commands below to build your repository.
          - npm install
          - service mongod start
          - npm test

在测试中我连接到mongo db。 像这样:

const localhost = process.env.HOSTNAME || "localhost";
mongoose.connect('mongodb://'+localhost+'/testslab');

但这不起作用。我应该如何连接到bitbucket管道mongo db?我应该使用什么主机?

0 个答案:

没有答案