forked from mongodb/mongoid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·48 lines (34 loc) · 1.12 KB
/
release.sh
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
#!/bin/sh
set -e
NAME=mongoid
RELEASE_NAME=mongoid-release
VERSION_REQUIRE=mongoid/version
VERSION_CONSTANT_NAME=Mongoid::VERSION
if ! test -f gem-private_key.pem; then
echo "gem-private_key.pem missing - cannot release" 1>&2
exit 1
fi
VERSION=`ruby -Ilib -r$VERSION_REQUIRE -e "puts $VERSION_CONSTANT_NAME"`
echo "Releasing $NAME $VERSION"
echo
for variant in mri; do
docker build -f release/$variant/Dockerfile -t $RELEASE_NAME-$variant .
docker kill $RELEASE_NAME-$variant || true
docker container rm $RELEASE_NAME-$variant || true
docker run -d --name $RELEASE_NAME-$variant -it $RELEASE_NAME-$variant
docker exec $RELEASE_NAME-$variant /app/release/$variant/build.sh
if test $variant = jruby; then
docker cp $RELEASE_NAME-$variant:/app/pkg/$NAME-$VERSION-java.gem .
else
docker cp $RELEASE_NAME-$variant:/app/pkg/$NAME-$VERSION.gem .
fi
docker kill $RELEASE_NAME-$variant
done
echo
echo Built: $NAME-$VERSION.gem
#echo Built: $NAME-$VERSION-java.gem
echo
git tag -a v$VERSION -m "Tagging release: $VERSION"
git push origin v$VERSION
gem push $NAME-$VERSION.gem
#gem push $NAME-$VERSION-java.gem