File tree Expand file tree Collapse file tree 12 files changed +116
-63
lines changed Expand file tree Collapse file tree 12 files changed +116
-63
lines changed Original file line number Diff line number Diff line change 1+ .dockerignore
2+ .editorconfig
13.git /
2- README.md
4+ .github /
5+ .gitignore
6+ Dockerfile
7+ LICENSE.txt
8+ * .md
9+ * .sh
Original file line number Diff line number Diff line change 1+ name : Build and deploy to Google Cloud Run
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+
8+ # Environment variables available to all jobs and steps in this workflow
9+ env :
10+ PROJECT_ID : ${{ secrets.RUN_PROJECT }}
11+ RUN_REGION : ${{ secrets.RUN_REGION }}
12+ SERVICE_NAME : ${{ secrets.RUN_SERVICE }}
13+
14+ jobs :
15+ setup-build-deploy :
16+ name : Setup, Build, and Deploy
17+ runs-on : ubuntu-latest
18+
19+ steps :
20+ - name : Checkout
21+ uses : actions/checkout@v1
22+
23+ # Setup gcloud CLI
24+ - uses : GoogleCloudPlatform/github-actions/setup-gcloud@master
25+ with :
26+ version : ' 275.0.0'
27+ service_account_email : ${{ secrets. GCP_SA_EMAIL }}
28+ service_account_key : ${{ secrets. GCP_SA_KEY }}
29+
30+ # Configure gcloud CLI
31+ - name : gcloud Set up
32+ run : |
33+ gcloud config set project $PROJECT_ID
34+
35+ # Build and push image to Google Container Registry
36+ - name : Build
37+ run : |
38+ docker build \
39+ --build-arg COMMIT=${GITHUB_SHA:0:7} \
40+ --build-arg LASTMOD=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
41+ --tag gcr.io/$PROJECT_ID/$SERVICE_NAME:$GITHUB_SHA .
42+
43+ - name : GCloud auth to docker
44+ run : |
45+ gcloud auth configure-docker
46+
47+ - name : Push to registry
48+ run : |
49+ docker push gcr.io/$PROJECT_ID/$SERVICE_NAME:$GITHUB_SHA
50+
51+ # Deploy image to Cloud Run
52+ - name : Deploy
53+ run : |
54+ gcloud run deploy $SERVICE_NAME \
55+ --allow-unauthenticated \
56+ --image gcr.io/$PROJECT_ID/$SERVICE_NAME:$GITHUB_SHA \
57+ --platform managed \
58+ --project ${PROJECT_ID} \
59+ --region $RUN_REGION
Original file line number Diff line number Diff line change 1- FROM ruby:2.5.7
1+ FROM ruby:2.7.1
22
33# throw errors if Gemfile has been modified since Gemfile.lock
44RUN bundle config --global frozen 1
@@ -10,6 +10,11 @@ RUN bundle install
1010
1111COPY . .
1212
13+ ARG COMMIT="(not set)"
14+ ARG LASTMOD="(not set)"
15+ ENV COMMIT=$COMMIT
16+ ENV LASTMOD=$LASTMOD
17+
1318EXPOSE 4567
1419CMD ["./regexplanet.rb" ]
1520
Original file line number Diff line number Diff line change 11source "https://rubygems.org"
2- ruby '2.5.7 '
2+ ruby '2.7.1 '
33gem 'sinatra'
44gem 'sinatra-contrib'
55gem 'sinatra-jsonp'
6- gem 'thin'
Original file line number Diff line number Diff line change 11GEM
22 remote: https://rubygems.org/
33 specs:
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 )
11- daemons (1.2.6 )
12- eventmachine (1.2.7 )
13- i18n (1.1.1 )
14- concurrent-ruby (~> 1.0 )
15- minitest (5.11.3 )
16- multi_json (1.13.1 )
17- mustermann (1.0.3 )
18- rack (2.0.8 )
19- rack-protection (2.0.4 )
4+ backports (3.17.2 )
5+ multi_json (1.14.1 )
6+ mustermann (1.1.1 )
7+ ruby2_keywords (~> 0.0.1 )
8+ rack (2.2.2 )
9+ rack-protection (2.0.8.1 )
2010 rack
21- sinatra (2.0.4 )
11+ ruby2_keywords (0.0.2 )
12+ sinatra (2.0.8.1 )
2213 mustermann (~> 1.0 )
2314 rack (~> 2.0 )
24- rack-protection (= 2.0.4 )
15+ rack-protection (= 2.0.8.1 )
2516 tilt (~> 2.0 )
26- sinatra-contrib (2.0.4 )
27- activesupport (>= 4.0.0 )
17+ sinatra-contrib (2.0.8.1 )
2818 backports (>= 2.8.2 )
2919 multi_json
3020 mustermann (~> 1.0 )
31- rack-protection (= 2.0.4 )
32- sinatra (= 2.0.4 )
33- tilt (>= 1.3 , < 3 )
21+ rack-protection (= 2.0.8.1 )
22+ sinatra (= 2.0.8.1 )
23+ tilt (~> 2.0 )
3424 sinatra-jsonp (0.5.0 )
3525 multi_json (~> 1.8 )
3626 sinatra (>= 1.0 )
37- thin (1.7.2 )
38- daemons (~> 1.0 , >= 1.0.9 )
39- eventmachine (~> 1.0 , >= 1.0.4 )
40- rack (>= 1 , < 3 )
41- thread_safe (0.3.6 )
42- tilt (2.0.9 )
43- tzinfo (1.2.5 )
44- thread_safe (~> 0.1 )
27+ tilt (2.0.10 )
4528
4629PLATFORMS
4730 ruby
@@ -50,10 +33,9 @@ DEPENDENCIES
5033 sinatra
5134 sinatra-contrib
5235 sinatra-jsonp
53- thin
5436
5537RUBY VERSION
56- ruby 2.5.3p105
38+ ruby 2.7.1p83
5739
5840BUNDLED WITH
59- 1.16.2
41+ 2.1.4
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- # regexplanet- ruby
1+ # RegexPlanet Ruby [ < img alt = " Ruby Logo " src = " https://www.vectorlogo.zone/logos/ruby-lang/ ruby-lang-icon.svg " height = " 90 " align = " right " /> ] ( https://www.ruby-lang.org/ )
22
33This is the Ruby backend for RegexPlanet, a tool for online regular expression testing.
44
5- See [ API docs ] ( http://www.regexplanet.com/support/api .html ) for what it is supposed to do .
5+ Use [ Ruby online regex test page ] ( http://www.regexplanet.com/advanced/ruby/index .html ) to test your regular expressions .
66
7- See [ Ruby online regex test page ] ( http://www.regexplanet.com/advanced/ruby/index .html ) to use it to test your regular expressions .
7+ See the [ API docs ] ( http://www.regexplanet.com/support/api .html ) for what it is supposed to do .
88
99## Notes
1010
1111 * [ Ruby on Docker] ( https://docs.docker.com/samples/library/ruby/ )
12+ * [ updating Gemfile.lock] ( https://stackoverflow.com/questions/13101945/how-to-re-sync-gemfile-lock-on-changes-to-gemfile/13102274#13102274 )
1213
1314## Credits
15+ [ ![ Docker] ( https://www.vectorlogo.zone/logos/docker/docker-ar21.svg )] ( https://www.docker.com/ " Deployment ")
16+ [ ![ Git] ( https://www.vectorlogo.zone/logos/git-scm/git-scm-ar21.svg )] ( https://git-scm.com/ " Version control ")
17+ [ ![ Github] ( https://www.vectorlogo.zone/logos/github/github-ar21.svg )] ( https://github.com/ " Code hosting ")
18+ [ ![ Google Cloud Run] ( https://www.vectorlogo.zone/logos/google_cloud_run/google_cloud_run-ar21.svg )] ( https://cloud.google.com/run/ " Hosting ")
19+ [ ![ Ruby] ( https://www.vectorlogo.zone/logos/ruby-lang/ruby-lang-ar21.svg )] ( https://www.ruby-lang.org/ " Code ")
1420
15- * Ruby
16- * Docker
17- * Zeit
18- * Sinatra
21+ * [ Bundler ] ( https://bundler.io/ )
22+ * [ Rack ] ( https://rack.github.io/ )
23+ * [ RubyGems ] ( https://rubygems.org/ )
24+ * [ Sinatra] ( http://sinatrarb.com/ )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+
4+ docker build -t regexplanet-ruby .
5+ docker run \
6+ --expose 4000 \
7+ --env COMMIT=$( git rev-parse --short HEAD) -local \
8+ --env LASTMOD=$( date -u +%Y-%m-%dT%H:%M:%SZ) \
9+ --env PORT=' 4000' \
10+ --publish 4000:4000 \
11+ regexplanet-ruby
12+
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments