Update dependencies and add pipelines (#2)
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is failing

* Update Ruby/Rails/other deps
* Unlock Rails and tie to master
  * Gain access to 7.1 incoming feature allowing CI without secret_key_base
* Use Rails 7.1 Dockerfile
* Pipeline for some merge checks
* Pipeline to deploy

Reviewed-on: #2
This commit is contained in:
Andrew Tomaka 2023-03-12 10:27:02 -04:00
parent fd75a7c6ff
commit 58798d524f
7 changed files with 198 additions and 74 deletions

28
.dockerignore Normal file
View file

@ -0,0 +1,28 @@
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.
# Ignore bundler config.
/.bundle
# Ignore all default key files
config/master.key
config/credentials/*.key
# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep
# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep
# Ignore storage (uploaded files in development and any SQLite databases).
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/
!/tmp/storage/.keep
/public/assets

View file

@ -44,3 +44,43 @@ steps:
volumes: volumes:
- name: bundle - name: bundle
temp: {} temp: {}
trigger:
branch:
exclude: master
event: push
---
name: deploy
kind: pipeline
steps:
- name: docker-build
image: plugins/docker
environment:
SECRET_KEY_BASE:
from_secret: secret_key_base
RAILS_MASTER_KEY:
from_secret: rails_master_key
settings:
pull_image: true
registry: docker.atomaka.com
repo: docker.atomaka.com/budget
tags:
- latest
- ${DRONE_TAG}
- name: deploy
image: appleboy/drone-ssh
settings:
host:
from_secret: unraid_host
username:
from_secret: unraid_username
key:
from_secret: unraid_ssh_key
script:
- docker pull docker.atomaka.com/budget:latest
- docker restart budget
trigger:
event: tag

27
Dockerfile Normal file
View file

@ -0,0 +1,27 @@
# Make sure it matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=3.2.0
FROM ruby:$RUBY_VERSION
# Set production environment
ENV RAILS_LOG_TO_STDOUT="1" \
RAILS_SERVE_STATIC_FILES="true" \
RAILS_ENV="production" \
BUNDLE_WITHOUT="development:test"
# Install application gems
COPY Gemfile Gemfile.lock ./
RUN bundle install
# Copy application code
COPY . .
# Precompile bootsnap code for faster boot times
RUN bundle exec bootsnap precompile --gemfile app/ lib/
# Precompiling assets for production without requiring secret RAILS_MASTER_KEY
RUN SECRET_KEY_BASE_DUMMY=1 bundle exec rails assets:precompile
# Entrypoint prepares database and starts app on 0.0.0.0:3000 by default,
# but can also take a rails command, like "console" or "runner" to start instead.
ENTRYPOINT ["/rails/bin/docker-entrypoint"]
EXPOSE 3000

View file

@ -3,7 +3,8 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "3.2.0" ruby "3.2.0"
gem "rails", "7.0.4.2" # unti 7.1 is out
gem "rails", git: "https://github.com/rails/rails"
gem "sprockets-rails" gem "sprockets-rails"
gem "sqlite3" gem "sqlite3"
gem "puma" gem "puma"

View file

@ -1,71 +1,102 @@
GEM GIT
remote: https://rubygems.org/ remote: https://github.com/rails/rails
revision: 3025eaa09154f5f031f5c2e0e5b59553ff5c902b
specs: specs:
actioncable (7.0.4.2) actioncable (7.1.0.alpha)
actionpack (= 7.0.4.2) actionpack (= 7.1.0.alpha)
activesupport (= 7.0.4.2) activesupport (= 7.1.0.alpha)
nio4r (~> 2.0) nio4r (~> 2.0)
websocket-driver (>= 0.6.1) websocket-driver (>= 0.6.1)
actionmailbox (7.0.4.2) zeitwerk (~> 2.6)
actionpack (= 7.0.4.2) actionmailbox (7.1.0.alpha)
activejob (= 7.0.4.2) actionpack (= 7.1.0.alpha)
activerecord (= 7.0.4.2) activejob (= 7.1.0.alpha)
activestorage (= 7.0.4.2) activerecord (= 7.1.0.alpha)
activesupport (= 7.0.4.2) activestorage (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
mail (>= 2.7.1) mail (>= 2.7.1)
net-imap net-imap
net-pop net-pop
net-smtp net-smtp
actionmailer (7.0.4.2) actionmailer (7.1.0.alpha)
actionpack (= 7.0.4.2) actionpack (= 7.1.0.alpha)
actionview (= 7.0.4.2) actionview (= 7.1.0.alpha)
activejob (= 7.0.4.2) activejob (= 7.1.0.alpha)
activesupport (= 7.0.4.2) activesupport (= 7.1.0.alpha)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
net-imap net-imap
net-pop net-pop
net-smtp net-smtp
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
actionpack (7.0.4.2) actionpack (7.1.0.alpha)
actionview (= 7.0.4.2) actionview (= 7.1.0.alpha)
activesupport (= 7.0.4.2) activesupport (= 7.1.0.alpha)
rack (~> 2.0, >= 2.2.0) nokogiri (>= 1.8.5)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3) rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.4.2) actiontext (7.1.0.alpha)
actionpack (= 7.0.4.2) actionpack (= 7.1.0.alpha)
activerecord (= 7.0.4.2) activerecord (= 7.1.0.alpha)
activestorage (= 7.0.4.2) activestorage (= 7.1.0.alpha)
activesupport (= 7.0.4.2) activesupport (= 7.1.0.alpha)
globalid (>= 0.6.0) globalid (>= 0.6.0)
nokogiri (>= 1.8.5) nokogiri (>= 1.8.5)
actionview (7.0.4.2) actionview (7.1.0.alpha)
activesupport (= 7.0.4.2) activesupport (= 7.1.0.alpha)
builder (~> 3.1) builder (~> 3.1)
erubi (~> 1.4) erubi (~> 1.11)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.4.2) activejob (7.1.0.alpha)
activesupport (= 7.0.4.2) activesupport (= 7.1.0.alpha)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (7.0.4.2) activemodel (7.1.0.alpha)
activesupport (= 7.0.4.2) activesupport (= 7.1.0.alpha)
activerecord (7.0.4.2) activerecord (7.1.0.alpha)
activemodel (= 7.0.4.2) activemodel (= 7.1.0.alpha)
activesupport (= 7.0.4.2) activesupport (= 7.1.0.alpha)
activestorage (7.0.4.2) activestorage (7.1.0.alpha)
actionpack (= 7.0.4.2) actionpack (= 7.1.0.alpha)
activejob (= 7.0.4.2) activejob (= 7.1.0.alpha)
activerecord (= 7.0.4.2) activerecord (= 7.1.0.alpha)
activesupport (= 7.0.4.2) activesupport (= 7.1.0.alpha)
marcel (~> 1.0) marcel (~> 1.0)
mini_mime (>= 1.1.0) mini_mime (>= 1.1.0)
activesupport (7.0.4.2) activesupport (7.1.0.alpha)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
i18n (>= 1.6, < 2) i18n (>= 1.6, < 2)
minitest (>= 5.1) minitest (>= 5.1)
tzinfo (~> 2.0) tzinfo (~> 2.0)
rails (7.1.0.alpha)
actioncable (= 7.1.0.alpha)
actionmailbox (= 7.1.0.alpha)
actionmailer (= 7.1.0.alpha)
actionpack (= 7.1.0.alpha)
actiontext (= 7.1.0.alpha)
actionview (= 7.1.0.alpha)
activejob (= 7.1.0.alpha)
activemodel (= 7.1.0.alpha)
activerecord (= 7.1.0.alpha)
activestorage (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
bundler (>= 1.15.0)
railties (= 7.1.0.alpha)
railties (7.1.0.alpha)
actionpack (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.6)
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.1) addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0) public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2) ast (2.4.2)
@ -83,14 +114,15 @@ GEM
regexp_parser (>= 1.5, < 3.0) regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2) xpath (~> 3.2)
childprocess (4.1.0) childprocess (4.1.0)
concurrent-ruby (1.1.10) concurrent-ruby (1.2.2)
connection_pool (2.3.0)
crass (1.0.6) crass (1.0.6)
date (3.3.3) date (3.3.3)
debug (1.6.3) debug (1.6.3)
irb (>= 1.3.6) irb (>= 1.3.6)
reline (>= 0.3.1) reline (>= 0.3.1)
erubi (1.11.0) erubi (1.12.0)
globalid (1.0.0) globalid (1.1.0)
activesupport (>= 5.0) activesupport (>= 5.0)
i18n (1.12.0) i18n (1.12.0)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
@ -115,9 +147,8 @@ GEM
net-smtp net-smtp
marcel (1.0.2) marcel (1.0.2)
matrix (0.4.2) matrix (0.4.2)
method_source (1.0.0)
mini_mime (1.1.2) mini_mime (1.1.2)
minitest (5.16.3) minitest (5.18.0)
msgpack (1.6.0) msgpack (1.6.0)
net-imap (0.3.4) net-imap (0.3.4)
date date
@ -137,36 +168,20 @@ GEM
public_suffix (5.0.0) public_suffix (5.0.0)
puma (6.1.1) puma (6.1.1)
nio4r (~> 2.0) nio4r (~> 2.0)
racc (1.6.0) racc (1.6.2)
rack (2.2.4) rack (2.2.6.3)
rack-session (1.0.1)
rack (< 3)
rack-test (2.0.2) rack-test (2.0.2)
rack (>= 1.3) rack (>= 1.3)
rails (7.0.4.2) rackup (1.0.0)
actioncable (= 7.0.4.2) rack (< 3)
actionmailbox (= 7.0.4.2) webrick
actionmailer (= 7.0.4.2)
actionpack (= 7.0.4.2)
actiontext (= 7.0.4.2)
actionview (= 7.0.4.2)
activejob (= 7.0.4.2)
activemodel (= 7.0.4.2)
activerecord (= 7.0.4.2)
activestorage (= 7.0.4.2)
activesupport (= 7.0.4.2)
bundler (>= 1.15.0)
railties (= 7.0.4.2)
rails-dom-testing (2.0.3) rails-dom-testing (2.0.3)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
nokogiri (>= 1.6) nokogiri (>= 1.6)
rails-html-sanitizer (1.5.0) rails-html-sanitizer (1.5.0)
loofah (~> 2.19, >= 2.19.1) loofah (~> 2.19, >= 2.19.1)
railties (7.0.4.2)
actionpack (= 7.0.4.2)
activesupport (= 7.0.4.2)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rainbow (3.1.1) rainbow (3.1.1)
rake (13.0.6) rake (13.0.6)
regexp_parser (2.6.1) regexp_parser (2.6.1)
@ -217,7 +232,7 @@ GEM
actionpack (>= 6.0.0) actionpack (>= 6.0.0)
activejob (>= 6.0.0) activejob (>= 6.0.0)
railties (>= 6.0.0) railties (>= 6.0.0)
tzinfo (2.0.5) tzinfo (2.0.6)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
unicode-display_width (2.4.2) unicode-display_width (2.4.2)
web-console (4.2.0) web-console (4.2.0)
@ -229,13 +244,14 @@ GEM
nokogiri (~> 1.6) nokogiri (~> 1.6)
rubyzip (>= 1.3.0) rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0) selenium-webdriver (~> 4.0)
webrick (1.8.1)
websocket (1.2.9) websocket (1.2.9)
websocket-driver (0.7.5) websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0) websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5) websocket-extensions (0.1.5)
xpath (3.2.0) xpath (3.2.0)
nokogiri (~> 1.8) nokogiri (~> 1.8)
zeitwerk (2.6.6) zeitwerk (2.6.7)
PLATFORMS PLATFORMS
x86_64-linux x86_64-linux
@ -247,7 +263,7 @@ DEPENDENCIES
importmap-rails importmap-rails
jbuilder jbuilder
puma puma
rails (= 7.0.4.2) rails!
selenium-webdriver selenium-webdriver
sprockets-rails sprockets-rails
sqlite3 sqlite3

12
bin/docker-entrypoint Executable file
View file

@ -0,0 +1,12 @@
#!/bin/sh
if [ $# -eq 0 ]; then
# Create new or migrate existing database
./bin/rails db:prepare
# Start the server by default
exec bin/rails server
else
# Allow other commands, like console or runner, to be called
exec bin/rails "$@"
fi

View file

@ -1 +1 @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