File tree Expand file tree Collapse file tree 2 files changed +34
-4
lines changed Expand file tree Collapse file tree 2 files changed +34
-4
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash -e
2
+ SCRIPTDIR=$( python -c ' import os,sys;print os.path.dirname(os.path.realpath(sys.argv[1]))' " $0 " )
3
+
4
+ # Make sure we're in the correct place relative to Dockerfile no matter where we were called from
5
+ cd ` dirname " $SCRIPTDIR " `
6
+
7
+ docker build -t asylum_test .
8
+ echo " Starting test server."
9
+ echo " To connect to shell in this instance run: docker exec -it $( docker ps | grep asylum_test | awk ' {print $1}' ) /bin/bash"
10
+ echo " Then in that shell run: source ../asylum-venv/bin/activate"
11
+ docker run --rm --name asylum_test -it -p 8000:8000 -p 1080:1080 asylum_test
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
+ SCRIPTDIR=$( python -c ' import os,sys;print os.path.dirname(os.path.realpath(sys.argv[1]))' " $0 " )
2
3
# Make sure the id is here
3
4
if [ " $1 " == " " ]
4
5
then
5
6
echo " Usage:\n test_pull_request.sh ID\n"
6
7
exit 1
7
8
fi
8
9
ID=$1
10
+ CURRENT_BRANCH=` git rev-parse --abbrev-ref HEAD`
11
+
12
+ # Make sure we're in the correct place to run git commands no matter where we were called from
13
+ cd ` dirname " $SCRIPTDIR " `
9
14
10
15
# Make sure we have upstream
11
16
git remote | grep -q upstream
15
20
fi
16
21
17
22
git fetch upstream master
23
+
24
+ # Local branch exists, remove it
25
+ git rev-parse --verify test-$ID
26
+ if [ " $? " == " 0" ]
27
+ then
28
+ git branch -D test-$ID
29
+ fi
30
+
18
31
git fetch upstream pull/$ID /head:test-$ID
19
32
if [ " $? " != " 0" ]
20
33
then
21
34
exit 1
22
35
fi
36
+
37
+ # Store current branch
38
+ BRANCH=` git rev-parse --abbrev-ref HEAD`
39
+
23
40
set -e
24
41
git checkout test-$ID
25
42
git rebase upstream/master
26
43
27
- docker build -t asylum_test .
28
- echo " Starting test server."
29
- echo " To gain shell, run: docker exec -it asylum_test bash"
30
- docker run --rm --name asylum_test -it -p 8000:8000 -p 1080:1080 asylum_test
44
+ # Call the generic start script
45
+ $SCRIPTDIR /start.sh
46
+
47
+ git checkout $BRANCH
48
+ git branch -D test-$ID
49
+ echo " Temporary branch test-$ID was removed, to check it out again run: git fetch upstream pull/$ID /head:test-$ID "
You can’t perform that action at this time.
0 commit comments