There isn't an only way to perform this, however, this is especially useful where Bamboo script task may not have support for tty. Running docker exec -it is not supported, so commands can not be passed as input to a running container.
This example illustrates a use case where multiple services are required to perform an application test, and they can be spawned with containerization. At the end of the test, we would like to parse the result.
Create the executable script index.sh in a location in the repository. The script should contain the necessary instruction to run and perform the test for the project
#script goes here i.e.
npm run test
Create a Dockerfile with an ENTRYPOINT of a script to be run in when the container is started
# Copy all project into the container working directory
COPY . ./app
#make the script an executable
RUN chmod a+x index.sh
#Specify the interpreter to run the script
ENTRYPOINT ["/bin/sh", "index.sh" ]
Create a docker-compose.yml to orchestrate the container and required services
# map the volume to the host filesystem, this will be useful if a test
# run by the script produces result that should be parsed by a Bamboo task
# add the required services
# List of plan's stages and jobs
- Building to run the custom test within docker container:
- Parse Test Results:
- docker-compose up -d
- docker-compose down
Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events