Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b93b3b2

Browse files
committed
add 'run in testbed' shortcut sh script for circle.yml
1 parent ad6f702 commit b93b3b2

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

circle.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ dependencies:
1414
pre:
1515
- docker pull plotly/testbed:latest
1616
post:
17+
- npm run preprocess
1718
- npm run cibuild
1819
- docker run -d --name mytestbed -v $PWD:/var/www/streambed/image_server/plotly.js -p 9010:9010 plotly/testbed:latest
19-
- sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' mytestbed)" -- bash -c "cp -f /var/www/streambed/image_server/plotly.js/test/image/index.html /var/www/streambed/image_server/server_app/index.html"
20+
- sudo ./tasks/run_in_testbed.sh mytestbed "cp -f test/image/index.html ../server_app/index.html"
2021
- wget --server-response --spider --tries=8 --retry-connrefused http://localhost:9010/ping
2122
test:
2223
override:
23-
- sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' mytestbed)" -- bash -c "cd /var/www/streambed/image_server/plotly.js && node test/image/compare_pixels_test.js"
24-
- sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' mytestbed)" -- bash -c "cd /var/www/streambed/image_server/plotly.js && node test/image/export_test.js"
24+
- sudo ./tasks/run_in_testbed.sh mytestbed "node test/image/compare_pixels_test.js"
25+
- sudo ./tasks/run_in_testbed.sh mytestbed "node test/image/export_test.js"
2526
- npm run citest-jasmine
2627
- npm run test-bundle
2728
- npm run test-syntax

tasks/run_in_testbed.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#! /bin/bash
2+
3+
4+
ID="$1"
5+
CMD="$2"
6+
7+
CONTAINER="$(docker inspect --format '{{.Id}}' $ID)"
8+
REPOPATH="/var/www/streambed/image_server/plotly.js"
9+
10+
lxc-attach -n $CONTAINER -- bash -c "cd $REPOPATH && $CMD"

0 commit comments

Comments
 (0)