forked from instructure/pandarus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-all
executable file
·54 lines (47 loc) · 1.23 KB
/
build-all
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
pushd `dirname $0` > /dev/null
SCRIPT_DIR=`pwd`
popd > /dev/null
# Set CANVAS_DIR if not set in the environment
: ${CANVAS_DIR:="$SCRIPT_DIR/../canvas-lms"}
# Build the Canvas API docs and corresponding JSON files.
#
# Comment this out if you don't want to re-generate the Canvas API spec.
set -x
cd "$CANVAS_DIR" && (
set +x
echo `pwd`
set -x
CANVAS_DOMAIN="https://canvas.instructure.com" bundle exec rake doc:api
)
# Remove the pandarus/api directory and re-populate it with JSON
# files from the Canvas "rake doc:api" process.
#
# Comment this out if you don't want to overwrite the Pandarus gem's built-in
# Canvas API spec.
cd "$SCRIPT_DIR" && (
set +x
echo `pwd`
set -x
rm -rf ./api &&
mkdir api &&
cp ${CANVAS_DIR}/public/doc/api/*.json api/
ruby normalize-manifest
)
# Build the Ruby gem and install it locally
cd "$SCRIPT_DIR" && (
set +x
echo `pwd`
echo "rm -f ./clients/ruby/lib/pandarus/models/*.rb"
rm -f ./clients/ruby/lib/pandarus/models/*.rb
set -x
mvn clean package scala:run -Dlauncher=ruby-codegen &&
(
cd clients/ruby
GEMFILE=$(gem build pandarus.gemspec | fgrep -i 'FILE:' | awk '{ print $2 }')
gem install $GEMFILE
)
pushd clients/ruby
bundle exec rspec
popd
)