diff --git a/Dockerfile b/Dockerfile index 5afb026..bc4f5a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,47 +1,30 @@ -FROM centos +FROM registry.redhat.io/ubi8/ruby-27:1-95 -LABEL io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \ - io.s2i.scripts-url="image:///usr/libexec/s2i" - -RUN curl -sL -o /etc/yum.repos.d/centos-essentials.repo https://gist.githubusercontent.com/marekjelen/c08a3c3a548820144f2da01d2bad6279/raw/centos-essentials.repo -ENV PATH=/opt/essentials/bin:$PATH - -RUN yum update -y && \ - yum install --setopt=tsflags=nodocs -y essentials-ruby bundler \ - gcc gcc-c++ libxml2-devel sqlite-devel git && \ - yum clean all && \ - rm -rf /var/cache/yum - -RUN gem update --system --no-document && \ - gem update bundler --no-document - -RUN mkdir -p /usr/libexec/s2i - -COPY s2i/assemble s2i/run /usr/libexec/s2i/ - -RUN chmod 777 /usr/libexec/s2i/{assemble,run} +USER root ENV RAILS_ENV=production +ENV HOME=/workshopper -RUN useradd -u 1001 -g 0 -M -d /workshopper workshopper +RUN mkdir -p /workshopper \ + && chown default:root /workshopper \ + && chmod 777 /workshopper -RUN mkdir -p /workshopper && chown workshopper:root /workshopper && chmod 777 /workshopper +USER default -USER workshopper WORKDIR /workshopper -ADD --chown=workshopper:root Gemfile Gemfile.lock ./ +ADD --chown=default:root Gemfile Gemfile.lock ./ +RUN bundle lock --add-platform x86_64-linux && \ + bundle config set --local deployment 'true' && \ + bundle install -RUN bundle install --deployment - -ADD --chown=workshopper:root . . +ADD --chown=default:root . . RUN bundle exec rake assets:precompile RUN rm -rf tmp log && mkdir -p tmp log && chmod -R 0777 tmp log -ENV HOME=/workshopper EXPOSE 8080 -CMD ./boot.sh \ No newline at end of file +CMD ./boot.sh diff --git a/DockerfileToGenerateGemfile_lock b/DockerfileToGenerateGemfile_lock new file mode 100644 index 0000000..1eedfc9 --- /dev/null +++ b/DockerfileToGenerateGemfile_lock @@ -0,0 +1,16 @@ +FROM registry.redhat.io/ubi8/ruby-27:1-95 + +USER root + +ENV RAILS_ENV=production +ENV HOME=/workshopper + +RUN mkdir -p /workshopper \ + && chown default:root /workshopper \ + && chmod 777 /workshopper + +USER default +WORKDIR /workshopper + +ADD --chown=default:root Gemfile ./ +RUN bundle lock --add-platform x86_64-linux \ No newline at end of file diff --git a/Gemfile b/Gemfile index 32c9ed0..f73b5f6 100644 --- a/Gemfile +++ b/Gemfile @@ -31,9 +31,7 @@ platforms :jruby do gem 'activerecord-jdbcsqlite3-adapter' end -source 'https://rails-assets.org' do - gem 'rails-assets-chartjs' -end +gem 'rails-assets-chartjs', '2.1.1', source: 'https://rails-assets.org' group :development, :test do gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] diff --git a/Gemfile.lock b/Gemfile.lock index f7d2d92..9cd108d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,67 +1,65 @@ GEM - remote: https://rubygems.org/ remote: https://rails-assets.org/ specs: - actioncable (5.2.2) - actionpack (= 5.2.2) + rails-assets-chartjs (2.1.1) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.2.8.1) + actionpack (= 5.2.8.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.2) - actionpack (= 5.2.2) - actionview (= 5.2.2) - activejob (= 5.2.2) + actionmailer (5.2.8.1) + actionpack (= 5.2.8.1) + actionview (= 5.2.8.1) + activejob (= 5.2.8.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.2) - actionview (= 5.2.2) - activesupport (= 5.2.2) - rack (~> 2.0) + actionpack (5.2.8.1) + actionview (= 5.2.8.1) + activesupport (= 5.2.8.1) + rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.2) - activesupport (= 5.2.2) + actionview (5.2.8.1) + activesupport (= 5.2.8.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.2.2) - activesupport (= 5.2.2) + activejob (5.2.8.1) + activesupport (= 5.2.8.1) globalid (>= 0.3.6) - activemodel (5.2.2) - activesupport (= 5.2.2) - activerecord (5.2.2) - activemodel (= 5.2.2) - activesupport (= 5.2.2) + activemodel (5.2.8.1) + activesupport (= 5.2.8.1) + activerecord (5.2.8.1) + activemodel (= 5.2.8.1) + activesupport (= 5.2.8.1) arel (>= 9.0) - activerecord-jdbc-adapter (52.1-java) - activerecord (~> 5.2.0) - activerecord-jdbcsqlite3-adapter (52.1-java) - activerecord-jdbc-adapter (= 52.1) - jdbc-sqlite3 (~> 3.8, < 3.30) - activestorage (5.2.2) - actionpack (= 5.2.2) - activerecord (= 5.2.2) - marcel (~> 0.3.1) - activesupport (5.2.2) + activestorage (5.2.8.1) + actionpack (= 5.2.8.1) + activerecord (= 5.2.8.1) + marcel (~> 1.0.0) + activesupport (5.2.8.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) arel (9.0.0) - asciidoctor (1.5.8) - autoprefixer-rails (9.4.7) - execjs - bcrypt (3.1.12) - bcrypt (3.1.12-java) - bindex (0.5.0) - bootstrap (4.2.1) + asciidoctor (2.0.18) + autoprefixer-rails (10.4.13.0) + execjs (~> 2) + bcrypt (3.1.18) + bindex (0.8.1) + bootstrap (4.6.2) autoprefixer-rails (>= 9.1.0) - popper_js (>= 1.14.3, < 2) + popper_js (>= 1.16.1, < 2) sassc-rails (>= 2.0.0) - builder (3.2.3) - byebug (10.0.2) - coderay (1.1.2) + builder (3.2.4) + byebug (11.1.3) + coderay (1.1.3) coffee-rails (4.2.2) coffee-script (>= 2.2.0) railties (>= 4.0.0) @@ -69,154 +67,155 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.4) - crass (1.0.4) - erubi (1.8.0) - excon (0.62.0) - execjs (2.7.0) - faraday (0.15.4) - multipart-post (>= 1.2, < 3) - ffi (1.9.25) - ffi (1.9.25-java) - font-awesome-rails (4.7.0.4) - railties (>= 3.2, < 6.0) - globalid (0.4.2) - activesupport (>= 4.2.0) - i18n (1.5.3) + concurrent-ruby (1.2.2) + crass (1.0.6) + date (3.3.3) + erubi (1.12.0) + excon (0.99.0) + execjs (2.8.1) + faraday (2.7.4) + faraday-net_http (>= 2.0, < 3.1) + ruby2_keywords (>= 0.0.4) + faraday-net_http (3.0.2) + ffi (1.15.5) + font-awesome-rails (4.7.0.8) + railties (>= 3.2, < 8.0) + globalid (1.1.0) + activesupport (>= 5.0) + i18n (1.12.0) concurrent-ruby (~> 1.0) - jbuilder (2.8.0) - activesupport (>= 4.2.0) - multi_json (>= 1.2) - jdbc-sqlite3 (3.20.1) - jquery-rails (4.3.3) + jbuilder (2.11.5) + actionview (>= 5.0.0) + activesupport (>= 5.0.0) + jquery-rails (4.5.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - kramdown (2.0.0) - libv8 (6.7.288.46.1) - liquid (4.0.1) + kramdown (2.4.0) + rexml + libv8-node (16.10.0.0-x86_64-linux) + liquid (5.4.0) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) - loofah (2.2.3) + loofah (2.20.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.7.1) + mail (2.8.1) mini_mime (>= 0.1.1) - marcel (0.3.3) - mimemagic (~> 0.3.2) - method_source (0.9.2) - mimemagic (0.3.3) - mini_mime (1.0.1) - mini_portile2 (2.4.0) - mini_racer (0.2.4) - libv8 (>= 6.3) - minitest (5.11.3) - multi_json (1.13.1) - multipart-post (2.0.0) - nio4r (2.3.1) - nio4r (2.3.1-java) - nokogiri (1.10.1) - mini_portile2 (~> 2.4.0) - nokogiri (1.10.1-java) - popper_js (1.14.5) - puma (3.12.0) - puma (3.12.0-java) - rack (2.0.6) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (5.2.2) - actioncable (= 5.2.2) - actionmailer (= 5.2.2) - actionpack (= 5.2.2) - actionview (= 5.2.2) - activejob (= 5.2.2) - activemodel (= 5.2.2) - activerecord (= 5.2.2) - activestorage (= 5.2.2) - activesupport (= 5.2.2) + net-imap + net-pop + net-smtp + marcel (1.0.2) + method_source (1.0.0) + mini_mime (1.1.2) + mini_racer (0.6.3) + libv8-node (~> 16.10.0.0) + minitest (5.18.0) + net-imap (0.3.4) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.1) + timeout + net-smtp (0.3.3) + net-protocol + nio4r (2.5.9) + nokogiri (1.14.3-x86_64-linux) + racc (~> 1.4) + popper_js (1.16.1) + puma (3.12.6) + racc (1.6.2) + rack (2.2.6.4) + rack-test (2.1.0) + rack (>= 1.3) + rails (5.2.8.1) + actioncable (= 5.2.8.1) + actionmailer (= 5.2.8.1) + actionpack (= 5.2.8.1) + actionview (= 5.2.8.1) + activejob (= 5.2.8.1) + activemodel (= 5.2.8.1) + activerecord (= 5.2.8.1) + activestorage (= 5.2.8.1) + activesupport (= 5.2.8.1) bundler (>= 1.3.0) - railties (= 5.2.2) + railties (= 5.2.8.1) sprockets-rails (>= 2.0.0) - rails-assets-chartjs (2.7.3) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.0.4) - loofah (~> 2.2, >= 2.2.2) - railties (5.2.2) - actionpack (= 5.2.2) - activesupport (= 5.2.2) + rails-html-sanitizer (1.5.0) + loofah (~> 2.19, >= 2.19.1) + railties (5.2.8.1) + actionpack (= 5.2.8.1) + activesupport (= 5.2.8.1) method_source rake (>= 0.8.7) thor (>= 0.19.0, < 2.0) - rake (12.3.2) - rb-fsevent (0.10.3) - rb-inotify (0.10.0) + rake (13.0.6) + rb-fsevent (0.11.2) + rb-inotify (0.10.1) ffi (~> 1.0) - redis (4.1.0) + redis (4.8.1) + rexml (3.2.5) + ruby2_keywords (0.0.5) ruby_dep (1.5.0) - sass (3.7.3) + sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - sass-rails (5.0.7) - railties (>= 4.0.0, < 6) + sass-rails (5.1.0) + railties (>= 5.2.0) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - sassc (2.0.0) - ffi (~> 1.9.6) - rake - sassc-rails (2.1.0) + sassc (2.4.0) + ffi (~> 1.9) + sassc-rails (2.1.2) railties (>= 4.0.0) sassc (>= 2.0) sprockets (> 3.0) sprockets-rails tilt - spring (2.0.2) - activesupport (>= 4.2) + spring (2.1.1) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.1) - actionpack (>= 4.0) - activesupport (>= 4.0) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.3.13) - thor (0.20.3) + sqlite3 (1.6.2-x86_64-linux) + thor (1.2.1) thread_safe (0.3.6) - thread_safe (0.3.6-java) - tilt (2.0.9) - turbolinks (5.2.0) + tilt (2.1.0) + timeout (0.3.2) + turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) - tzinfo (1.2.5) + tzinfo (1.2.11) thread_safe (~> 0.1) - tzinfo-data (1.2018.9) - tzinfo (>= 1.0.0) - uglifier (4.1.20) + uglifier (4.2.0) execjs (>= 0.3.0, < 3) web-console (3.7.0) actionview (>= 5.0) activemodel (>= 5.0) bindex (>= 0.4.0) railties (>= 5.0) - websocket-driver (0.7.0) + websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) - websocket-driver (0.7.0-java) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.3) + websocket-extensions (0.1.5) PLATFORMS - java - ruby + x86_64-linux DEPENDENCIES activerecord-jdbcsqlite3-adapter @@ -237,7 +236,7 @@ DEPENDENCIES mini_racer puma (~> 3.7) rails (~> 5.2) - rails-assets-chartjs! + rails-assets-chartjs (= 2.1.1)! redis (~> 4.0) sass-rails (~> 5.0) spring @@ -247,3 +246,6 @@ DEPENDENCIES tzinfo-data uglifier (>= 1.3.0) web-console (>= 3.3.0) + +BUNDLED WITH + 2.2.24 diff --git a/README.md b/README.md index d3ca2cf..9ee10df 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,14 @@ This is a tool for creating nice Workshops developed by the OpenShift Evangelist ![Nice workshop example](./docs/images/Workshop-Example.png) Please, read the [documentation](./docs/README.md) + +# For Developers +> If you need to generate the `Gemfile.lock` + +```shell +# build with this dockerfile +$ docker build -f DockerfileToGenerateGemfile_lock -t myworkshopper . + +# get the generated Gemfile.lock +$ docker run --rm -it --user=0 --name workshopper --entrypoint "/bin/cat" myworkshopper Gemfile.lock > Gemfile.lock +``` \ No newline at end of file diff --git a/app/assets/stylesheets/asciidoctor.css b/app/assets/stylesheets/asciidoctor.css index 7307644..d5f31bf 100644 --- a/app/assets/stylesheets/asciidoctor.css +++ b/app/assets/stylesheets/asciidoctor.css @@ -62,7 +62,7 @@ a:hover,a:focus{color:#1d4b8f} a img{border:none} p{font-family:inherit;font-weight:400;font-size:1em;line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility} p aside{font-size:.875em;line-height:1.35;font-style:italic} -h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:"Open Sans","DejaVu Sans",sans-serif;font-weight:300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em} +h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:"Open Sans","DejaVu Sans",sans-serif;font-weight:300;font-style:normal;color:#000000;text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em} h1 small,h2 small,h3 small,#toctitle small,.sidebarblock>.content>.title small,h4 small,h5 small,h6 small{font-size:60%;color:#e99b8f;line-height:0} h1{font-size:2.125em} h2{font-size:1.6875em} @@ -181,7 +181,7 @@ p a>code:hover{color:rgba(0,0,0,.9)} #content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400} #content h1>a.anchor::before,h2>a.anchor::before,h3>a.anchor::before,#toctitle>a.anchor::before,.sidebarblock>.content>.title>a.anchor::before,h4>a.anchor::before,h5>a.anchor::before,h6>a.anchor::before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em} #content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible} -#content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none} +#content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#000000;text-decoration:none} #content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221} .audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em} .admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic} diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 66af22d..1b71f07 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -12,7 +12,8 @@ def index w = Workshopper::Cache.workshops[id] { id: w.id, - name: w.name + name: w.name, + description: w.description } end end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 096d8a2..a240198 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -13,6 +13,15 @@ <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> + +