Hi again,
After successfully testing and starting with buildkite pipelines, I created a pipeline based on docker-compose:
steps:
- label: "Create docker image"
plugins:
- docker-compose#v4.14.0:
build: app
- wait
- label: "Setup"
command: npm run setup
plugins:
- docker-compose#v4.14.0:
run: app
env:
- AWS_REGION
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- wait
- label: "Compile"
command: npm run compile
plugins:
- docker-compose#v4.14.0:
run: app
- wait
- label: "Test"
command: npm run test
plugins:
- docker-compose#v4.14.0:
run: app
- wait
- label: "Start"
command: npm run prod
plugins:
- docker-compose#v4.14.0:
run: app
The setup and compile jobs create files and directories that will be used by the start job. But the start job can not find those files because new image run by the agent on each job. Should we concat the commands such as npm run setup && npm run compile ...
or is there anything we can do to use the same running instance? I preferred the approach above because it seems like a better practice in designing pipelines.