robotsnoindex

This page has example bitbucket-pipelines.yml files showing how to connect to these DB instances:

Cassandra

pipelines: 
  default: 
    - step: 
        image: node 
        script: 
          - npm install 
          - sleep 10 # wait for cassandra 
          - npm test 
        services: 
          - cassandra 
definitions: 
  services: 
    cassandra: 
      image: cassandra 
      variables: 
        MAX_HEAP_SIZE: 512M # Need to restrict the heapsize or else Cassandra will OOM 
        HEAP_NEWSIZE: 128M

Cassandra will be available on localhost:9042.


MongoDB

pipelines: 
  default: 
    - step: 
      image: node 
      script: 
        - npm install 
        - npm test 
      services: 
        - mongo 
definitions: 
  services: 
    mongo: 
      image: mongo

MongoDB will be available on localhost:27017 without authentication. As you connect to a database, MongoDB will create it for you.


MSSQL

image: fabiang/sqlcmd # image that provides the sqlcmd cli
pipelines:
 default:
    - step:
        script:
          # might need to wait for sqlserver to start properly here
          - sqlcmd -S localhost,1433 -U SA -P '<YourStrong!Passw0rd>' -i sqlserver.sql
        services:
          - sqlserver
definitions:
  services:
    sqlserver: 
      image: mcr.microsoft.com/mssql/server:2017-latest
      variables: 
        ACCEPT_EULA: Y
        SA_PASSWORD: <YourStrong!Passw0rd>

MSSQL will be available on localhost:1433 The user SA (a Systems Administrator) and password <YourStrong!Passw0rd>, running commands contained in a sqlserver.sql file in your repository. You will need to populate the database with your tables and schema. If you need to configure the underlying database engine further, refer to the official dockerhub image for details.

MySQL – test user

pipelines: 
  default: 
    - step: 
      image: node 
      script: 
        - npm install 
        - npm test 
      services: 
        - mysql 
definitions: 
  services: 
    mysql: 
      image: mysql 
      variables: 
        MYSQL_DATABASE: pipelines 
        MYSQL_RANDOM_ROOT_PASSWORD: yes 
        MYSQL_USER: test_user 
        MYSQL_PASSWORD: test_user_password

MySQL will be available on localhost:3306 with a default database 'pipelines', user 'test_user' and password 'test_user_password'. The root user of MySQL will not be accessible. You will need to populate the pipelines database with your tables and schema. If you need to configure the underlying database engine further, refer to the official dockerhub image for details.


MySQL – root user

pipelines: 
  default: 
    - step: 
      image: node 
      script: 
        - npm install 
        - npm test 
      services: 
        - mysql 
definitions: 
  services: 
    mysql: 
      image: mysql 
      variables: 
        MYSQL_DATABASE: pipelines 
        MYSQL_ROOT_PASSWORD: let_me_in

MySQL will be available on localhost:3306 with a default database 'pipelines', user 'root' and password 'let_me_in'. You will need to populate the pipelines database with your tables and schema. If you need to configure the underlying database engine further, please refer to the official dockerhub image for details.


PostgreSQL – default user

pipelines: 
  default: 
    - step: 
      image: node 
      script: 
        - npm install 
        - npm test 
      services: 
        - postgres 
definitions: 
  services: 
    postgres: 
      image: postgres

PostgreSQL will be available on localhost:5432 with default database 'postgres', user 'postgres' and no password. You will need to populate the postgres database with your tables and schema, or create a second database for your use. If you need to configure the underlying database engine further, please refer to the official dockerhub image for details.


PostgreSQL – test user

pipelines: 
  default: 
    - step: 
      image: node 
      script: 
        - npm install 
        - npm test 
      services: 
        - postgres 
definitions: 
  services: 
    postgres: 
      image: postgres 
      variables: 
        POSTGRES_DB: pipelines 
        POSTGRES_USER: test_user 
        POSTGRES_PASSWORD: test_user_password

PostgreSQL will be available on localhost:5432 with default a database named 'pipelines', user 'test_user' and password 'test_user_password'. You will need to populate the pipelines database with your tables and schema. If you need to configure the underlying database engine further, please refer to the official dockerhub image for details.


Redis

pipelines: 
  default: 
    - step: 
      image: node 
      script: 
        - npm install 
        - npm test 
      services: 
        - redis 
definitions: 
  services: 
    redis: 
      image: redis

Redis will be available on localhost:6379 without authentication.