My old .circleci/config.yml
(trimmed for focus) looks like this
version: 2
jobs:
build:
docker:
- image: circleci/node:latest
environment:
- NODE_ENV: test
- image: rabbitmq
steps:
- checkout
- run:
name: Install dockerize
command: wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
environment:
DOCKERIZE_VERSION: v0.6.1
- run:
name: Install dependencies
command: npm install
- run:
name: Wait for RabbitMQ to have started
command: dockerize -wait tcp://localhost:5672 -timeout 1m
- run:
name: Integration Tests
command: npm run test:integration
I’m in the process of upgrading all of my configs now to use the node + codecov orbs but there is no rabbitmq orb so I figured I’d just use docker.
I found the docker orb but can’t figure out how I’d use it in conjunction with the node orb to achieve the same result as above.
This is as far as I have got. Some obvious gaps in my knowledge.
version: 2.1
orbs:
node: circleci/node@4.7.0
codecov: codecov/codecov@3.2.0
docker: circleci/docker@1.7.0
jobs:
test:
# somewhere in here start rabbitmq within docker.
executor:
name: node/default
tag: 'current'
steps:
- checkout
- node/install-packages
- run:
name: Javascript Linter
command: npm run lint
- run:
name: Unit tests with code coverage
command: npm run test:unit:cov
# - run:
# name: Wait for RabbitMQ to have started
# command: dockerize -wait tcp://localhost:5672 -timeout 1m
# - run:
# name: Integration Tests
# command: npm run test:integration
workflows:
node-tests:
jobs:
- test:
post-steps:
- codecov/upload