Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Bitbucket Pipeline - Populate Cassandra DB with Schema

spin1987 August 4, 2017

Hi,

 

i'm using the new feature: Bitpucket Piplines and it works well. Now i'm trying integration tests with an cassandra db, deployed with docker.

How can i populate a schema to fresh cassandra? A keyspace and tables, config?

My bitbucket-pipelines

pipelines:
default:
- step:
script:
- npm install -g ntypescript
- npm install -g mocha
- npm install
- npm run-script compile
- sleep 15
- npm run-script local:migrate
- npm test
services:
- cassandra
definitions:
services:
cassandra:
image: cassandra
environment:
MAX_HEAP_SIZE: 512M # Need to restrict the heapsize or else Cassandra will OOM
HEAP_NEWSIZE: 128M

The tests will run after i compiled my typescripts into js and i waited 15 seconds for the cassandra setup. The i populate data to a running cassandra db, but i need to setup the schema first? How can i do this?

Here: https://docs.datastax.com/en/cql/latest/cql/cql_using/startCqlLinuxMac.html

With cqlsh its possible, but how can i access cql? Do i have to install it or do i have to some command like: docker exec cassandra bash ?? Thank you very much for help.

 

 

 

 

 

 

1 answer

0 votes
Vadym Klos
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 5, 2019

I do the population of the data, keyspace creation etc as a part of `before` phase of my integration test.

Vadym Klos
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 5, 2019

also according to https://confluence.atlassian.com/bitbucket/test-with-databases-in-bitbucket-pipelines-856697462.html, instead of `environment` you should use `variables`

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events