Skip to content

Commit

Permalink
Merge pull request #987 from ethn/release
Browse files Browse the repository at this point in the history
getting docker working again
  • Loading branch information
ethn committed Mar 31, 2023
2 parents 2068ccc + d07fad4 commit 011b225
Show file tree
Hide file tree
Showing 12 changed files with 404 additions and 392 deletions.
458 changes: 230 additions & 228 deletions Gemfile.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Rakefile
Expand Up @@ -4,6 +4,8 @@ require "./decko_gem"

DOCKER_IMAGES = %w[base bundled mysql postgres sandbox].map { |name| "decko-#{name}" }

# DOCKER_IMAGES = ["decko-base", "decko-bundled"]

# NOTE: these tasks are not in any gem and are thus not available to monkeys.
# Therefore they should contain only platypus tasks.

Expand Down Expand Up @@ -32,6 +34,7 @@ task :build_images do
system "cd docker/template; bundle update"

DOCKER_IMAGES.each do |i|
system "echo '\nBUILDING: #{i}'"
system "cd docker; "\
"docker build -f repos/#{i}.dockerfile "\
"-t ethn/#{i} -t ethn/#{i}:latest -t ethn/#{i}:v#{version} ."
Expand Down
2 changes: 1 addition & 1 deletion card/VERSION
@@ -1 +1 @@
0.15.0
0.15.3
10 changes: 8 additions & 2 deletions card/lib/cardio/version.rb
Expand Up @@ -10,13 +10,15 @@ def release
end

def card_release
@card_release ||= [1, minor, point].compact.map(&:to_s).join "."
@card_release ||= [1, minor, point, pre].compact.map(&:to_s).join "."
end

private

def bits
release.split(".").map(&:to_i)
release.split(".").map do |bit|
bit.match?(/^\d/) ? bit.to_i : bit
end
end

def major
Expand All @@ -30,6 +32,10 @@ def minor
def point
bits[2]
end

def pre
bits[3]
end
end
end
end
2 changes: 1 addition & 1 deletion card/lib/generators/deck/deck_generator.rb
Expand Up @@ -124,7 +124,7 @@ def seed_data
prefix = "bundle exec " if options["platypus"]
puts "Now:
1. Run `cd #{File.basename(destination_root)}` to enter your new deck directory
2. Run `#{prefix}decko seed` to seed your database (see config/database.yml).
2. Run `#{prefix}decko setup` to seed your database (see config/database.yml).
3. Run `#{prefix}decko server` to start your server"
end
end
Expand Down
6 changes: 3 additions & 3 deletions card/lib/generators/deck/deck_generator/interactive.rb
Expand Up @@ -77,7 +77,7 @@ def add_seed_options
def add_common_seed_option
@menu["s"] = {
desc: "seed #{Rails.env}#{' and test' if dev_options?} database",
command: "decko seed",
command: "decko setup",
code: proc do
bundle_exec "rake decko:seed"
bundle_exec "rake decko:seed", rails_env: "test" if dev_options?
Expand All @@ -89,7 +89,7 @@ def add_common_seed_option
def add_seed_all_option
@menu["a"] = {
desc: "seed all databases (production, development, and test)",
command: "decko seed --all",
command: "decko setup --all",
code: proc do
%w[production development test].each do |env|
bundle_exec "rake decko:seed", rails_env: env
Expand All @@ -101,7 +101,7 @@ def add_seed_all_option

def add_exit_option
@menu["x"] = {
desc: "exit (run 'decko seed' to complete the installation later)"
desc: "exit (run 'decko setup' to complete the installation later)"
}
end

Expand Down
4 changes: 2 additions & 2 deletions card/mod/core/lib/tasks/card/mod.rake
@@ -1,12 +1,12 @@
namespace :card do
namespace :mod do
desc "list current mods in load order"
task list: :environment do
task :list do
Cardio.mods.each { |m| puts "#{m.name}: #{m.path}".green }
end

desc "symlink from deck public/{modname} to mod's public directory"
task symlink: :environment do
task :symlink do
FileUtils.rm_rf public_mod_dir
FileUtils.mkdir_p public_mod_dir
Cardio::Mod.dirs.each_subpath "public" do |mod, target|
Expand Down
2 changes: 1 addition & 1 deletion decko/README.md
Expand Up @@ -101,7 +101,7 @@ configuration at https://www.decko.org/database_configuration.
Then run

cd MY_DECK
decko seed
decko setup

..to create and seed the database

Expand Down
2 changes: 1 addition & 1 deletion docker/README.md
Expand Up @@ -44,7 +44,7 @@ The most straightforward way to install decko chambers is with decko compose.
- File storage (eg for uploaded files and images). Default is to store files on the host. For that to work, you'll only need to make a directory named `files` in your deck directory. See comments if you'd prefer cloud storage.
3. Run the following:
- `docker compose up -d` # this creates your volumes, starts your containers, etc.
- `docker compose exec app decko seed` # this creates and seeds your decko database
- `docker compose exec app decko setup` # this creates and seeds your decko database

As with the sandbox this will by default make a site available on port 4444, though that too can be configured in the docker-compose.yml file.

Expand Down
2 changes: 1 addition & 1 deletion docker/repos/decko-base.dockerfile
Expand Up @@ -4,7 +4,7 @@ FROM phusion/passenger-full

# ENABLE RUBY, MEMCACHED, NGINX
# use ruby 2.7 (default)
RUN bash -lc 'rvm --default use ruby-2.7.5'
RUN bash -lc 'rvm --default use ruby-2.7.7'
# enable memcached
RUN rm -f /etc/service/memcached/down
# enable nginx
Expand Down
2 changes: 1 addition & 1 deletion docker/repos/decko-sandbox.dockerfile
Expand Up @@ -8,5 +8,5 @@ CMD ["/sbin/my_init"]

RUN bundle install

RUN decko seed
RUN decko setup
RUN chown -R app.app .

0 comments on commit 011b225

Please sign in to comment.