Skip to content

Commit 663a77b

Browse files
committed
updated dependencies, deploy to zeit
1 parent 8cbc4df commit 663a77b

File tree

5 files changed

+59
-28
lines changed

5 files changed

+59
-28
lines changed

Gemfile.lock

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,35 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
backports (3.11.3)
4+
activesupport (5.2.1.1)
5+
concurrent-ruby (~> 1.0, >= 1.0.2)
6+
i18n (>= 0.7, < 2)
7+
minitest (~> 5.1)
8+
tzinfo (~> 1.1)
9+
backports (3.11.4)
10+
concurrent-ruby (1.1.3)
511
daemons (1.2.6)
6-
eventmachine (1.2.5)
12+
eventmachine (1.2.7)
13+
i18n (1.1.1)
14+
concurrent-ruby (~> 1.0)
15+
minitest (5.11.3)
716
multi_json (1.13.1)
8-
mustermann (1.0.2)
9-
rack (2.0.4)
10-
rack-protection (2.0.1)
17+
mustermann (1.0.3)
18+
rack (2.0.6)
19+
rack-protection (2.0.4)
1120
rack
12-
sinatra (2.0.1)
21+
sinatra (2.0.4)
1322
mustermann (~> 1.0)
1423
rack (~> 2.0)
15-
rack-protection (= 2.0.1)
24+
rack-protection (= 2.0.4)
1625
tilt (~> 2.0)
17-
sinatra-contrib (2.0.1)
18-
backports (>= 2.0)
26+
sinatra-contrib (2.0.4)
27+
activesupport (>= 4.0.0)
28+
backports (>= 2.8.2)
1929
multi_json
2030
mustermann (~> 1.0)
21-
rack-protection (= 2.0.1)
22-
sinatra (= 2.0.1)
31+
rack-protection (= 2.0.4)
32+
sinatra (= 2.0.4)
2333
tilt (>= 1.3, < 3)
2434
sinatra-jsonp (0.5.0)
2535
multi_json (~> 1.8)
@@ -28,7 +38,10 @@ GEM
2838
daemons (~> 1.0, >= 1.0.9)
2939
eventmachine (~> 1.0, >= 1.0.4)
3040
rack (>= 1, < 3)
31-
tilt (2.0.8)
41+
thread_safe (0.3.6)
42+
tilt (2.0.9)
43+
tzinfo (1.2.5)
44+
thread_safe (~> 0.1)
3245

3346
PLATFORMS
3447
ruby
@@ -40,7 +53,7 @@ DEPENDENCIES
4053
thin
4154

4255
RUBY VERSION
43-
ruby 2.3.1p112
56+
ruby 2.3.7p456
4457

4558
BUNDLED WITH
46-
1.16.1
59+
1.17.1

deploy.sh

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
#!/bin/bash
22
#
3-
# deploy the xregexp backend to zeit
3+
# deploy the ruby backend to zeit
44
#
55

6-
heroku container:push --app regexplanet-postgresql web
6+
#set -o errexit
7+
set -o pipefail
8+
set -o nounset
79

10+
LASTMOD=$(date -u +%Y-%m-%dT%H:%M:%SZ)
11+
grep -q "^LASTMOD=" .env
12+
if [ $? -ne 0 ]; then
13+
echo "LASTMOD=$LASTMOD" >> .env
14+
else
15+
sed -i -e "s/^LASTMOD=.*$/LASTMOD=$LASTMOD/g" .env
16+
fi
817

9-
#echo "INFO: listing existing versions"
10-
#now ls regexplanet-postgresql
18+
COMMIT=$(git rev-parse --short HEAD)
19+
grep -q "^COMMIT=" .env
20+
if [ $? -ne 0 ]; then
21+
echo "COMMIT=$COMMIT" >> .env
22+
else
23+
sed -i -e "s/^COMMIT=.*$/COMMIT=$COMMIT/g" .env
24+
fi
1125

12-
#echo "INFO: deploying"
13-
#now && now alias
1426

15-
#
16-
# need to kill the old version!
17-
#
18-
#echo "INFO: removing the old version "
19-
#echo "WARNING: must be done manually with 'now rm'"
27+
now --public --dotenv && now alias && now rm $(cat ./now.json | jq '.name' --raw-output) --safe --yes

now.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
2-
"name": "regexplanet-ruby",
3-
"alias": "regexplanet-ruby.now.sh"
2+
"name": "regexplanet-ruby",
3+
"alias": "regexplanet-ruby.now.sh",
4+
"features": {
5+
"cloud": "v2"
6+
},
7+
"type": "docker"
48
}

regexplanet.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def get_or_post(path, opts={}, &block)
3131
jsonp( {
3232
:success => true,
3333
:message => "OK",
34+
:commit => ENV['COMMIT'],
35+
:lastmod => ENV['LASTMOD'],
3436
:version => RUBY_VERSION,
3537
"request.host" => request.host,
3638
"request.port" => request.port,

run.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22

33

44
docker build -t regexplanet-ruby .
5-
docker run -p 4000:4000 --expose 4000 -e PORT='4000' regexplanet-ruby
5+
docker run \
6+
-p 4000:4000 --expose 4000 -e PORT='4000' \
7+
-e COMMIT=$(git rev-parse --short HEAD) \
8+
-e LASTMOD=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
9+
regexplanet-ruby

0 commit comments

Comments
 (0)