Skip to content

Commit e70e6d7

Browse files
committed
Extract a build artifact via docker cp
[refs #f2c17c9ea522]
1 parent 0ee8a6b commit e70e6d7

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

.circleci/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ jobs:
2121
- run:
2222
name: Running the test suite
2323
command: ./scripts/run-specs.sh
24+
- store_artifacts:
25+
path: /tmp/artifacts

docker-compose.ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ services:
44
app:
55
build:
66
context: .
7+
command: tail -f /dev/null

scripts/run-specs.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
11
#!/bin/bash
2-
docker-compose run app bundle exec rspec
2+
set -e
3+
function copy_artifacts {
4+
mkdir -p /tmp/artifacts
5+
CONTAINER_ID=$(docker-compose ps -q app)
6+
docker cp ${CONTAINER_ID}:/tmp/rspec.xml /tmp/artifacts/rspec.yml
7+
}
8+
9+
docker-compose up -d app
10+
docker-compose exec app \
11+
bundle exec rspec --format progress --format RspecJunitFormatter --out /tmp/rspec.xml
12+
STATUS=$?
13+
copy_artifacts
14+
exit ${STATUS}

0 commit comments

Comments
 (0)