Skip to content

Commit b176325

Browse files
committed
install-gems.sh is updated with the latest version
1 parent eda01cf commit b176325

File tree

1 file changed

+8
-60
lines changed

1 file changed

+8
-60
lines changed

install-gems.sh

Lines changed: 8 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,78 +2,26 @@
22

33
set -e
44

5-
if [ -z ${GEM_AUTHORITY_PATH+x} ]; then
6-
echo "GEM_AUTHORITY_PATH is not set"
7-
exit
8-
fi
9-
10-
echo
11-
echo 'Installing local gems'
12-
echo '= = ='
13-
14-
source ./set-local-gem-path.sh
15-
16-
echo
17-
echo 'Removing gem files'
18-
echo '- - -'
19-
if test -n "$(find . -maxdepth 1 -name '*.gem' -print -quit)"; then
20-
for gem in *.gem; do
21-
echo "- $gem"
22-
rm $gem
23-
done
24-
else
25-
echo "(No gem files found)"
26-
fi
27-
28-
echo
29-
echo 'Building gems'
30-
echo '- - -'
31-
for gemspec in *.gemspec; do
32-
echo "- $gemspec"
33-
gem build $gemspec
34-
done
35-
365
if [ -z ${POSTURE+x} ]; then
376
echo "(POSTURE is not set. Using \"operational\" by default.)"
387
posture="operational"
398
else
409
posture=$POSTURE
4110
fi
4211

43-
scheme="https:"
44-
gem_repo_authority_path=$GEM_AUTHORITY_PATH
45-
public_gem_repo_uri="$scheme//$gem_repo_authority_path"
12+
echo
13+
echo "Installing gems locally (posture: $posture)"
14+
echo '= = ='
4615

47-
gemfury_token=""
48-
if [ ! -z ${GEMFURY_TOKEN+x} ]; then
49-
gemfury_token=$GEMFURY_TOKEN
50-
fi
16+
cmd="bundle install --standalone --path=./gems"
5117

52-
private_source=""
53-
if [ ! $gemfury_token = "" ]; then
54-
private_gem_repo_uri="$scheme//$gemfury_token@$gem_repo_authority_path"
55-
private_source="--source $private_gem_repo_uri"
18+
if [ operational == "$posture" ]; then
19+
cmd="$cmd --without=development"
5620
fi
5721

58-
public_source="--source $public_gem_repo_uri"
59-
60-
ruby_gems_source="--source https://rubygems.org"
22+
echo $cmd
23+
($cmd)
6124

62-
echo
63-
echo "Installing gems locally (posture: $posture)"
6425
echo '- - -'
65-
for gem in *.gem; do
66-
echo "($gem)"
67-
cmd="gem install $gem --clear-sources $private_source $public_source $ruby_gems_source --install-dir ./gems"
68-
69-
if [ operational != "$posture" ]; then
70-
cmd="$cmd --development"
71-
fi
72-
73-
echo $cmd
74-
($cmd) || exit 1
75-
done
76-
77-
echo '= = ='
7826
echo '(done)'
7927
echo

0 commit comments

Comments
 (0)