Persist data between steps with volumes

docker
gulp

#1

I’ve read the docs on using volumes in the codeship-services.yml file. I’m running a gulp task in one of my steps that creates a build directory that needs to persist to the next steps. When I run jet steps, and then run docker exec CID ls -al I see the build directory in the container on that first build step, but it disappears once the next step starts. I’m using the following bit in my services file:

dev:
  build:
    image: buildImg
    dockerfile: Dockerfile
    encrypted_args_file: build_args.encrypted
  encrypted_env_file: .env/env-dev.encrypted
  cached: true
  default_cache_branch: "dev"
  volumes:
    - ./tmp/site:/site

In the following step I try to reference that build directory but get an error that it can’t be found. Here are the first two steps:

# Build the site
- name: Build
  tag: ^(master|staging|dev)$
  service: dev
  command: ./node_modules/.bin/gulp build

# Deploy Dev
- name: Deploy Dev
  tag: dev
  service: dev
  command: ./.bin/dev_deploy.sh

I’ve tried changing the command so that it includes /site or /tmp/site in the path, but get an error on the first step that node_modules can’t be found. What am I missing here?