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
1
3
.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
2
2
3
3
# throw errors if Gemfile has been modified since Gemfile.lock
4
4
RUN bundle config --global frozen 1
@@ -10,6 +10,11 @@ RUN bundle install
10
10
11
11
COPY . .
12
12
13
+ ARG COMMIT="(not set)"
14
+ ARG LASTMOD="(not set)"
15
+ ENV COMMIT=$COMMIT
16
+ ENV LASTMOD=$LASTMOD
17
+
13
18
EXPOSE 4567
14
19
CMD ["./regexplanet.rb" ]
15
20
Original file line number Diff line number Diff line change 1
1
source "https://rubygems.org"
2
- ruby '2.5.7 '
2
+ ruby '2.7.1 '
3
3
gem 'sinatra'
4
4
gem 'sinatra-contrib'
5
5
gem 'sinatra-jsonp'
6
- gem 'thin'
Original file line number Diff line number Diff line change 1
1
GEM
2
2
remote: https://rubygems.org/
3
3
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 )
20
10
rack
21
- sinatra (2.0.4 )
11
+ ruby2_keywords (0.0.2 )
12
+ sinatra (2.0.8.1 )
22
13
mustermann (~> 1.0 )
23
14
rack (~> 2.0 )
24
- rack-protection (= 2.0.4 )
15
+ rack-protection (= 2.0.8.1 )
25
16
tilt (~> 2.0 )
26
- sinatra-contrib (2.0.4 )
27
- activesupport (>= 4.0.0 )
17
+ sinatra-contrib (2.0.8.1 )
28
18
backports (>= 2.8.2 )
29
19
multi_json
30
20
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 )
34
24
sinatra-jsonp (0.5.0 )
35
25
multi_json (~> 1.8 )
36
26
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 )
45
28
46
29
PLATFORMS
47
30
ruby
@@ -50,10 +33,9 @@ DEPENDENCIES
50
33
sinatra
51
34
sinatra-contrib
52
35
sinatra-jsonp
53
- thin
54
36
55
37
RUBY VERSION
56
- ruby 2.5.3p105
38
+ ruby 2.7.1p83
57
39
58
40
BUNDLED 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/ )
2
2
3
3
This is the Ruby backend for RegexPlanet, a tool for online regular expression testing.
4
4
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 .
6
6
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 .
8
8
9
9
## Notes
10
10
11
11
* [ 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 )
12
13
13
14
## 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 ")
14
20
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