|
|
@@ -1,11 +1,25 @@
|
|
1
|
1
|
#!/bin/bash
|
|
2
|
2
|
|
|
|
3
|
+# Local clean-up
|
|
|
4
|
+rm -rf ~/workspace/exercism/x-api
|
|
|
5
|
+killall ruby
|
|
|
6
|
+
|
|
|
7
|
+set -e
|
|
|
8
|
+
|
|
|
9
|
+export GOPATH=$HOME/workspace
|
|
|
10
|
+REPO_ROOT=~/workspace/exercism/xjava
|
|
|
11
|
+EXERCISM_HOME=~/workspace/exercism/exercises
|
|
|
12
|
+SET_RUBY_VER_CMD="rbenv local 2.2.1"
|
|
|
13
|
+
|
|
|
14
|
+mkdir -p ~/workspace/exercism
|
|
|
15
|
+cd ~/workspace/exercism/
|
|
3
|
16
|
git clone https://github.com/exercism/x-api
|
|
4
|
17
|
cd x-api
|
|
5
|
18
|
git submodule init -- metadata
|
|
6
|
19
|
git submodule init -- tracks/java
|
|
7
|
20
|
git submodule update
|
|
8
|
21
|
|
|
|
22
|
+$SET_RUBY_VER_CMD
|
|
9
|
23
|
gem install bundler
|
|
10
|
24
|
bundle install
|
|
11
|
25
|
|
|
|
@@ -13,19 +27,23 @@ RACK_ENV=development rackup&
|
|
13
|
27
|
|
|
14
|
28
|
sleep 5
|
|
15
|
29
|
|
|
16
|
|
-export GOPATH=$HOME/workspace
|
|
17
|
30
|
export PATH=$PATH:$GOPATH/bin
|
|
18
|
31
|
go get -u github.com/exercism/cli/exercism
|
|
19
|
32
|
exercism -v
|
|
20
|
33
|
|
|
21
|
|
-cd ~
|
|
22
|
|
-mkdir -p workspace/exercism/exercises
|
|
23
|
|
-cd ~/workspace/exercism/exercises
|
|
24
|
|
-exercism configure --dir=~/workspace/exercism/exercises
|
|
|
34
|
+mkdir -p $EXERCISM_HOME
|
|
|
35
|
+cd $EXERCISM_HOME
|
|
|
36
|
+exercism configure --dir=$EXERCISM_HOME
|
|
25
|
37
|
exercism configure --api http://localhost:9292
|
|
26
|
38
|
|
|
27
|
|
-curl -v 'localhost:9292/v2/exercises/java/bob'
|
|
|
39
|
+exercism debug
|
|
|
40
|
+
|
|
|
41
|
+cd $REPO_ROOT
|
|
|
42
|
+EXERCISES=`cat config.json | jq '.problems []' --raw-output`
|
|
28
|
43
|
|
|
29
|
|
-exercism --verbose debug
|
|
30
|
|
-exercism --verbose fetch java bob
|
|
31
|
|
-tree java
|
|
|
44
|
+for EXERCISE in $EXERCISES; do
|
|
|
45
|
+ exercism fetch java $EXERCISE
|
|
|
46
|
+ cp -R -H $REPO_ROOT/exercises/$EXERCISE/src/example/java/* $EXERCISM_HOME/java/$EXERCISE/src/main/java/
|
|
|
47
|
+ cd $EXERCISM_HOME/java/$EXERCISE/
|
|
|
48
|
+ gradle test
|
|
|
49
|
+done
|